Sample Programs in Every Language

Sample Programs in Every Language Featured Image

Welcome to Sample Programs in Every Language (SPEL): a collection of articles that explores language features through code snippets. Feel free to browse the whole article or use the links below to jump to each section.

Table of Contents

What is SPEL?

Sample Programs in Every Language is a collection of articles that explores common code snippets in as many programming languages as possible. In language studies, this type of collection is know as a chrestomathyOpens in a new tab..

Due to the overwhelming amount of time and effort it takes to generate these articles, you may find that this collection is more modest than some of its counterparts:

That said, I hope that Sample Programs in Every Language brings you something new and interesting. With every code snippet comes an article breaking down language features while sharing language history and background. Together, maybe we’ll learn something!

The Inspiration for SPEL

Awhile back, I thought it would be fun to implement Hello World in a different language every day for 100 Days of CodeOpens in a new tab.. After about 20 days, I started to get bored. After all, Hello World isn’t really that challenging, and it hardly introduces the language.

At that point, I decided to open up the series to a more diverse set of typical coding challenges. Think FizzBuzzOpens in a new tab.. Think Min and MaxOpens in a new tab.. Algorithms like these show off language features in all their glory. Oh, and they make great interview questions.

Of course, I love a good open source project that offers opportunities for the community to contribute. This project is no different. In fact, I encourage everyone to at least browse the GitHub repositoryOpens in a new tab.. If I’m lucky, maybe you’ll choose to help out.

The Purpose of SPEL

As you can probably imagine, Sample Programs in Every Language serves several purposes.

First, SPEL provides a way for anyone to find solutions to common programming problems. After all, at its core, SPEL is simply a collection of code snippets. No longer will you need to dig through toxic Stack Overflow solutionsOpens in a new tab. just to find what you need.

Second, SPEL allows anyone to read explanations of code snippets through detailed articles. Who hasn’t borrowed a code snippet without understanding how or why it works? Now, anyone can dig into the solutions to make informed decisions.

In addition, SPEL grants anyone the opportunity to examine language syntax and design. With a collection of code snippets in every language, we have a chance to compare algorithms across multiple languages.

Finally, SPEL gives anyone a chance to contribute to a large open source project. With SPEL, it couldn’t be easier to fork the repository and start contributing solutions to a growing collection of code snippets.

How to Support SPEL

Of course, for any of the above purposes to be realized, the project requires support.

Perhaps the best way to show your support is to tell me what languages and code snippets you want to see next. You can do so by dropping your ideas down below in the comments.

In addition, you can always fork my GitHub repositoryOpens in a new tab. and make a pull request with your changes. That saves me the time of actually writing the code, so I can get to making articles. Also, it gives me a nice task list that I can use to track my progress.

Finally, you can toss me some cashOpens in a new tab.. While money obviously isn’t a requirement, it does serve as a nice motivator to keep working on the collection.

The List of SPEL Projects

The Sample Programs in Every Language collection is broken up into a set of projects. That said, it’s a huge pain to maintain the list of articles, so I recommend jumping straight to the archive. Alternatively, you an move right to the first article in the series using the navigation at the bottom of this page.

That said, be aware that we are currently transitioning the collection to GitHub pagesOpens in a new tab., and we will no longer be maintaining the articles here.

As always, thanks for sticking around. If you found this article interesting, make sure to give it a share. Also, if you have any ideas for projects, let me know in the comments. Alternatively, you can fork the sample programs repositoryOpens in a new tab. and make a pull request with your changes.

Sample Programs in Every Language (44 Articles)—Series Navigation

For 100 Days of Code, I’ve decided to implement a few sample programs in as many languages as possible. Each implementation details a brief history of the language and a description of the code.

The plan for the series is to explore the major general-purpose language like Java, Python, C, C++, and C#. From there, we’ll take a look at some sample programs in web development languages like Ruby, PHP, and JavaScript. As we continue, we’ll cover proprietary languages like Swift and Objective-C. Eventually, we’ll start to tackle less popular languages like Rust, x86, and Verilog. Finally, we’ll play around with some of the esoteric languages like Brainf*ck and LOLCODE.

Who knows? Maybe the Sample Programs in Every Language series will become so popular it’ll never end. To help this series grow, consider sharing it on social media with your friends. Or, if you have a language you want to see, drop your suggestion in the comments.

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 Posts