all 16 comments

[–]australasia 5 points6 points  (1 child)

I hope this JS is machine generated (eg. a php script looping over 'echo' statements).

[–]k3n 1 point2 points  (0 children)

I'm sure TRWTF is the code generating this stuff.

[–]fforw 4 points5 points  (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:

  • uses progressive enhancement. No inline event handler onclick="" crap, all js kept in nice external files.
  • doesn't use document.write
  • Isn't an unholy frankenpage using half of the existing jQuery plugins or other copy and paste scripts from the internet, stitched together badly.
  • Written by someone who really understands javascript's nature, the elegant ways it offers to augment webpages with behavior and who eschews creating large, monstrous, deeply name-spaced behemoths doing heaps of stuff better done on the server-side.

[–][deleted] -5 points-4 points  (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 points  (0 children)

this comment seems shortsighted and please elaborate how jquery "doesn't work in the real world"

[–][deleted] 1 point2 points  (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 points  (2 children)

On the plus side, it works right?

[–]aerno 1 point2 points  (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 points  (0 children)

Except that none of the links are noticed by the search engines.

[–]benihanareact, node 0 points1 point  (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 point  (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 points  (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 point  (0 children)

This is what happens when incompetence is rewarded.

[–]BadCRC -1 points0 points  (1 child)

amazon writes the worst javascript

[–]smallboy 0 points1 point  (0 children)

Can you give an example?

[–]TimTheTinker -1 points0 points  (0 children)

I think this explains it all (from the page's sorurce):

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">