3 ms·
> and immediately messed it up by mixing ordered maps with arrays into a big soup, but hey, PHP And here I thought Lua was the only language insane enough to d
by pavanky 7y ago
> and immediately messed it up by mixing ordered maps with arrays into a big soup, but hey, PHP
And here I thought Lua was the only language insane enough to do something like that.
Just realized Lua tables aren't ordered, but it still mixes arrays and maps / tables into a single data structure.
- skrebbel 7y agoIn JS's defense, it really tried as well. Fortunately though they failed harder at it, which is why arrays and objects are probably more different from one another than Eich had intended there in that mad 2 week language design frenzy. Good for us! Back when JS got popular and the majority of web programmers knew PHP, there were dozens of tutorials out there trying to convince you not to do stuff like this: var a = new Array(); a["moo"] = "five"; a["foo"] = "six"; After all, well, it works! Like in PHP! So what's the problem? :-) Most people felt the same way about these tutorials as people feel about monad tutorials nowadays. Good times!