3 ms·
The standard "right tool for the right job" adage comes to mind. If I write Java or JavaScript, then using objects is fairly important (in fact, I have a hard t
by ChrisMarshallNY 6y ago
The standard "right tool for the right job" adage comes to mind. If I write Java or JavaScript, then using objects is fairly important (in fact, I have a hard time writing good JavaScript, because it is really an "object-based," as opposed to "object-oriented" language that rewards runtime modification, and my mind doesn't really work that way).
As was mentioned earlier in the comments, if we are designing code for reuse, then using a reusable design pattern is important. It doesn't have to be a class (I program in Swift, which uses structs and enums more often than classes), but it should be in a form that can easily be extended or derived from.
I will also do stuff like refactor a bunch of code out in a project that I'm developing, and create an entirely new project, based on that, so it can be reused. In that case, I may take a simple, focused tool, and make it a bit more generic and/or complex, widening its utility (of course, that also means that I add a bunch of testing that would not have happened, otherwise).
I sometimes think that we get caught up in the tools or dogma; letting them define us. I say this, having been through exactly that.