oopinterface

Necessity for Interfaces, Injections in unique project


Why should I implement Interfaces and Dependency Injection on a site with almost no chance for reuse or upgrade by anyone else?


Solution

  • When you learned how to program a computer, you were developing a kind of 'muscle memory' of your craft. Over the years, you continue to program in that same mindset. Most people don't learn all of the nifty OOP principles right from the start, so they seem like they are more effort than the way they learned.

    You should get in the habit of using OOP design techniques whenever you are using an OOP language, because that will make you a better developer overall. Your goal should be to retrain your muscle memory of programming to use those techniques. Then you won't have to ask these questions and assume that the techniques are somehow 'getting in the way' of your programming. You become a programmer that just programs that way.