|
|
|
|
|
by sultezdukes
4747 days ago
|
|
I find that for majority of problems I deal with functional solutions tend to be simpler, cleaner, and more reusable.
OO on the other hand is directly at odds with reuse because you marry logic and data together into classes. If you write a method and you need to use it for a different problem, you often have to jump through hoops to do it.
On top of it OO encourages premature classification. If you create a class and you need to use that data in a different way later you have to translate it in some way. This is why you have things like wrapper and adapter patterns. This can't be emphasized enough. I never understood why so many people thought that putting methods and data together was a good idea. I think Rich Hickey in an interview with Stuart Halloway possibly once said that when you jam your methods in with your data you're essentially creating a mini-dsl that makes reuse impossible. I can't agree more. |
|