4 ms·
Why would it? OO languages aren't functional. Trying to misuse a tool seems like a great way to resent it. After learning to use a saw, trying to cut boards
by stonemetal 14y ago
Why would it? OO languages aren't functional. Trying to misuse a tool seems like a great way to resent it. After learning to use a saw, trying to cut boards with a hammer would be a nightmare.
- loup-vaillant 14y agoIt depends on your OO language. If you have garbage collection, you can at the very least refrain yourself to use mutable state all over the place, especially at interface boundaries. It's not hard: http://loup-vaillant.fr/tutorials/avoid-assignment http://loup-vaillant.fr/tutorials/avoid-assignment
- nahname 14y agoI learned java in school and used C# professional for year. Almost every useful refactoring I perform in C# is based on functional concepts. You can slap patterns on a mess to provide order or you can introduce functional concepts to remove it, almost entirely. I am not trying to dismiss patterns, but when you have lambda's you have a free way to add a visitor, command or specification to your code. It is one line instead of three interfaces and a bunch of shared understanding. Consider, var even = (new [1,2,3,4]).Select(x => x % 2 == 0); The select statement gives you a way to interrogate individual objects, in the same way you could if you built up all the plumbing for a visitor pattern. What did I have to add to do this? Nothing. C# is awesome.