3 ms·
Let's put aside the god-awful 1-based tables, in 1993, which alone should have killed the language. My big problem with Lua is that it tries very hard to make
by SeanLuke 3y ago
Let's put aside the god-awful 1-based tables, in 1993, which alone should have killed the language. My big problem with Lua is that it tries very hard to make possible all styles of language to all people, and as a result it is a language with a lot of boilerplate to do any one of them.
For example, consider Lua's OO. The most obvious inspiration for Lua here was Newtonscript, via Self. They're quite open about it. Newtonscript and Self are prototype-style OO languages done well, as opposed to Javascript, which is a prototype-style OO abomination. Lua advertises itself as being able to do prototype-style OO, all you have to do is make some tweaks to its metatables. But while this stuff is baked into Newtonscript and Self, it is an amazing amount of boilerplate to do it in Lua, to the point of parody. https://www.lua.org/pil/16.1.html https://www.lua.org/pil/16.1.html
- tayistay 3y agoOn the page you linked, I see four lines of boilerplate in a constructor: function Account:new (o) o = o or {} -- create object if user does not provide one setmetatable(o, self) self.__index = self return o end Doesn't seem so bad. Are you referring to something else?
- daneel_w 3y agoWhy would you wish the death of a language only because its default index for arrays is 1? You're not forced to index from 1 and onwards. You can use any range you want to: https://www.lua.org/pil/11.1.html https://www.lua.org/pil/11.1.html
- krapp 3y agoYou're way too triggered by a programming language, dude. Move past it.