Usage of keywords like eq
and lt
/gt
as more ergonomic alternatives to ==
and <
or >
#1781
Replies: 2 comments 2 replies
-
I find that keywords make it harder to visually parse a line of code, than symbols: |
Beta Was this translation helpful? Give feedback.
-
I voted no. But no matter which is selected, it's ok for me. |
Beta Was this translation helpful? Give feedback.
-
This was a feature that used to exist in C++ that allowed you to use English words as alternative operators to things like
==
,!=
and<
.The feature was brought to life due to technological restrictions, where certain encodings didn't have characters like
=
,&
or^
... but it made me curious about the semantics of such syntax. Looking at it, it doesn't seem too terrible, and in my opinion it might even look slightly better (depending on the circumstances). This is what I'd imagine the pseudocode would look like.I have two big problems with this.
Firstly, it introduces two ways to write code which I am pretty sure everybody hates and everybody wants to avoid.
Secondly, while I believe that keywords are more ergonomic than symbols, the semantics of this come into question once it starts to conflict with English grammar. For example, look at the following pseudocode:
If we were to somehow figure out all of these and add it, I'd also consider extending it further than C++ did with some additional keywords like
not
, as a replacement to!
.44 votes ·
Beta Was this translation helpful? Give feedback.
All reactions