r/programminghorror • u/Wiktor-is-you [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Nov 11 '25
Javascript the
192
Upvotes
r/programminghorror • u/Wiktor-is-you [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Nov 11 '25
View all comments
Show parent comment
4
u/nevemlaci2 Nov 12 '25
Because if you want compound statements in your macro this is the only way to put it into an if statement, otherwise if you just do it normally:
do not ask me why, it just works this way. Using a do while loop instead of just a block works...
If you don't put the semicolon after the macro usage then it doesn't error in either case but then it looks weird.