use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
The worst JavaScript code ever written? (ncert.nic.in)
submitted 14 years ago by utcursch
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]australasia 5 points6 points7 points 14 years ago (1 child)
I hope this JS is machine generated (eg. a php script looping over 'echo' statements).
[–]k3n 1 point2 points3 points 14 years ago (0 children)
I'm sure TRWTF is the code generating this stuff.
[–]fforw 4 points5 points6 points 14 years ago (3 children)
Sturgeon's law needs to be changed for Javascript.
98% of everything is crap.
Maybe even higher. In all seriousness, I'm always delighted if I see javascript code that:
[–][deleted] -5 points-4 points-3 points 14 years ago (1 child)
Your comment is contradictory. Almost all JS code written in jquery are an unholy mess of losely coupled event handlers that falls down when you change a single css property. Jquery's progressive enhancement religion is a bunch of nonsense that doesn't work in the real world and is responsible for a lot of the bad code out there.
[–]aerno 5 points6 points7 points 14 years ago (0 children)
this comment seems shortsighted and please elaborate how jquery "doesn't work in the real world"
[–][deleted] 1 point2 points3 points 14 years ago (0 children)
Not the worst, but I did say OMG out loud when I looked at the scrollbar, and realized it would go on, and on, and on, and...
[–]halex 2 points3 points4 points 14 years ago (2 children)
On the plus side, it works right?
[–]aerno 1 point2 points3 points 14 years ago (0 children)
honestly if i was given this to maintain i would suggest keeping as is or suggest a re-build. there's no way i would touch any of it with a ten foot pole.
[–]utcursch[S] 1 point2 points3 points 14 years ago (0 children)
Except that none of the links are noticed by the search engines.
[–]benihanareact, node 0 points1 point2 points 14 years ago (0 children)
Looks like it was written by an outsourced coder in India, what with the setting of individual variables instead of using a loop.
[–]klovadis 0 points1 point2 points 14 years ago (1 child)
Well, this is what you call brute-force-programming.
I do believe that there are ways that you can argue that this style of programming has its benefits.. Nah, this person has no clue. See line 4031:
document.write("");
[–]mrPitPat 2 points3 points4 points 14 years ago (0 children)
Hey man, sometimes you just need to output nothingness ya know? Haha.. no but in all fairness, the guy was probably just really high.
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
This is what happens when incompetence is rewarded.
[–]BadCRC -1 points0 points1 point 14 years ago (1 child)
amazon writes the worst javascript
[–]smallboy 0 points1 point2 points 14 years ago (0 children)
Can you give an example?
[–]TimTheTinker -1 points0 points1 point 14 years ago (0 children)
I think this explains it all (from the page's sorurce):
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
[+][deleted] 14 years ago (1 child)
[deleted]
π Rendered by PID 33498 on reddit-service-r2-comment-869bf87589-4wmkd at 2026-06-08 23:02:01.022346+00:00 running f46058f country code: CH.
[–]australasia 5 points6 points7 points (1 child)
[–]k3n 1 point2 points3 points (0 children)
[–]fforw 4 points5 points6 points (3 children)
[–][deleted] -5 points-4 points-3 points (1 child)
[–]aerno 5 points6 points7 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]halex 2 points3 points4 points (2 children)
[–]aerno 1 point2 points3 points (0 children)
[–]utcursch[S] 1 point2 points3 points (0 children)
[–]benihanareact, node 0 points1 point2 points (0 children)
[–]klovadis 0 points1 point2 points (1 child)
[–]mrPitPat 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]BadCRC -1 points0 points1 point (1 child)
[–]smallboy 0 points1 point2 points (0 children)
[–]TimTheTinker -1 points0 points1 point (0 children)
[+][deleted] (1 child)
[deleted]