Re:Software Engineering Laws Everybody Loves to Ignore
by toto444 on Saturday February 27, 2021 @04:49AM
(#26283772)
It happens to me as well. I sometimes think : 'oh I already did this. That was very well thought'. Unfortunately I can't share this feeling with me 6 months ago.
The times when the code is painful to read is when I write scripts that are supposed to be used once and turn out to be reused several times (but not very often) and when the specs were not really well defined at the beginning of the project.
Admittedly I am data scientist not SWE and it is hard to compare the complexity of SQL code to the one of a programming language.
More than once I've thought I've run into a bug and figure out what the problem likely is, only to go into the code and discover that I already covered that case and the bug is something else entirely.
Most of the rewrites are because I had to do something awkwardly because some feature didn't exist in a library, or it was broken and I had to work around it. Then a couple of years down the road that bug or missing feature has been fixed and I can pull out the hacks and do it the elegant way.