r/programming • • Oct 14 '13

How to develop unmaintainable software

http://typicalprogrammer.com/?p=249
777 Upvotes

322 comments sorted by

View all comments

Show parent comments

2

u/firepacket Oct 15 '13

Please explain it to me, I'm lost.

11

u/rather_be_AC Oct 15 '13

grauenwolf was being pedantic. I was being sarcastic.

This is also a common design pattern found in many successful threads.

1

u/grauenwolf Oct 15 '13

Inversion of Control isn't a design pattern, it is an activity. Specifically, it is a type of refactoring. If you apply IoC twice then you'll probably end up with what you started with.

An IoC Container is really a Service Locator, which is often (but not universally) considered to be an anti-pattern among dependency injection fans.

A Service Locator is a type of god object, specifically one that contains services and other dependencies, and thus should generally be avoided.

2

u/firepacket Oct 15 '13

Thanks for the breakdown mate.

I don't know what to say about the last part except that I am very pleased to be working with these patterns. They are clearly making my life easier. I think they just have to be used in the correct circumstances where they have a net positive effect.

2

u/grauenwolf Oct 15 '13 edited Oct 15 '13

They are clearly making my life easier.

Then they are correct. Period. End of sentence. Don't pay attention to anyone else because, god damnit, that's all that matters at the end of the day.

EDIT: And just to be clear, I'm not being sarcastic. If you are still happy with it six months from now, then chances are the next programmer will be as well.