r/programminghorror • u/EmDeeTeeVid • Apr 06 '26
Javascript Who needs variables? Who needs Functions? Not this person - The Pit
163
Upvotes
r/programminghorror • u/EmDeeTeeVid • Apr 06 '26
73
u/ResponseSalty6322 Apr 06 '26
bro read the if else statements page on w3schools said "im ready" and went straight to shipping
22
u/rossisdead Apr 06 '26
They're just unrolling the code so the JIT compiler doesn't have to do as much work!
6
u/conundorum Apr 09 '26
5
u/felix_semicolon Apr 07 '26
This is exactly what any raw CSS code is
2
u/SimplexFatberg Apr 07 '26
Average Javascript developer
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Apr 06 '26
Is a function necessary here? I guess maybe some DOM elements should be assigned to a variable.
Also, what do they call the part after the '#' in a URL? Was that an anchor? Is this code running in multiple pages, or do those
window.location.hrefchecks only differ after that point?1
u/Trileak780 Apr 12 '26
1% code
99% whitespace
1
u/Constant_Record_9691 Apr 28 '26
What in the unholy fuck
0
u/[deleted] Apr 07 '26
[deleted] — view deleted comment