4 ms·
Interestingly, Powershell uses eq, ne, gt, lt, etc for its comparison operators.
by dsp1234 10y ago
Interestingly, Powershell uses eq, ne, gt, lt, etc for its comparison operators.
- 13of40 10y agoThe 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.
- mkesper 10y agoYes, this always gets me. I don't like perl-style at all. Compare the cognitive load of distinguishing -lt and -le vs. < and <=.