Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sometimes it just takes many tries to get it right. One should not be afraid to rewrite old code until it is right.

The last three Perl codebases I have worked with were overly complicated when I started and had major sections that only a few people had the domain knowledge to touch. With one of those, I became the domain knowledge expert (financial accounting). But the other two I just haven't had time to do that. For example, I am not a quantitative finance guy and I would have to learn that field (and the other is even more specialized).

But what I have learned to do is be guided by a few principles:

1. I much prefer to work with people smarter than me.

2. I try to be good at the little things everyone else ignores ("is this really the right way to handle exceptions?" "Are these functions really written with testability in mind?").

A big problem of course is that codebases don't just fall from the sky, nice and sleek. They are built up over time and entropy within them slowly grows. What starts out as simple get tweaked and made a little more complicated, then again and again until it is a monster you can hardly touch safely.

Simple, beautiful code is darned hard to write and I haven't yet met anyone who succeeds at that all the time (I know I don't). But one can hope with feedback from outside eyes, and a willingness to watch and rewrite over time, that it may eventually get there.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: