Allow "not equal to" operator "~=" in Luau to be written as "!="

Lua was my first actual programming language (besides HTML and CSS, but those are UI languages) and I feel like if there were two operators for not equal to I would be confused as hell. It makes Lua different, and there’s no reason to add it now if we’ve been used to ~= for over 2 decades. This is like asking Python to support ~=, they won’t :joy:.

3 Likes

I don’t think that we should have another way of writing something that already exists in the language. not (Thing == Thing) can still have uses, including if not (Humanoid and Humanoid.Parent == Character) then return end. I don’t see why this can be a must-have for Luau.

Some people would prefer != over ~= due to its use in many other languages, but why add 2 ways to mean the same thing? I understand things like This += That to shorten This = This + That, but just having an interchangeable way of writing does not equal doesn’t look like something Roblox would go out of their way to do.

I have already gotten used to using the two for different languages. Coding languages aren’t any different to spoken languages. I don’t know that much French, but I am fluent in English. I can still learn French to be more fluent in it.

This is just blatantly rude by the OP.

I agree with that. I really can’t see a reason why there should be two ways of writing the same thing when it doesn’t even change the length or readability.

Couldn’t be any more true lol.

8 Likes

I’d disagree. The benefits are better psudo-code-readability and the fact that it’s one less quirk you (or anyone coming from another lang) need to remember about Luau. It might not be high priority, but it seems fruitful to me.

You’re totally right about that. I forgot Luau itself is open sourced and not strictly for Roblox’s engine, plus I’m not too familiar with writing RFCs. Feel free to close this discussion, as there’s another process for requesting Luau features.

This would only work if the current operator was removed which wouldn’t work as many scripts today use it (since having two operators for one thing is not the best idea). Idealy, I’d like to see != since every modern language uses it, however I wouldn’t want two operators so I think we need to stick with ~=.

I don’t necessarily see the value in this, as languages will differ when it comes to each other.

2 Likes

This is such a pointless thing to get upset over lmao

5 Likes