Writing a program as you’re learning a dynamic language is like building a house and then walking through it to see which rooms are haunted.
Conversation
I’ve decided to learn Lua and wow there’s a lot of dangerous ghosts here. I haven’t even started making my own magic tables yet.
1
4
Every language is just like every other language except for the one or two weird things. Lua went with “lists are haunted” and I’m excited to see how that works out.
1
4
12
Replying to
Be really careful wit nil!
The haunted arrays, where the nil element will just cut off the array.
1
1
Replying to
I tried to learn Lua a few years ago when I was in the hospital recovering from my heart transplant. I was so full of drugs that when I got to the tables stuff I just noped out be because I knew my brain was ready to handle it.
1
1
Replying to
The metatable bits are very powerful. I've grown to like it. Just that nil... These errors tend to propagate far before you find the mistake. My Lua code is littered with assert(x ~= nil).
1
Originally my s-expression library used nil as empty list. BAD idea.
1
Main problem was that an empty list no longer could be part of a Lua array.
Replying to
If I had a nickel for every time I’ve done this in a project I could probably buy myself a fancy cocktail.

