Written by Jeremy Grifski in Meta Published October 26, 2020Last Updated October 11, 2020
Welp, Hacktoberfest is back, and it’s brought along quite a few pull requests. We’re just a third of the way through (at the time of writing), and we’ve already hit two milestones. Today, we’ll be talking about how we hit 500 code snippets!
Before we talk about the latest achievement, I find it helpful to give a quick overview of the project and how we got here.
First, the Sample Programs repo is a collection of code snippets in as many programming languages as possible. This idea originally stemmed from me hopping on the 100 Days of Code bandwagon where I had the idea to generate Hello World in a different language every day. Now, the codebase features over 500 code snippets in over 125 languages.
As you can image, this project is no longer home to Hello World; that’s just the starting place. Now, we feature over 25 projects that you’re welcome to contribute to.
To ensure quality of code snippets, we have two rules in place:
Projects must be documented before you contribute to them
Projects must have tests written for them
These rules allow us to enforce a baseline level of quality across all code snippets. In other words, you can be sure that every time you see a Hello World program, it will behave according to our specifications.
As an added bonus, we try to document all our snippets. That said, because writing is so unpopular, we don’t really have as much of a standard of quality. It’s unfortunate, but we hope to rectify that someday!
That said, we’re not here to mope; we’re here to celebrate our latest achievement! Let’s talk about it.
500+ Code Snippets
As the title of this article implies, we’ve finally hit 500 code snippets after roughly two years of grinding away on this repo. Unfortunately, I’ve never really been good at monitoring these milestones, so the release page is usually a bit late. That said, here’s what those changes look like:
Languages That Start With A
Language
# of Snippets
Abap
1
Ada
1
Agda
1
ALGOL68
1
Apex
2 (+2)
AppleScript
1
AutoHotKey
1 (+1)
Totals
8 (+3)
Languages That Start With B
Language
# of Snippets
Ballerina
1
Bash
14 (+8)
Batch
1 (+1)
Befunge
3 (+1)
Boo
2 (+2)
Brainfuck
3
Totals
24 (+12)
Languages That Start With C
Language
# of Snippets
C
23 (+12)
C++
21 (+17)
C#
20 (+2)
C*
1
Carp
1
Chapel
1
Clipper
1
Clojure
4 (+3)
COBOL
1
CoffeeScript
3 (+2)
Crystal
3
Totals
79 (+36)
Languages That Start With D
Language
# of Snippets
D
2
Dale
1
Dart
14 (+12)
Dg
5
Dusk
1
Totals
23 (+12)
Languages That Start With E
Language
# of Snippets
Egison
1
Elena
1
Elixir
6 (+5)
Elm
1
Emojicode
1
Erlang
6 (+5)
Eve
1
Totals
17 (+10)
Languages That Start With F
Language
# of Snippets
F#
2 (+1)
Factor
1
Felix
1
Fennel
1
Ferret
1
Fetlang
1
Formality
1 (+1)
Forth
1
FORTRAN
3 (+1)
Frege
1
Totals
13 (+3)
Languages That Start With G
Language
# of Snippets
Gerbil
1 (+1)
Gluon
1
Go
22 (+15)
Goby
1
Golo
1
Google Apps Script
1
Gravity
1
Groovy
8 (+6)
Totals
36 (+22)
Languages That Start With H
Language
# of Snippets
Hack
1
Haskell
21 (+2)
Totals
22 (+2)
Languages That Start With I
Language
# of Snippets
Idris
1
Totals
1
Languages That Start With J
Language
# of Snippets
Janet
1 (+1)
JavaScript
20 (+15)
Java
23 (+16)
Julia
7 (+3)
Totals
51 (+35)
Languages That Start With K
Language
# of Snippets
Kitten
1
Koka
1
Kotlin
14 (+9)
Totals
16 (+9)
Languages That Start With L
Language
# of Snippets
Lily
1
Lisp
6 (+4)
Little
1
Livescript
1 (+1)
Lobster
1 (+1)
Lolcode
2 (+1)
Lua
13 (+10)
Lucee
1 (+1)
Totals
26 (+18)
Languages That Start With M
Language
# of Snippets
MATLAB
10 (+9)
Microsoft Macro Assembler
1 (+1)
Modula2
1 (+1)
MojiScript
1
MoonScript
1
Totals
14 (+11)
Languages That Start With N
Language
# of Snippets
Never
2
Nim
3 (+2)
Totals
5 (+2)
Languages That Start With O
Language
# of Snippets
Objective C
6 (+5)
OCAML
1
Octave
1
Odin
1
Opa
1
Orc
1
Owl Lisp
1
Totals
12 (+5)
Languages That Start With P
Language
# of Snippets
P
1 (+1)
Pascal
2
Perl
14 (+11)
Perl6
1 (+1)
PHP
22 (+19)
PicoLisp
2
Pony
1
PowerShell
3
PureScript
1
Pyret
1
Python
32 (+12)
Totals
80 (+44)
Languages That Start With Q
Language
# of Snippets
Quack
1
Totals
1
Languages That Start With R
Language
# of Snippets
R
2 (+1)
Racket
4 (+3)
Red
1
Rexx
1
Ring
1
Ruby
9 (+2)
Rust
11 (+5)
Totals
29 (+11)
Languages That Start With S
Language
# of Snippets
Sather
1 (+1)
Scala
8 (+6)
Scheme
3 (+1)
Shen
1
Smalltalk
1
Solidity
1
Solisp
4 (+4)
Swift
6 (+2)
Totals
25 (+14)
Languages That Start With T
Language
# of Snippets
Tcl
1
Tex
2
TI-BASIC
1 (+1)
TypeScript
9 (+4)
Totals
13 (+5)
Languages That Start With V
Language
# of Snippets
Verilog
2 (+1)
Vimscript
3
Visual Basic
4 (+2)
Totals
9 (+3)
Languages That Start With W
Language
# of Snippets
Whitespace
1 (+1)
Wren
1
Wu
1
Wyvern
1
Totals
4 (+1)
Summary Statistics
One thing I always like to do is report out on what the repo looked like at this time. Here are a few of those statistics:
4,147 Commits
7 Tags
236 Contributors
505 Forks
Also, it’s totally reasonable to be skeptical of some of these metrics. I’m not sure how many of them are updated on GitHub when I select the tag, but I write this close enough to the milestone that it should be somewhat reflective. Same goes for the following language breakdown:
Python: 14.1%
C: 8.3%
C++: 8.0%
Java: 7.8%
JavaScript: 5.2%
PHP: 5.1%
Other: 51.5%
Since the last update, it looks like Haskell has gone missing. Let’s see if we can bring it back to life in the next release! In the meantime, let’s talk about next steps.
The Future of Sample Programs
At this point, Sample Programs is a project that we tend to maintain only around this time of year as it’s the only time we can get help. That said, I’m hoping that as this project grows, we’ll retain some of the folks that helped out. It’s a stretch, but hey! Auroq still helps quite often.
At this point, we’re really trying to tackle the tech debt issue. In particular, we’re asking contributors to write their own documentation and tests for us. That way, new contributions don’t add tech debt, and we can focus on the existing tech debt. For instance, someone recently helped use add testing to Kotlin!
I suspect that we’ll be addressing this tech debt issue for awhile, but I’m actually really excited about that. The more legitimate we can make the repo appear, the more folks will want to be a part of it.
With that said, that’s all I have for the update! There will be a similar update coming out shortly to highlight project testing. In the meantime, you can help the project grow by heading over and throwing it a star. We’d really appreciate it!
Also, you can help support The Renegade Coder by visiting the following list. It includes links to the Discord, YouTube channel, and Newsletter. In addition, here are a couple articles about the Sample Programs repo:
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 and kid, playing Overwatch 2, Lethal Company, and Baldur's Gate 3, reading manga, watching Penguins hockey, and traveling the world.
This week, we're hitting another beginner topic: the assignment operator. While the idea is simple, the concept is rich in related ideas like scope, iterable unpacking, and augmented assignment.