Sample Programs in Every Language

Sample Programs in Every Language Featured Image

Last Updated on

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 chrestomathy.

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 Code. 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 FizzBuzz. Think Min and Max. 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 repository. 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 solutions 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 repository 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 cash. 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. You can find a list of the current projects below:

  1. File IO in C++
  2. File IO in Every Language
  3. File IO in Python
  4. File IO in Ruby
  5. Fizz Buzz in Every Language
  6. Fizz Buzz in PowerShell
  7. Fizz Buzz in Python
  8. Hello World in ALGOL 68
  9. Hello World in Bash
  10. Hello World in Befunge
  11. Hello World in Brainfuck
  12. Hello World in C
  13. Hello World in C*
  14. Hello World in C#
  15. Hello World in C++
  16. Hello World in Crystal
  17. Hello World in D
  18. Hello World in Dart
  19. Hello World in Elixir
  20. Hello World in Elm
  21. Hello World in Every Language
  22. Hello World in Go
  23. Hello World in Goby
  24. Hello World in Google Apps Script
  25. Hello World in Hack
  26. Hello World in Haskell
  27. Hello World in Java
  28. Hello World in JavaScript
  29. Hello World in Julia
  30. Hello World In Koka
  31. Hello World in Kotlin
  32. Hello World in Lisp
  33. Hello World in Lua
  34. Hello World in MATLAB
  35. Hello World in MoonScript
  36. Hello World in Objective-C
  37. Hello World in Opa
  38. Hello World in Pascal
  39. Hello World in Perl
  40. Hello World in PHP
  41. Hello World in PicoLisp
  42. Hello World in PowerShell
  43. Hello World in Python
  44. Hello World in R
  45. Hello World in Racket
  46. Hello World in Red
  47. Hello World in Ruby
  48. Hello World in Rust
  49. Hello World in Scala
  50. Hello World in Scheme
  51. Hello World in Solidity
  52. Hello World in Swift
  53. Hello World in Visual Basic .NET
  54. Hello World in Wren
  55. Reverse a String in Every Language
  56. Reverse a String in Java
  57. Reverse a String in Python
  58. Reverse a String in Ruby
  59. Reverse a String in Scheme
  60. Reverse a String in Swift

That said, be aware that we are currently transitioning the collection to GitHub pages, 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 repository and make a pull request with your changes.

Series NavigationHello World in Every Language →

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.