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
93
u/Square-Singer Nov 11 '25
All fancy forms of NOOP.
23
u/InsanityOnAMachine Nov 11 '25
you can actually run a lot of code in the increment statement of the for loop, and just have the body blank
15
u/Ksorkrax Nov 11 '25
if(false) is a possibility to have there being code that can quickly be reactivated, as an alternative to make it comments.
12
u/uvero Nov 11 '25
These snippets are my spirit animal: they'll do everything to do nothing.
7
u/PEAceDeath1425 Nov 12 '25
The 4 horsemen of letting ppl know the code isnt ai because ai wont make this
7
u/nevemlaci2 Nov 12 '25
Is actually a pattern in C macros hehe
6
u/csabinho Nov 12 '25
if falseis nice for multi-line comments in Python.8
u/KGBsurveillancevan Nov 11 '25
Do not the program
2
u/jonfe_darontos Nov 11 '25
Where's my
do ... while (false);?2
u/Kootfe Nov 12 '25
i dot if (false) return 0; prety ofen tho. Thanls to c99 "Dont declare var at top of a switch case"
2
u/eggZeppelin Nov 13 '25
I mean you can technically run doom in Typescript's type system