Practice Your Coding Skills With the Sample Programs Template

Practice Your Coding Skills With the Sample Programs Template Repo

This summer, I spent a bunch of time overhauling many of the projects related to the Sample Programs repo (more on that in the future). For now, I want to talk about one of those changes: the Sample Programs template.

Table of Contents

What Is the Sample Programs Template?

If you’ve been around this community, you’re probably familiar with the Sample Programs repo. In short, it’s basically a collection of code snippets in as many programming languages as possible. As of today (8/30/21), it contains 603 code snippets from 162 different programming languages.

At some point over the last couple months, I noticed that GitHub had a template repo featureOpens in a new tab.. The idea being that a user could create their own repository from the structure of an existing repository. Previously, this could really only be done through forking which creates a link with the original repo. In fact, the Sample Programs repo was originally a fork of the 100 Days of Code repo. Now with the template feature, a new repo can be created from an existing one by hitting a button.

Very quickly, this new template feature gave me some ideas. For example, I had an idea to create a Python project template that I could reuse for other Python projects. Eventually, I had the idea to create a template for the Sample Programs repo, so folks could create their own Sample Programs collections. Thus, the Sample Programs TemplateOpens in a new tab. was born.

Which Languages Are Supported by the Sample Programs Template?

As the Sample Programs repo has grown, changes become harder to make. For example, if we want to add testing for a particular programming language, we have to ensure all existing files pass testing. This process becomes extremely time consuming as there are nearly 200 programming languages to bring up to speed.

With the template repo, we’re able to take any lessons learned from the master repo and apply then to the template repo. For example, the template repo only supports programming languages that meet the following criteria:

  • Have an official docker image
  • Have language documentation

This allows us to ensure that any languages included in the template receive proper support such as automated testing. Unfortunately, this means the template is restricted to mainstream languages, but those tend to be the only languages that we receive submissions for anyway. As a result, here’s the official language list at the time of writing:

  • C
  • C++
  • Go
  • Java
  • Python
  • Ruby

Naturally, more languages will be added as official images are created.

What Features Are Supported by the Sample Programs Template?

As mentioned previously, the sample programs template isn’t just a place to store code. It’s an entire environment fitted with continuous integration. As a result, as you include code snippets, you’ll see them get tested and approved. This allows you to show off any code you write in a portfolio with proof that the code really works.

Outside of automated testing, the Sample Programs template also provides automated README generation. At the moment, the READMEs are exactly the same as the READMEs generated for the Sample Programs repo, so links will point back there. That said, we think this benefits the core repo as folks look to expand our documentation for their own portfolios and the greater community.

Otherwise, that’s basically it! The purpose of this template is to give you chance to write your own solutions to all of the coding problems detailed hereOpens in a new tab..

Why Take Advantage of the Sample Programs Template?

The way I see it, the Sample Programs Template is an opportunity for new developers to show off their stuff. In other words, it’s a living portfolio. Each problem can be solved in a variety of ways which allows you to show your creativity.

If you’re not quite ready to put together a portfolio, the Sample Programs template might just serve as an excellent learning tool. With each solution you write, you can watch as the your knowledge of programming expands.

Another reason you might jump on the template is to take advantage of the low stress environment to get involved in open source code. If you manage to get a solution working in the template that isn’t in the Sample Programs collection, the template should give you confidence to share it with us!

Hell, even if you’re not looking for a job, but you like coding as a hobby: this might be for you. I originally created the Sample Programs repo as a way to explore different programming languages. Maybe that’s an interest you share, so why not take advantage of the template and dabble in a new language or two?

With all that said, that’s all I have to share! If you’re interested in supporting any of these projects, head over to my list of ways to grow the site. Otherwise, take care!

Sample Programs Repo News (15 Articles)—Series Navigation

Everyone once in awhile, I like to update y’all on what’s going on in the Sample Programs repo. At this point, I’ve written quite a few updates, so I figured it might be helpful to group them as a series.

Jeremy Grifski

Jeremy grew up in a small town where he enjoyed playing soccer and video games, practicing taekwondo, and trading Pokémon cards. Once out of the nest, he pursued a Bachelors in Computer Engineering with a minor in Game Design. After college, he spent about two years writing software for a major engineering company. Then, he earned a master's in Computer Science and Engineering. Today, he pursues a PhD in Engineering Education in order to ultimately land a teaching gig. In his spare time, Jeremy enjoys spending time with his wife, playing Overwatch and Phantasy Star Online 2, practicing trombone, watching Penguins hockey, and traveling the world.

Recent Meta Posts