I love that Lua uses one-based numbering, if only to point out undesirable developers who don't understand the difference between offset and count.
You don't work with pointer arithmetic directly in Lua syntax, so why would you need offsets?
Complaints about ~= as the negation of equality are as petty as well. The syntax in question isn't just used by Lua, either, and it usually tells me that a developer can't respect differences between languages.
> The syntax in question isn't just used by Lua, either, and it usually tells me that a developer can't respect differences between languages.
Actually, the two examples you bring up are paragons of asinine design. I can't imagine it being easy to justify such design decisions, your attempt to do so was wholly unconvincing.
That "asinine design" comes from decades old syntax practices like ALGOL, Ada, and MatLab.
Perhaps exposing yourself to other languages might inform your responses on debatably the largest technical forum in the industry: one with many developers from widely varying backgrounds.
Heh, you don't even try to justify it, just point out prior art in some irrelevant "languages". Yeah, definitely not easy to defend such choices. Even the fact that this turns off potential Lua programmers such as myself makes it do more harm than any potential good (and I am hard pressed to find a single good thing about these asinine choices).
What is there to defend? Can you explain why it's "asinine design?" You don't actually elaborate as to why, and I've provided you both academic background in mathematics and prior art. I apologize if I've missed your point.
The fact that this discussion ALWAYS comes up when talking about Lua, with people saying they won't even try the language, should clue you in how terrible these design decisions are.
Lua uses 1-based indexing because its initial userbase were engineers used to FORTRAN.
As for ~=, you need to keep in mind that Lua goes all the way back to 1991 and back then there wasn't a big pressure to make your syntax look like C (of Java or JavaScript) like happens today. Syntax used to be much more varied.
~= is a poor choice in and of itself, because it doesn't have any clear justification. It would make some marginal sense in C, where it's binary negation, but that's not the case in Lua - it only ever uses ~ to mean "not" in that one context of inequality.
And, on the other hand, ~= looks too much like an attempt to spell out ≅ in ASCII, but the meaning is completely different.
If anything, /= (as used in Algol-68, Ada, Eiffel etc) makes a great deal more sense as an obvious rendering of ≠. It's unfortunate that C confused matters by reusing it as assignment.
You don't work with pointer arithmetic directly in Lua syntax, so why would you need offsets?
Complaints about ~= as the negation of equality are as petty as well. The syntax in question isn't just used by Lua, either, and it usually tells me that a developer can't respect differences between languages.