Hacker News new | ask | show | jobs
by collyw 4449 days ago
Slight tangent to your question, but one thing I have noticed recently is that having to deal with really crap code inspires me to do my own better.

I inherited a colleagues work after she left, and it was horrible. But I thought about why it was horrible, and how to make it better. What would it look like if it was done well?

Even with my own code, if I look at something I did 6 months ago, and it doesn't make sense straight away, the it can usually be improved.

1 comments

It frightens me how my future replacement is probably going to think "gee, that guy was horrible" unless he knows all the historic context and reasons why the code was written the way it was written.
> unless he knows all the historic context and reasons

That's what comments are for :) It's not only about your future replacement, it's also about your future self.

That's the same reason I try to keep my code clean, and comment liberally.