3 ms·
> Never mind ... the dogged insistence on dependency injection at every possible turn. You will do yourself and your career a favor if you learn it!
by aliswe 5y ago
> Never mind ... the dogged insistence on dependency injection at every possible turn.
You will do yourself and your career a favor if you learn it!
- FridgeSeal 5y agoI did learn it when I wrote .Net. I understand it fine, but I think it's far too situational, and greatly overrated. There's so much focus on "abstraction magic" and a desire to avoid admitting you have a dependency or daring to ever actually implement something. It made writing code and debugging code more annoying (everything shows up with "0 references" in VS because...it's all behind DI magic). To say nothing of the verbose, boilerplate setups for it, which were closer to actual incantations than logical code. I'm sure there's more lightweight ways of doing it, or we should have used a different DI tool, or it shouldn't be done x/y/z-way anymore, but the reality of most DI-afflicated .Net code that I've had to deal with is that it's never done 'well' and all it did was add noise and code that was more difficult to write, debug and maintain. It falls in the same bucket as most of those other OOP/SOLID/design-pattern principles - half-decent situational guidelines for software that morphed into what amounts to 'holy covenants' that must be strictly applied at all turns.
- DeathArrow 5y ago> It made writing code and debugging code more annoying (everything shows up with "0 references" in VS because...it's all behind DI magic). VS shows all references for code, even if the code is called through DI. If you highlight a method call or a property and press CTRL+F12, you will actually jump to implementation. >It falls in the same bucket as most of those other OOP/SOLID/design-pattern principles - half-decent situational guidelines for software that morphed into what amounts to 'holy covenants' that must be strictly applied at all turns. I actually dislike GoF patterns, SOLID, Uncle Bob principles and OOP in general, but DI in .NET is quite decent now. Maybe your experience is from old .NET Framework. What language have you moved on?
- FridgeSeal 5y ago> VS shows all references for code, even if the code is called through DI Maybe your setup is better than mine, but I distinctly remember ctrl+f12 not working for a bunch of stuff and having to keep stacks of tabs open. > Maybe your experience is from old .NET Framework. Was a mix of framework 4.5 and core 3.1. The other devs worked across both, the projects I was on were core 3.1 with C# v8 specified, basically as close to “as modern as I could get” without running into compatibility issues haha. > What language have you moved on? Rust for personal projects and some work stuff-it’s by far my preferred language-, the rest of the work stuff is Scala and Java, largely dealing with Spark.