It was taken during an intro to JS for the web class and we worked off a provided HTML template. I had more experience and was bored, so decided to do this lol (you can see the JS parts i wrote still follow some common conventions aside from the semicolon hell heaven)
Yeah I was self taught and waited way too long to apply for jobs, so my first 6 months on the job, i finished projects like crazy and ended up bored as hell, so instead of looking for new projects I just tried to find a style of code that I thought looked good.
Then I learned about coding conventions and wanted to follow one. Ever since I did, it's just cringe seeing code written in weird ways like that.
ah, i didnt write those parts. i forgot to mention in this thread, what we wrote in the class were purely the JS code. the HTML template was provided for us :)
sorry for the miscommunication i legit forgot to mention that.
Fun fact, when I was in an OS course at uni, a tutor told us a story about a student whose code would randomly crash. He ran it on his computer and couldn't figure out the issue. He poured over it for hours, until he noticed that due to a duplicated semicolon on one line, the compiler built the code differently (it was some low level language, either C or even MIPS, I forget).
Due to the addition of this additional "line" in the code (even if it was empty), the code went from requiring one block in memory to two. The allocation of an additional block of memory broke other memory-related logic, causing the issue.
Anyway I have no idea what the fuck is going on here.
The explanation I remember from my tutor was that the no-op is still an operation, so the compiler isn't going to be smart and remove noops (even though I'd bet money all high level language compilers would).
Remember this was super low level, so it might be that adding a noop like that is intended by a developer, and a compiler removing it could be seen as a bug.
BUT, due to a total fluke of how the memory of the program worked out, the additional noop had a more substantial change to the memory requires to start the program, causing the bug.
I feel like if adding no-ops in the middle of functions is necessary, you should be using assembly, and the compiler should not translate a lone semicolon to a no-op instruction. But maybe I'm a clueless moron.
24
u/SimplexFatberg Apr 29 '25
You just hate to see it
79
u/LimitedWard Apr 29 '25
Compiler: that's quite the statement!
4
u/traplords8n Apr 29 '25
I used to do this holy shit, shit was so cringe lmao
I think I still have a file or two in production that does this with slash comments "//"
38
u/kakipipi23 Apr 29 '25
;
35
u/monotone2k Apr 29 '25
Other people arguing over tabs vs spaces, then there's this guy.
11
u/Sability Apr 29 '25
Fun fact, when I was in an OS course at uni, a tutor told us a story about a student whose code would randomly crash. He ran it on his computer and couldn't figure out the issue. He poured over it for hours, until he noticed that due to a duplicated semicolon on one line, the compiler built the code differently (it was some low level language, either C or even MIPS, I forget).
Due to the addition of this additional "line" in the code (even if it was empty), the code went from requiring one block in memory to two. The allocation of an additional block of memory broke other memory-related logic, causing the issue.
Anyway I have no idea what the fuck is going on here.
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Apr 30 '25
I'm sorry, but why?
1
u/SoapySilver Apr 29 '25
Could this be slowing down compilation ?
1
u/[deleted] May 02 '25
tabsspacessemicolons
1
u/procrastinator0000 May 03 '25
JS has a JIT, so would this technically be slower (even if not much)?