3 ms·
I love the feeling after having rewritten some code part with the results of having it much shorter, much clearer, more stable and even faster. :) In almost all
by albertzeyer 16y ago
I love the feeling after having rewritten some code part with the results of having it much shorter, much clearer, more stable and even faster. :) In almost all cases, it was worth it.
The strange thing is, sometimes there are multiple iterations of this on the same code part (sometimes by different people, sometimes even by my own).
Then I am thinking, maybe I just have gotten wiser, have learned my lesson or whatever. Stupid me that I haven't implemented it in the first place like this.
Also, I am always wondering, how much more iterations are there until I get to some final, perfect, optimal solution.
Or will I really end up with one single line of code in the end? :)
- sp332 16y agoAll code can be made shorter. But all code also has at least one bug. So eventually your code will be just one byte - but it will be the wrong byte :-)
- sreitshamer 16y agoIf you look at programming as a knowledge acquisition activity instead of a code production activity, then you couldn't possibly have implemented it that way in the first place.
- yesbabyyes 16y agoExactly. Usually I don't have (or give myself) the luxury, but when I'm working on something small and I don't really have time constraints for it, I will write it, then rewrite it, then look at it from a different angle, and rewrite it again. Only after about three rewrites will I get something that looks good. I'd like to bring this down to writing something good looking earlier, but it's like you say - I only learned it then and there.