Symbolic vs. Mnemonic Relational Operators: Is "GT" Greater Than ">"?
theodp writes: "Mnemonic operators," writes SAS's Rick Wicklin as he weighs the pros-and-cons of Symbolic Versus Mnemonic Logical Operators, "tend to appear in older languages like FORTRAN, whereas symbolic operators are common in more recent languages like C/C++, although some relatively recent scripting languages like Perl, PHP, and Windows PowerShell also support mnemonic operators. SAS software has supported both operators in the DATA step since the very earliest days, but the SAS/IML language, which is more mathematically oriented, supports only the symbolic operators. Functionally, the operators are equivalent, so which ones you use is largely a matter of personal preference. Since consistency and standards are essential when writing computer programming, which operators should you choose?"
We're on /.. By definition we're all wasting time....usually instead of working.
That being said, this raises some interesting questions about how our brains parse the languages. Would a mnemonic like GT be simpler to parse than >.
Of course, I think this brings up the question of first language. Someone with English and the Latin alphabet may find the mnemonics easier but someone for whom the Latin alphabet is not their primary alphabet might handle the operators better.
They unfortunately used perl as an example. While yes Perl does have both gt and > one is a string comparison and the other is a numerical comparison.
Your hair look like poop, Bob! - Wanker.
It's all squiggles on the screen that I have to learn to interpret in the correct context.
“Common sense is not so common.” — Voltaire
A bare minimum of English is needed for programming. If, else, switch, case, import and so on are hard to avoid.
I would still argue that > is better than GT though. The reason is that reading the meaning from a symbol comes more natural to the brain than reading letters, which is then turned into a sound/word, which then is turned into a meaning. This mean a symbol like > takes less energy for the brain to read and it becomes easier and faster to read the code. Also using letters for variables and symbols for operators is also a way to make it easier to identify what is what.
if ((varA > varB) && (varC > varD))
if varA GT varB and varC gt varD
It's not like readability is precisely the same for those two lines even though they are identical from a mathematical point of view.
One more thing about reading symbol vs letters. Japan uses both symbols (kanji aka Chinese letters) and phonic (hiragana, which is sounds like in English) and since they are able to write the very same text with both systems, they study the effect of symbols vs sounds in writing. It turns out that symbols are faster to read. Even more interesting is it that they activate different parts of the brain, which mean it is possible to be dyslexic for sounds only, while symbol reading is unaffected. Clearly using symbols vs words is more than just "like to look at GT or >".
On the other hand, students and people in-general have gotten > and < confused for a long time.
Many decades ago, my first grade teacher explained that these symbols are like alligators: They choose to chomp on the bigger meal. I've never been confused on these symbols since that day.