Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming languages that don't suck

Name: Anonymous 2009-11-22 15:41

Lisp, Scheme and Haskell are the obvious ones. JavaScript is a nice language. C always has its place. C# might be the jewel of enterprise.

What else is there that /prog/ recommends? I've heard good things about ML. A language that seems interesting from its Wikipedia page is Self, but I'm not too sure about it.

Name: 12 2009-11-22 19:34

>>15
Apparently you've never actually tried it:

‌‎>‌‎ t = {[0] = "a", "b", "c", "d", "e", "f"};
‌‎>‌‎ for k,v in ipairs(t) do print(k,v) end
1       b
2       c
3       d
4       e


Oh my, what happened? Where's my "a"? Oh yeah, [0] is being stored in the hash-section of the table instead of the array-section. Ok, let's try this:

‌‎>‌‎ for k,v in pairs(t) do print(k,v) end
1       b
2       c
3       d
4       e
0       a


What the shit?!

And never mind that print(t); merrily prints out something entirely helpful like table: 0x8b297a0. Or that you have to type a semicolon there, but you don't need one in the for-statements above.

Newer Posts