Why Was "<>" Removed?

Discuss the future of the AutoHotkey language
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Why Was "<>" Removed?

17 Mar 2020, 02:40

I'm trying to understand the logic behind some changes. The issue about that version of not-equal (<>), is that many languages like SQL, dialects of Basic, PHP (uses both "!=" and "<>"), and Pascal use it. Maybe the original logic behind AutoHotkey having both was to be accommodating to programmers that may come from different backgrounds or if programmers were using multiple languages.

If AutoHotkey is going to use ":=" for assign (which is arguably a major design choice), which follows Pascal, then it should have kept "<>" as well. I never saw this as hurting AutoHotkey. Especially since "AND" and "&&", along with "OR" and "||" are kept. Which by the way, Pascal and dialects of BASIC use the "AND" and "OR", as well.

Seems like there are many other things to change from AHK v1 to AHK v2, where something like this doesn't come off as any type of enhancement or increase in functionality. Debatably, it would have been more consistent to keep "<>", if we are going to borrow from and follow Pascal or keep some "dual" operators.
Last edited by SOTE on 17 Mar 2020, 03:21, edited 1 time in total.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Why Was "<>" Removed?

17 Mar 2020, 03:19

We have = and == and the equivalent != and !==.
<> neither looks like != nor like !==.
There is no intuituve way to decide which one it stands for.
In addition <> added no new functionality to the language (unlike the NOT, AND, OR operators that have a different precedence than their counterparts).
Its just a way to say the same thing differently. Since AHK v2 aims to make the language more slim to make things easier on newbies the operator was removed.
Recommends AHK Studio
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Why Was "<>" Removed?

17 Mar 2020, 03:22

Recommends AHK Studio
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Why Was "<>" Removed?

17 Mar 2020, 03:55

nnnik wrote:
17 Mar 2020, 03:19
We have = and == and the equivalent != and !==.
<> neither looks like != nor like !==.
There is no intuituve way to decide which one it stands for.
In addition <> added no new functionality to the language (unlike the NOT, AND, OR operators that have a different precedence than their counterparts).
Its just a way to say the same thing differently. Since AHK v2 aims to make the language more slim to make things easier on newbies the operator was removed.
I don't think that's the case. Newbies can be equally confused by ":=" versus "=" for assignment, or for that matter "==" which can have a different meaning in other programming languages. If a newbie was exposed to some other language, then some can become confused when a new language they are learning are using different operators. For those that have never learned any other programming language, where AutoHotkey is their first, their "confusion" is more likely them forgetting what the operator stands for (so basically not knowing the language). We also have "<=" (less or equal) and "=>" (fat arrow), in addition to "|=", not to be confused with "!=" in AHK v2. A Newbie can get easily confused, especially if they have dyslexia, bad memory, or bad eyesight. :lol:

"<" (less than), ">" (greater than), "<=" (less or equal), ">=" (greater or equal), "<>" (not equal), does "flow" visually and conveys it's meaning. Once the programmer knows what it stands for, they should be fine. And, it helps them recognize this symbol in other languages. If they see it in Pascal, PHP, SQL, or various dialects of BASIC then they will instantly recognize it. If they come from those languages to AutoHotkey, they would be more comfortable.

For consistency, if AutoHotkey is going to borrow from Pascal, then debatably it should keep "<>" along with it. PHP, has both "!=" and "<>". So it's not like there isn't another major programming that has done this.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: Why Was "<>" Removed?

17 Mar 2020, 04:05

These are details that don't really matter much in practice, merely based on assumptions.

A newbie can be confused by anything - someone with bad memory is used to look things up or to organize information (talking from personal experience). Learning not to assume that something is automatically like in language x will be a great and necessary achievement for any newbie.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Why Was "<>" Removed?

17 Mar 2020, 04:36

Yes newbies are commonly confused by = assignment vs = comparison and := assignment - thats why v2 removes the = assignment.

While I agree that people can get stuck in random places I do disagree that there is no merit to the argument entirely.
Reducing the amount of possible alternatives can greatly reduce the amount of things you need to learn as a new user.
Almost every new user that did not learn another language beforehand got stuck on the = vs := assignment.
<> vs. != is just another case of the language being unnecessarily cryptic.
Recommends AHK Studio
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: Why Was "<>" Removed?

17 Mar 2020, 04:37

That's really an improvement (especially because = and := are not equivalent, but have different syntax implications, while being both valid; and there are plenty empirical indicators in 'Ask For Help' that this causes an awful lot of confusion).

But spending time on != vs <> seems irrelevant. That said, I wouldn't mind keeping it (because it's not comparable to the = vs := syntax debacle). Imho, these decisions are worlds apart.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Why Was "<>" Removed?

17 Mar 2020, 18:34

Another point to consider, is that AutoHotkey has already broken away from syntax and keywords used by C/C++ and other C family languages, though there is some significant variation (like with Go and PHP). And such differences by AutoHotkey are understandable, as it's a more automation orientated language.

Never saw the issue being about "!=" vs "<>". It was usually centered around:

1) "=" vs ":=" vs "=="

Possibly coming from those using languages with "=" and "==", thus ":=" were blowing their minds.

2) The use of "%%" with variables

That was often from those that haven't used Windows Batch scripting/.bat/.cmd (thus they would know about %variable%).

3) Certain AutoIt hypocrite nitpickers

Who were going to find fault with AutoHotkey no matter what, while pretending to be blind about their own syntax issues.

Where backwards compatibility and tradition are possible, those things should debatably be kept. AHK is in it's own corner of the programming world, so should be satisfying it's fans and users, not critics who will never use it. AHK v2 isn't a complete re-do, but an upgrade for it's users.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Why Was "<>" Removed?

17 Mar 2020, 23:52

SOTE wrote:If AutoHotkey is going to use ":=" for assign (which is arguably a major design choice), which follows Pascal, then it should have kept "<>" as well.
Why?
Gregster wrote:But spending time on != vs <> seems irrelevant
I agree.

Cheers.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Why Was "<>" Removed?

18 Mar 2020, 02:48

The use of %% variables is heavily removed in v2. AutoHotkey tries to go away from those poor syntax choices as much as possible.
Recommends AHK Studio
just me
Posts: 9574
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Why Was "<>" Removed?

18 Mar 2020, 05:37

gregster wrote:...
But spending time on != vs <> seems irrelevant. That said, I wouldn't mind keeping it (because it's not comparable to the = vs := syntax debacle). Imho, these decisions are worlds apart.
I agree.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Why Was "<>" Removed?

19 Mar 2020, 09:17

Helgef wrote:
17 Mar 2020, 23:52
SOTE wrote:If AutoHotkey is going to use ":=" for assign (which is arguably a major design choice), which follows Pascal, then it should have kept "<>" as well.
Why?
As you asked the question, and I don't want to be rude by leaving you hanging.

I did give reasons:

1. It's an established operator used in AHK v1, where many AHK programmers can have it in their scripts

2. Its removal is not necessary nor hurts AHK v2 in anyway.

3. There is a precedent to keep both, as this is the case in the PHP language.

4. By choosing ":=" instead of "=", already opened the door of divergence on operator selection from C/C++. There is no going back.
Note- The Go language uses ":=" too (like Pascal), despite being within the C family. If you are going to be different, stay that way.

5. Such an operator in AutoHotkey makes it easier for those coming from or learning different languages, as both/either "<>" or "!=" are used.
Note- If the intent was for AutoHotkey to be so strict about operators, arguably it should have copied the C/C++ ones.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Why Was "<>" Removed?

19 Mar 2020, 10:08

Thank you @SOTE,

1,2,4,5. Doesn't explain if use := then should keep <>
3. Why should we consider PHP when we design AHK?

Cheers.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Why Was "<>" Removed?

19 Mar 2020, 11:42

Helgef wrote:
19 Mar 2020, 10:08
Thank you @SOTE,

1,2,4,5. Doesn't explain if use := then should keep <>
3. Why should we consider PHP when we design AHK?

Cheers.
For 1, 2, 4, 5... There is another way to look at it. Think about this famous proverb.

"If it ain't broke, don't fix it"

I'm not saying that decisions have to be based solely on what PHP developers do, but rather those using AutoHotkey shouldn't feel they are doing something unusual or wrong, because there are other languages that have made the same choices with operators as AHK v1.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Why Was "<>" Removed?

19 Mar 2020, 13:10

I was trying to understand the logic behind the idea that using := as the assignment operator implies that we should keep <>. I think you are now saying that there is no such implication, so we have agreed.

Cheers.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Why Was "<>" Removed?

19 Mar 2020, 13:29

having 2 different things accomplish the same exact thing seems pretty broke to me. redundancy and all that...
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Why Was "<>" Removed?

19 Mar 2020, 14:02

Helgef wrote:
19 Mar 2020, 13:10
I was trying to understand the logic behind the idea that using := as the assignment operator implies that we should keep <>. I think you are now saying that there is no such implication, so we have agreed.

Cheers.
Hmmmm... Or why not get rid of ":=" as the assignment operator and use "=" like C/C++ does? Why didn't AHK v2 "upgrade" all the operators of AHK v1 and any uniqueness that it has in order to be compliant with how it's "supposed" to look. Why simply stop at "<>", when there are so many other divergent AutoHotkey operators to change? I wouldn't be surprised to find those that agree (whether conscious of such or not) with this sentiment.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Why Was "<>" Removed?

19 Mar 2020, 14:19

You quoted me, but what you have written has nothing to do with what I said. I hope someone else understand what your points are.

Cheers.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Why Was "<>" Removed?

19 Mar 2020, 14:53

Helgef wrote:
19 Mar 2020, 14:19
You quoted me, but what you have written has nothing to do with what I said. I hope someone else understand what your points are.

Cheers.
Oh, was playing devil's advocate for a moment. Not saying that was your opinion specifically, but to put forth the argument that if "<>" can be so casually thrown away, why not throw away the rest of the "divergent" operators too. Like say ":=" and replace it with "=", so that new users won't be confused by it's difference from C/C++ or Java, or that it's unnecessary to have something different. Why stop at one, when it's possible to keep going down the line.

If that's not what we are doing or intend, then perhaps it can be fine to keep such a traditionally used operator of AHK v1, if it does no harm. To not fix that which isn't broken.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Why Was "<>" Removed?

20 Mar 2020, 02:19

if "<>" can be so casually thrown away, why not throw away the rest of the "divergent" operators too. Like say ":=" and replace it with "="
I don't know why you think lexikos is casually throwing things away. As gregster said, the choice to between <>/!= (or both) isn't comparable to the choice between := and =.

Anyways, the way I see it, removing <> from ahk v2 alpha wasn't about removing it from the language, is was about not adding it to AHK v2. If you cannot give a good answer as to why something should be in ahk v2, then it shouldn't be there. And no one have given a good answer as to why we need both != and <>, probably because there isn't any.

Cheers.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 30 guests