3 ms·
I've been programming for a number of years, I still follow this mindset. I'll write out a function and then later realize I need to use a subset of it somewher
by logn 14y ago
I've been programming for a number of years, I still follow this mindset. I'll write out a function and then later realize I need to use a subset of it somewhere else, so I refactor it out to its own function. Or I'll realize I've now extended the same class twice, so I create a better abstraction. It's much easier to create well designed code when you actually see a need for something in the source and do it, instead of starting first with some fancy design pattern you saw someone else use on another project. I mostly focus on getting the small, granular stuff right the first time and keep an eye out for any larger problems being created in the code.