A Dependency of Dependency Inject

    I have voiced my opinion in the past on dependency injection, and even got myself in some stupid conversations with other developers who are little obsessed with this topic. I was first caught off guard because I questioned for my support for angular which I'll come back to in a minute. My first rule for using any tool or technology is to using it for its greatest strength and really use it or not at all. Which is creating tests around my code and creating versions of those dependencies."we need dependency injection for unit testing/scalability".  Neither of these reasons are wrong and I agree them but if you build blindly follow them without reason you miss the point. I one point used Ninject, and was actually stumped on the explanation given. This was because up to that point dependency injection was something I understood how to use but not its method. However I moved pass that point and started making my opinion clear. Show me the tests! The reason I given was scalability which I throw out. Its an disingenuous answer and not backed with any real demand. You build what you need when you need it. Or you pay the price for performance from my experience.
My final opinion, it might be weird to point this in the middle but the last bit is really just to close up on an different idea. This is part is based on the scope of c# really, and a note to people other just using it without reason. I'm not against DI I'm against practice of not keeping it simple! I complain about it a lot but its really why bugs exist in the first place. I do use DI for a few of my projects but when I see the need to tests modular pieces of my code. Not everything, which I see people doing. To summarize a meeting I went to on javascript development, a developer was testing the api on its responses without the responses...


What are you testing now the internet? Let the middle-tier dev worry about that. Or understand that api better and create tests around the database. Its not up to the frontend developer is my point.

What about AngularJS?
    I love angular and that hasn't changed with angular2 regardless what I say on twitter (cause I sometime disappointed by the choices they make). Which might sound like I've all about the old days with jquery but far from it. I think angular 1.5 does somethings right and something very wrong. I'm all about empowering the developer even the ones who do things in a way I disagree with. If we can win on some battles then we can come back to problems in web development. Most importantly the end of the day development is important and I've first hand see developers disagree on a topic. Which created chaos in the world in environment. As well as create me own but I look to at least create some progress with what I'm doing even if I have to give up some rules I believe in. At the end of the day if everyone is able to do their're job who care?
  So why I choice angular (not angular2 at the moment), because components is easy compared to jquery. Ya if developers want to make it complex and go the way of DJ whatever I don't have a choice I didn't write angular. If I wrote my own framework it would all work the same as jquery and continue with jquery being more complex but have that piece in a difference library. The reason for that is unless your going to create components that reuse one piece or another than it make senses. To wrap my point around this, if your going to reuse a "component" something your going to reuse on another website GREAT! else fuck off cause I can just create plugin with some framework and get just the same thing. Plus testing it with that framework in quint or whatever scope I need to and not being a specialist in that framework cause its all javascript.

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql