Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Hermel
· 10y ago · 0 comments
Dependency injection does not decrease coupling, it hides it.
Comments
[–]
dustingetz
10y ago
Writing code against IList instead of ArrayList, or IDatabase instead of PostgresDatabase unambiguously decreases coupling.
[–]
Hermel
OP
10y ago
Not if you explicitely configure the IList to be an instance of ArrayList and expect it to behave like an ArrayList. In that case, just taking an ArrayList is the more honest and more readable option.
[–]
zamalek
10y ago
Well-said.