Hacker News new | past | comments | ask | show | jobs | submit login

Nowhere near as many, but I had to deal with this very recently and this little WSJ gem showed up:

https://github.com/ewfelten/Tracking-Report-Card/blob/master...

I'll let the code speak for itself.




That looks like autogenerated code. That's a different beast altogether.


It is. Mozmill is a testing framework. What we're looking at there is a file containing automated tests (which I think should be fairly obvious to someone looking at that file...)


I'm well aware of what it is. Like I said, I had to deal with it recently - I didn't just pull it out of thin air.

What you're looking at is a horror beyond comprehension. There's much better, more maintainable ways to write automated tests.


I guess we'll have to disagree, especially about this part:

> horror beyond comprehension

"Horror"? No, but I guess that's debateable (apparently). But "beyond comprehension"? Absolutely no. Even if we say the repetition offends our aesthetics, I can't even imagine what sort of issue you had to deal with where this file posed a problem. Anything you could possibly want to do with it should be serviceable inside of 5 minutes, except in the dumbest of Notepad-quality (i.e., little more than a text control) editors. That includes rewriting the whole thing to be less offensive, if that's your slant.

This file is nothing compared the types of things mentioned upthread, things which, again, exist in a context of actual production code.


If that is horror beyond comprehension then you are a very, very lucky person. The auto-generator even indents the code nicely!


That's not bad at all - it's a lot, it's not DRY and it could be reduced to about 25 lines of code (or 25 + the number of URLs to check), but it's legible, clear, and easy to understand.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: