Hacker News new | past | comments | ask | show | jobs | submit login

The Alto thread posted a ref to BCPL, and it was interesting that the original symbols for the comparison operators were text: eq, ne, gt, lt.

C broke BCPL syntax that was clear, memorable, and consistent and replaced it with a math-like syntax that must have wasted millions of person hours of debugging time in the decades since - for no good reason.

Similarly &(pointer address) and &&(logical and) are too close and too easy to typo.

Language design really should have considered human factors much more than it did.




> Similarly &(pointer address) and &&(logical and) are too close and too easy to typo.

Not to mention &(bitwise and).


Interestingly, Powershell uses eq, ne, gt, lt, etc for its comparison operators.


The historical reason behind that is the > and | symbols were used as redirection operators to follow shell conventions so they used -gt and -bor. All of the other operators followed for consistency. There was also a big kerfuffle about statements like "$a = 1" or "$a++" not being able to return values like in C because if they were used stand-alone the return value would be printed out by the host.


Yes, this always gets me. I don't like perl-style at all. Compare the cognitive load of distinguishing -lt and -le vs. < and <=.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: