10 Ways to Kill Your Design - The Code Whisperer

February 19, 2012 Dependency Inversion Principle (DIP)

I wish that I could take credit for this article, but I can’t. Instead, I have to credit two people: Lasse Koskela and Miško Hevery. I credit Lasse for writing the manuscript that led me to Miško’s article. Look for Lasse’s upcoming book Unit Testing in Java at Manning Publications’ site. Let me summarize Miško’s article here, then you can read the details at his blog.


This is a companion discussion topic for the original entry at http://blog.thecodewhisperer.com/permalink/ten-ways-to-kill-your-design

Why are static methods less of a problem in Ruby and Python than in Java or C#? I think rather, you're just dealing with simpler constructs in scripting languages that are closer to the metal (ironically) so things like "global variables" are less scary inside an isolated interpreter instance.

I find it much easier to replace/override class methods in Ruby than static methods in Java, so I feel more comfortable refactoring them in Ruby than in Java.

:c