I’m not most people, I don’t restrict my creative process just because one of the Lua creators couldn’t understand the difference between “Aproximate” and “Not Equal To”.
Roblox already recognises “!=” as “~=” and suggests you change it, there’s no reason this can’t be changed to be interpreted as “~=”.
I will not surrender to a new font when even the default studio font has this issue.
In mathematical terms, you would be correct. However, Luau is a programming language where they decided ~= represents a relational operator. There is no “wrong sign” here because mathematics and computer science are two different fields that conform to their own rules.
This just seems pretty pointless, and at best a great way to make luau more confusing for beginners. As if this were implemented there’d be 2 symbols that mean the exact same thing, plus ~ is already being used in the type solver for negation types.
What about this is more confusing than 95% of languages using != instead of ~=. Many people attempting to learn lua will most likely know Python which uses the common !=.
If you wanna talk about confusing, look at the roblox documentation, I’ve never seen anything worse.
Many people attempting to learn lua will most likely know Python which uses the common !=.
Really? I would assume that a lot of the beginner developers just learning Lua will learn it from Roblox. And given Roblox’s younger audience, I would think that Lua might be their first language. Having an interest in development a while ago (when I first started Roblox), Lua was my first language from which I later branched into Python and more.
Python and Java are usually taught in schools in the US, so I guess != may be more commonly seen for those who have studied a bit of programming in academics.
I do think that consistency should be maintained. It would be weird to see both != and ~= in the same script (heck, same conditional), though I think any programmer who has seen both of those operators once will not be faltered. I don’t think that it’s something significantly confusing to the average developer. So, I believe that the != vs. ~= argument is trivial since whichever representation is used does not, in my opinion, significantly slow down a developer. I mean, if you are using negations everywhere, there’s probably a more readable way to rewrite that.
With respect to those newer to programming in general, those still grasping Luau and propositional logic might have an uncomfortable time reading code containing both != and ~=.
In agreement because if you learn multiple languages, they all have quirks in how they write syntax, but basically “mentally” the same. Sure, != makes more sense to me than ~= because most of the languages I’ve learned over the century have used this. At the same time, it’s easy to “flip” my brain into Luau mode.
I don’t think a lot here realize that some languages use == for “sorta equal to” and === for “exactly equal to” or even more fun with != and !== or just one = to compare equal something, you have to learn to recognize all the uses and differences.
Someone’s discovered the wonders of JavaScript I see.
A language so buggy and broken they had to add a “super equals” just to make sure you aren’t comparing the number 5 to a string “5”.
Who actually made the decision is irrelevant in this case, my primary point is that Lua/Luau is a programming language that conforms to the rules of its field (computer science) and not the rules of the mathematics field he wants it to so badly conform to.
many people learning luau are first time game devs (children), also lua is widely used in game dev spaces and i havent seen a game that prominently uses python
Well, it is a minor annoyance and I can guarantee you that it is not a problem worth talking in the DevForum. Sure it is quite an idiotic that the math logic and the Roblox studio logic don’t align, but posting it in the DevForum is a little to far.