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

Sometimes I look at an old code and I say "Man, this is awful".

Then I realize that I wrote it.




I look at a lot of my old code and think that, as I should. You should be learning from every piece of code you write so that when you're done writing it's already obsolete based on your new set of knowledge.


I look at this from the other angle. I don't think we're getting much better. I think we rarely reduce the amount of bad code we write without outside critique. New code looks like better code because it is more similar to your current style and preferences, and nearer to you in memory than that old code was.

To really analyze whether your code is good or not you must do what you did with that self-identified bad code: step away for months, forget everything about it, and re-visit it to modify it in some way. Or get someone else to do it for you now and tell you why it sucks.

Code written "in the zone" is more likely to be bad, because when you're "in the zone" even bad code makes sense to you.


True. I always feel happy that I am writing good code until I leave it untouched for a month and get back to it to realize what a mess I made. The best way I have found to tackle this is to put comments everywhere, even at places that seem to be too obvious.


Part of this may be due to the fact that many developers today are using programming languages and platforms that are in many ways vastly inferior to those we were using a decade ago, or even two or three decades ago.

Take JavaScript, for example. It's a clear step backward in almost every respect from languages like C++, Java, C#, Python and Perl. JavaScript is full of inexcusable, inherent problems that just plain should not exist. It has basically no standard library, and what does exist is not good at all. Third-party libraries help slightly, but they're rife with problems caused by a lack of proper namespacing or other modularity-enabling language features, and the numerous different ways to fake badly-needed class-based OO functionality. The developer basic development tools (editors, debuggers, and so forth) are lacking in so many ways, and the various runtimes aren't much better.

The only thing it has going for it is that it's widely available in web browsers. That's it.

When using an inferior language compared to what we were using in the 1980s, 1990s and the early 2000s, it wouldn't surprise me at all if inferior software systems are produced. It's just not feasible to build robust systems upon such a shaky, rotten foundation.


Sometimes when I look at my old code I think "Wow, I didn't know I was that good!". No joke and I'm not sure what it means.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: