3 ms·
It's a nice idea, but look at how much code you have to write to obtain this decoupling. The "mental" abstraction is nice to have, but when you end up typing m
by beaumartinez 14y ago
It's a nice idea, but look at how much code you have to write to obtain this decoupling.
The "mental" abstraction is nice to have, but when you end up typing more characters, it's just counterproductive.
Once you start repeating yourself, then it makes sense. To do it from the start is overengineering—"you ain't gonna need it".
- wting 14y agoYour argument taken to the extreme leads to code golf. Sure abstraction is worth it. You get code reusability, better unit testing, and faster understanding of the code. Maybe a small script doesn't need it, but once something starts growing past a few hundred lines you're better off.
- mercurial 14y agoIt's worth it for most things you'll end up maintaining. How many of these "one-shot" scripts have stayed and grown to full-size systems, preferably by keeping the same hastily thrown together structure over the years?
- comex 14y agoNobody suggested taking his argument to the extreme. A larger script might indeed need it, but knowing when you need abstraction and when you don't is key. In this case, YAGNI.
- jeremyjh 14y ago> once something starts growing Is a good time to refactor.