Dependency Injection Breaks Encapsulation

This is a very good point. Tony, this is a serious question: If you were starting a new project that wasn’t based on RADICORE, maybe a e-commerce website or something else that’s not suited to it, would you use things like autoloaders, visibility modifiers, unit testing, php5 constructors, namespaces, DI and all that other stuff you call “optional”?

I 100% agree with this. I’ve always come to the conclusion that the reason tony is so argumentative is because he thinks if he can justify his bad practices to us (or others) and people agree with him, he doesn’t have to admit his code is awful by any standard.

What’s more worrying, though is Tony’s unwillingness to listen or learn. I look back at code I wrote 5 years ago and realise how much I’ve improved and can identify what I’d do differently now, and most importantly why. In 5 years I’ll probably do the same looking at code I wrote today. To me that’s a good thing as it allows me to grow as a developer. Tony, however, looks back at his 10 year old code and says “Ahh still perfect” which demonstrates an inability to grow as a programmer or learn new techniques.

Some of the code I wrote 10 years ago is as bad as Tony’s (No 9000 line classes, mind, but all the other stuff with mixed responsibilities, procedural code shoe-horned in to classes, global state, etc… however, I was 18 with no real formal training or experience!), the difference is I am happy to admit it was bad and can highlight how I’ve improved as a developer and you know what, if I hadn’t written it, I wouldn’t have learnt from it. Tony, on the other hand, once he’s written something it seems the ideas within it are then set it stone and can never be changed or even questioned.

1 Like