3 ms·
I've been writing a series of experimental prototypes recently; and I've noticed that as I try to add things to an existing prototype (instead of starting somet
by 10ren 17y ago
I've been writing a series of experimental prototypes recently; and I've noticed that as I try to add things to an existing prototype (instead of starting something new), it becomes incredibly painful. I actually end up spending almost all the effort on trying to make it fit with the code I've already written.
Reusing code seemed like a sensible thing to try to do (you should reuse code!), and the existing code itself was actually pretty clean - just not designed for what I wanted to do next.
Therefore, I've decided in future to try out making prototypes that are strictly prototypes. If I want to try something new, I'll make an entirely new prototype. And see how that goes. At the very least, it will probably be more fun. :-)
I mention this here, because of the article's description of "honeymoon code" vs. "maintainable code".
- blhack 17y agoYou need to make your functions smaller and more generic... This is something I keep fighting against myself on, but it makes my code more portable...
- jacquesm 17y agoMaking them generic is key to code reuse, smaller is sometimes only to improve readability. As soon as you see a pattern appear in your code, something idiomatic that you've done a couple of time with small variations it's high time to abstract out a library function. Do that a couple of times and you'll see the size of your functions diminish as if by magic.