One of the annoying bits about PowerShell, which helps amplify its disadvantage against other languages in code-golf, is that there are no symbolic comparison or logical operators.
A comparison that could be as short as this:
$x<10&&$x>5
Has to be:
$x-lt10-and$x-gt5
This bloats the code for even the simplest of comparisons by about 50% compared to many other regular scripting and programming languages, never mind any golfing languages. Even an Excel formula for a similar comparison comes up shorter by one character!
=AND(A1<10,A1>5)
Another one that really bugs me:
$x==$k&&$i>9&&$i%10!=0
Has to be:
$x-eq$k-and$i-gt9-and$i%10-ne0
Interestingly, this one's exactly as long as the comparable formula for Excel, but that's mainly due to Excel's lack of a symbolic modulus operator.
=AND(A1=B1,C1>9,MOD(C1,10)<>0)
Is there a way this can be shortened at all, or is this strictly a limitation of the language? Are there any particular scenarios to keep in mind where shortcuts can be used for joining multiple comparisons?
(( 5 < x && x < 10));-) \$\endgroup\$< > == -contains -in -match) \$\endgroup\$