18
dmoen
2y

Is it common to look at code you wrote 1 to 2 years ago and think "what the hell was i thinking, this mess needs refactoring"?

Comments
  • 7
    What's normal is looking at the source code you're writing right now, thinking it would need a refactoring, and being aware that this will never happen. Once it gets unbearably bad, it's time to update your CV.
  • 4
    think about how much you've changed in two years, all the words you included in your vocabulary. it's to be expected
  • 3
    Completely normal and a good sign of progress!

    The more advanced you are as a developer the more you are noticing bad code quality as you are writing the logic.

    I personally like the dev-cycle of making it work first, then pretty and then performant. Of course you should not build a huge pile of crap before doing any refactoring, but give yourself room to experiment even though the very first approach might not be perfect. While implementing your solution you will think of a better solution far more often than when just trying to find a perfect solution at the first try.
  • 1
    Looking at code I wrote a few months ago makes me want to refactor the whole thing.... I have ended up with like 5 different implementations of the same project
  • 3
  • 1
    If you don't, you are not growing.
  • 0
    @rEaL-jAsE

    I don't think that's a good idea. Of, course if you get the architecture perfect on the first try, that's great.

    But in the majority of cases you learn more about the problem you are trying to solve while solving it. Instead of wasting time on desperately trying to find a perfect solution before even beginning the implementation, you should come up with a good solution that works for now and refactor in stages. Much more efficient and less frustrating.
  • 1
    @rEaL-jAsE well, true, but "always keeping the code cleaner than you found it" is also a good moto to follow
  • 0
    Not me...
    I always structure my code from the start.
    It's just like writing a composition for school :p
Add Comment