ataraskov.dev

About everything and nothing


Stick with an ugly solution

Who doesn’t like clean and consice code? Software engineers tend to concentrate on algorithm and it’s elegancy, rather than on problem itself. Perfectionism is hard to overcome, and a lot of us have this trait for the better or worse.

As Larry Tesler was saing: “every application has an inherent amount of complexity that cannot be removed or hidden”. While Tesler’s Law of conservation of complexity is mostly used in UI/UX, it has something for a programmer as well (developers are users of their own code to some degree). In other words, sometimes there is just no elegent solution for a given problem. Yes it hurts, I know.

Why an ugly solution is ok:

  • Time is limited, deadlines are obvious limiter for a comersial project, but pet-projects are not immune, as we have only so much free time and time in general in our possesion.
  • Some solution better that no solution at all.
  • Perfection is not deterministicly achiviable, it consums all the time one has and asks for more.

Though fighting with an inner perfectionist is not an easy task. On one end you’d like to strive for the better, on another one all the limitaions around waiting to suck all your time and efforts into the void. There is one good way (IMHO) to get used to it and train yourself in getting just the right balance between elegant and ugly solutions. Programming exercises. Yes they are, again. Take Project Euler for example, one will see a lot of good, bad, and just ugly approaches for the same ‘simple’ mathimatical problem. But all of these solutions work (at least to some extent), the question is how much time and effort you are ready to spend on it ;)

References:

Thu Aug 10, 2023 / 315 words / Software Development Methodology