4 ms·
> Copying and pasting code, which is what this guy is advocating for, is not good. Well obviously this is why we have variables and functions, etc. And hopeful
by mathgenius 10y ago
> Copying and pasting code, which is what this guy is advocating for, is not good.
Well obviously this is why we have variables and functions, etc. And hopefully this helps enforce DRY ("don't repeat yourself.")
But, reusing a component leads to coupled code and that can also spell disaster. Sometimes it really is better just to copy stuff. Maybe this is a matter of taste; some people like to have the perfect design and if that makes them a happy coder then i guess you should let them do that. I find that, more often than not, the "perfect design" is not worth sweating over. My style is tracer-bullet: get it working today, write some tests maybe, and then refactor it.
- taeric 10y agoI like the term "tracer-bullet." You should get that written up as a blog, if it isn't already. Reminds me of an anecdote about getting people onto the moon. When that was their goal, the very first thing Nasa did was make sure they could hit the moon with a rocket. Then iterated from there.
- TeMPOraL 10y ago> I like the term "tracer-bullet." The term is actually from the book Pragmatic Programmer (a good book, though I'd say mostly for beginner-to-intermediate programmers, since a lot of software blogs are essentially just repeating the contents of this book ad nauseam). I tend to do that too - get something working fast, and iterate over it. Focusing on perfect abstractions makes no sense if then you find out you're aiming in the wrong direction.
- taeric 10y agoEmbarrassingly, I should have known that. I just checked to make sure that wasn't where I heard the "just hit the moon" quote. I find I have been terrible at obsessing over abstractions I could be proud of. I try to instead keep my eyes on solutions I can talk to.