I love this. This is a perfect exemplar of the absurdities of code, from the nonsensical boilerplate overhead of OOP styles to utter ennui.https://twitter.com/16kbps/status/912319298684772352 …
You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more
What's the difference (I thought dep injection was "passing in values for member vars as part of the constructor")?
That's one (weak) way to accomplish it. In this case, it's irrelevant as the int type is a platform type and DI is unnecessary.
But more generally Dependency Injection's benefit is to accomplish inversion of control. So it's the control paradigm that matters.
IoC basically means "don't `new` off classes," and one way to accomplish this is to provide a reference to the object that needs that class
But putting it in the constructor is the weakest way, imo, because you just trade one refactorability problem for it's mirror image.
As you can prob tell, I'm not great with OOP (I have a pdf of GoF thought). This gives me something to chew on, so thanks!
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.