MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1s1g2ys/more_javascript_no_keyword_style/
r/programminghorror • u/[deleted] • Mar 23 '26
38 comments sorted by
64
ah yes
man-made horrors beyond my comprehension
13 u/[deleted] Mar 23 '26 the worst part is I actually code like this on my personal projects 12 u/ZoDichtbijJeWil Mar 23 '26 You seemingly being proud of that is also quite disturbing. 3 u/[deleted] Mar 23 '26 I think it's beautiful 6 u/new2bay Mar 23 '26 It is, but in a “don’t try this at home, kids” kind of way. 25 u/Infinite_Self_5782 Mar 23 '26 implicit var usereven the thought makes me shudder and tear up 5 u/new2bay Mar 23 '26 The horror! I bet you don’t even use semicolons! 😂 4 u/Opposite_Mall4685 Mar 23 '26 But why though? 1 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Mar 23 '26 Beyond my comprehension because I am completely clueless when it comes to modern JS.
13
the worst part is I actually code like this on my personal projects
12 u/ZoDichtbijJeWil Mar 23 '26 You seemingly being proud of that is also quite disturbing. 3 u/[deleted] Mar 23 '26 I think it's beautiful 6 u/new2bay Mar 23 '26 It is, but in a “don’t try this at home, kids” kind of way. 25 u/Infinite_Self_5782 Mar 23 '26 implicit var usereven the thought makes me shudder and tear up 5 u/new2bay Mar 23 '26 The horror! I bet you don’t even use semicolons! 😂 4 u/Opposite_Mall4685 Mar 23 '26 But why though?
12
You seemingly being proud of that is also quite disturbing.
3 u/[deleted] Mar 23 '26 I think it's beautiful 6 u/new2bay Mar 23 '26 It is, but in a “don’t try this at home, kids” kind of way.
3
I think it's beautiful
6 u/new2bay Mar 23 '26 It is, but in a “don’t try this at home, kids” kind of way.
6
It is, but in a “don’t try this at home, kids” kind of way.
25
implicit var user
var
even the thought makes me shudder and tear up
5 u/new2bay Mar 23 '26 The horror! I bet you don’t even use semicolons! 😂
5
The horror! I bet you don’t even use semicolons! 😂
4
But why though?
1
Beyond my comprehension because I am completely clueless when it comes to modern JS.
This is literally just how it looks to write lisp, except you wouldn't be doing assignments.
6 u/[deleted] Mar 23 '26 I guess I'm just naturally drawn to lisp-style coding
I guess I'm just naturally drawn to lisp-style coding
18
document.querySelector("#...") when you could be doing document.getElementById("...") :(
document.querySelector("#...")
document.getElementById("...")
7 u/[deleted] Mar 23 '26 both are fine 4 u/ZoDichtbijJeWil Mar 23 '26 Probably taken care of by the engine's optimization, preventing costly, unnecessary DOM traversal, but still a fearful sight.
7
both are fine
Probably taken care of by the engine's optimization, preventing costly, unnecessary DOM traversal, but still a fearful sight.
10
I will never forgive Javascript for making function foo(a) { return a+1; } be functionally different from const foo = (a) => a+1
function foo(a) { return a+1; }
const foo = (a) => a+1
5 u/[deleted] Mar 23 '26 what's the difference again? 17 u/ZoDichtbijJeWil Mar 23 '26 edited Mar 23 '26 Scope. Arrow functions don't have their own bindings to this.See: MDN - Arrow function expressions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions 2 u/nerdmor Mar 23 '26 edited Mar 23 '26 Several.Kept bumping into them when they appeared. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ (Site seems to block Reddit as a referrer. Copy/paste the link or just google "arrow functions vs normal functions javascript". A BUNCH of people wrote about that) 4 u/Filiperss Mar 23 '26 Page not found 1 u/nerdmor Mar 23 '26 Dafuk? I just pasted the link...I edited and pasted again, but it seems the site blocks Reddit as a referrer? Maybe copy/paste the link, that worked here. 2 u/Cloudy_Oasis Mar 23 '26 You left a space at the end of the link, which is why it didn't work for me 1 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Mar 23 '26 I think it's more likely the %C2%A0 at the end of the URL. That looks to be UTF-8 for a non-breaking space. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ This should work. 2 u/Excellent_Gas3686 Mar 23 '26 the two functions you wrote are not functionally different, none of the differences between regular and arrows functions even appear in them 1 u/Kyyken Mar 24 '26 One can be hoisted, the other cannot, so they can be different depending on surrounding code :)
what's the difference again?
17 u/ZoDichtbijJeWil Mar 23 '26 edited Mar 23 '26 Scope. Arrow functions don't have their own bindings to this.See: MDN - Arrow function expressions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions 2 u/nerdmor Mar 23 '26 edited Mar 23 '26 Several.Kept bumping into them when they appeared. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ (Site seems to block Reddit as a referrer. Copy/paste the link or just google "arrow functions vs normal functions javascript". A BUNCH of people wrote about that) 4 u/Filiperss Mar 23 '26 Page not found 1 u/nerdmor Mar 23 '26 Dafuk? I just pasted the link...I edited and pasted again, but it seems the site blocks Reddit as a referrer? Maybe copy/paste the link, that worked here. 2 u/Cloudy_Oasis Mar 23 '26 You left a space at the end of the link, which is why it didn't work for me 1 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Mar 23 '26 I think it's more likely the %C2%A0 at the end of the URL. That looks to be UTF-8 for a non-breaking space. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ This should work.
17
Scope. Arrow functions don't have their own bindings to this.
this
See: MDN - Arrow function expressions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
2
Several.
Kept bumping into them when they appeared. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/
(Site seems to block Reddit as a referrer. Copy/paste the link or just google "arrow functions vs normal functions javascript". A BUNCH of people wrote about that)
4 u/Filiperss Mar 23 '26 Page not found 1 u/nerdmor Mar 23 '26 Dafuk? I just pasted the link...I edited and pasted again, but it seems the site blocks Reddit as a referrer? Maybe copy/paste the link, that worked here. 2 u/Cloudy_Oasis Mar 23 '26 You left a space at the end of the link, which is why it didn't work for me 1 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Mar 23 '26 I think it's more likely the %C2%A0 at the end of the URL. That looks to be UTF-8 for a non-breaking space. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ This should work.
Page not found
1 u/nerdmor Mar 23 '26 Dafuk? I just pasted the link...I edited and pasted again, but it seems the site blocks Reddit as a referrer? Maybe copy/paste the link, that worked here. 2 u/Cloudy_Oasis Mar 23 '26 You left a space at the end of the link, which is why it didn't work for me 1 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Mar 23 '26 I think it's more likely the %C2%A0 at the end of the URL. That looks to be UTF-8 for a non-breaking space. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ This should work.
Dafuk? I just pasted the link...
I edited and pasted again, but it seems the site blocks Reddit as a referrer? Maybe copy/paste the link, that worked here.
2 u/Cloudy_Oasis Mar 23 '26 You left a space at the end of the link, which is why it didn't work for me 1 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Mar 23 '26 I think it's more likely the %C2%A0 at the end of the URL. That looks to be UTF-8 for a non-breaking space. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ This should work.
You left a space at the end of the link, which is why it didn't work for me
I think it's more likely the %C2%A0 at the end of the URL. That looks to be UTF-8 for a non-breaking space. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ This should work.
the two functions you wrote are not functionally different, none of the differences between regular and arrows functions even appear in them
1 u/Kyyken Mar 24 '26 One can be hoisted, the other cannot, so they can be different depending on surrounding code :)
One can be hoisted, the other cannot, so they can be different depending on surrounding code :)
It's just awfull, please use a framework,
so it can become awful and opiniated.
1 u/[deleted] Mar 23 '26 yeah fuck frameworks
yeah fuck frameworks
61
Call stack when inside the debugger:
anonymous function anonymous function anonymous function anonymous function anonymous function ....
23 u/Potterrrrrrrr Mar 23 '26 anonymous function fuck you guess anonymous function
23
anonymous function fuck you guess anonymous function
Even the interpreter is confused
1 u/[deleted] Mar 23 '26 how so?
how so?
When you change the syntax highlighter manually...
1 u/[deleted] Mar 24 '26 this is vanilla kate 1 u/Key_River7180 Mar 24 '26 yes ughhh... you probably clicked on the tools -> highlighter or something 1 u/[deleted] Mar 24 '26 I did no such thing 1 u/Key_River7180 Mar 25 '26 then ughhh... 1 u/[deleted] Mar 26 '26 dude is just ughh'd by this for no reason fr 😔
this is vanilla kate
1 u/Key_River7180 Mar 24 '26 yes ughhh... you probably clicked on the tools -> highlighter or something 1 u/[deleted] Mar 24 '26 I did no such thing 1 u/Key_River7180 Mar 25 '26 then ughhh... 1 u/[deleted] Mar 26 '26 dude is just ughh'd by this for no reason fr 😔
yes ughhh... you probably clicked on the tools -> highlighter or something
1 u/[deleted] Mar 24 '26 I did no such thing 1 u/Key_River7180 Mar 25 '26 then ughhh... 1 u/[deleted] Mar 26 '26 dude is just ughh'd by this for no reason fr 😔
I did no such thing
1 u/Key_River7180 Mar 25 '26 then ughhh... 1 u/[deleted] Mar 26 '26 dude is just ughh'd by this for no reason fr 😔
then ughhh...
1 u/[deleted] Mar 26 '26 dude is just ughh'd by this for no reason fr 😔
dude is just ughh'd by this for no reason fr 😔
true is a keyword
true
fuck,I hate when people do this
64
u/Infinite_Self_5782 Mar 23 '26
ah yes
man-made horrors beyond my comprehension
25
u/Orbidorpdorp Mar 23 '26
This is literally just how it looks to write lisp, except you wouldn't be doing assignments.
18
u/CodeF53 Mar 23 '26
document.querySelector("#...")when you could be doingdocument.getElementById("..."):(10
u/nerdmor Mar 23 '26
I will never forgive Javascript for making
function foo(a) { return a+1; }be functionally different fromconst foo = (a) => a+14
u/orfeo34 Mar 23 '26
It's just awfull, please use a framework,
so it can become awful and opiniated.
61
u/No-Information-2571 Mar 23 '26
Call stack when inside the debugger:
1
u/MEGATH0XICC Mar 23 '26
Even the interpreter is confused
1
u/Key_River7180 Mar 23 '26
When you change the syntax highlighter manually...
3
u/the_horse_gamer Mar 23 '26
trueis a keyword1
u/[deleted] Mar 24 '26
fuck,I hate when people do this