What’s worse than:
- Global variables?
- Badly chosen variable names?
- ASP.NET WebForms
? - Leaky abstractions?
- … enter your worst coding nightmare …
I’ve got one word for you:
Dependency Injection (well, that’s two words actually)
Why?
Remember 20 years ago? All of a sudden, WYSIWYG word processors were all the rage. For a good reason. WHAT YOU SEE IS WHAT YOU GET. Exactly!. Writing, editing, reading a document while you don’t have to worry about what the end result will look like. It was heaven.
The same is true for writing and reading code. Code should (more or less) do what it looks like it is doing. That’s obvious.
What does Dependency Injection do with your code? Nobody but the guy who implemented it knows. Now, THAT’s comforting.
You read a piece of code, and you think you understand what it’s doing, but the actual code is something completely different at runtime. WYSINWYG. A maintenace nightmare.
I know a lot of people will disagree, but all this code-changing magic is an accident waiting to happen. I wonder if this stuff is used in the Space Shuttle program code.
But that’s just MHO.
This weblog is sponsored by The Vici Project.








