10 ms·
Static languages make refactoring easier, not harder. The more information you have at compile time, the more automated tooling can do for you.
by echlebek 9y ago
Static languages make refactoring easier, not harder. The more information you have at compile time, the more automated tooling can do for you.
- humanrebar 9y agoThe more compile time information you have, the greater coupling you have as well. Make User subclass Entity for polymorphism reasons and now taking a User parameter makes your business logic depend explicitly on your ORM.
- bunderbunder 9y agoBut now the conversation's going in a circle. In a decent static language, you should never have to run into that particular problem. Assuming it's a modern static OO language, your business logic should depend on a User interface, so that it never has to take a dependency on implementation details like that. Even if User was a class beforehand, you can easily extract an interface at a later date, when you find that you need to avoid some tight coupling. Don't blame the gun for what happens when you point it toward your foot and pull the trigger.