In this chapter, the author compares the functional programming style with the object oriented style. It is probably not a surprise to any one that he comes to the conclusion that OO style is the better approach because it provides higher level abstraction and more extensible and reusable.
OO style is the most widely used programming model. Thinking in terms of objects allows for greater abstraction in the design and OO techniques like inheritance and polymorphism are powerful for creating extensible and reusable code. This makes object-Oriented environment more manageable especially as the system grows towards the enterprise level.
Functional model is good when the program does not need to remember the states and when only the final result matters. It is great for mathematics as the program can be written almost exactly as the mathematic expression. I used ML in a compiler class and it was quite impressive to see how one line of ML program can compute very complex matrix operations. The corresponding function to achieve the same task in a language like java would take many lines of code.
I think functional languages are very hard to learn for people who started with object oriented programming style. OO style is very similar to the way people think and it is very intuitive compared to the functional style.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment