In this chapter, Bertrand Meyer attempts to solidify the sense of "beauty" in beautiful architectures with certain criteria. The author focuses on three qualities: reliability, extendability, and reusability. He then argues that the object-oriented programming style achieves higher marks in all the criteria. In this day of age, when the OO style is much more prevalent than functional programming, I suspect that he is mostly preaching to the choir.
One of the main advantage of functional programming is the avoidance of program state. As the author has successfully argued, having states is useful and sometimes almost necessary and thus even the modern functional languages provide some mechanism for states. On the flip side, the OO style can lessen the complexity that come with having states with programming styles such as the separation of commands and queries, which I believe is a beneficial and common style today.
A couple of major advantages I believe regarding OO programming that the authors have also mentioned are first, by thinking in terms of object, it brings a programmer's mind set to a higher abstraction level and that usually helps when designing the overall architecture. It becomes even more necessary as programs grow in complexity; second, class inheritance greatly improves code reuse. With inheritance one inherits the default behavior from its parent(s) for free. This automatically promotes code reuse. The code reduction is felt even greater with multi-layer inheritance.
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment