Skip to content

Instantly share code, notes, and snippets.

@jdee
Created July 21, 2014 19:05
Show Gist options
  • Save jdee/8ffe94322de97dcb6dc4 to your computer and use it in GitHub Desktop.
Save jdee/8ffe94322de97dcb6dc4 to your computer and use it in GitHub Desktop.
evolution of computing languages
// C (1972):
// for (char letter='A'; letter <= 'Z'; ++ letter) {
// Ruby (1995):
// [A..Z].each { |letter|
// drum roll, please
// Swift (2014):
let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // Hope I didn't mistype that. And never accidentally modify it.
assert(countElements(alphabet) == 26) // better check, and make one line into three :|
for letter in alphabet {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment