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

Maybe I haven't been entirely clear.

I'm not talking about a mismatch between approach (over- or under- whatever) and goal. I'm not talking about quick hacks that were never refactored (because of course, there never is time). I'm not talking about code that has gone through many cycles of unpredicted change and has acquired many layers of cruft. I'm not talking about code made by inexperienced developers who still have a lot to learn.

I've seen all that. I've written all that. I've left code behind I would be embarrassed to show in public. I'm shocked some of it is still in use, and I'm sure people who have to maintain it will curse my name. That is part of the job.

What I'm talking about is pure, unadulterated shit code. No structure, no logic, no consistency and barely functioning only under very limited conditions. Utterly incomprehensible unless you immerse yourself deep into the mind of the author like an FBI profiler and a serial killer.

No, there is no one "right" way of writing code, but boy there are an awful lot of "wrong" ways.

I know what this guy is talking about. It's the sort of code where the programmers spend 80 lines copying key-value pairs from one Perl hash to another Perl hash instead of doing it in 3-4 lines with a loop, because they don't know any better. coughibmcough

(Of course, this is among the least of their offenses.)

I try not to work at places like this.

I thoroughly agree that there is a difference between hacky code and shit code. I've seen far too much code which isn't even attempting to solve the right problem, but is so buggy that its myriad problems compound to make it sometimes appear that the original problem is solved. Things which takes weeks to understand, and only went unnoticed due to an extraordinary unlikely coincidence of errors at all levels of the stack which Rube Goldberg would be proud of.

I would suspect that such practices are more prevalent in the web development world. Enterprise software and embedded development (my focus area) suffers far less from the pure unadulterated "shit" code pattern.

Mostly I suspect that is because the software development practices such as code reviews and coding standards are actually enforced.

I would hope that embedded is better. But the "Enterprise software" that I have seen is generally horrible.

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