Join the DZone community and get the full member experience.Join For Free
"I love writing authentication and authorization code." ~ No Developer Ever. Try Okta Instead.
The strangest thing I have read in the recent past (emphasis mine):
In his classic “Clean Code” Robert C. Martin describes a great (and widely adopted) way to object oriented programming. He says code should read from top to bottom like prose. Start with the most high-level concepts and break them down into lower-level pieces. Then when you work with such a source file, you may be able to more easily follow the flow and understand how it works.
I am not sure if Bob Martin actually said that, but for as long as I can remember, object-oriented programming was meant to be bottom-up design. OO design was supposed to be a relief from the top-down programming of procedural languages such as Basic and C, where you start with the problem that you need to solve and then break it into tiny pieces of functionality. In OO design, you think at the lowest level about objects that interact with each other and define properties and methods. Then you assemble them together to gain the desired functionality in your program.
The comparison here is to assembly lines. You take various components and then assemble them together to obtain the final product (car, truck or airplane). In object-oriented design, we want to gain the same advantage. Of course, the problem is that programming is not exactly like manufacturing, and traditional object-oriented languages have been found lacking. Hence continued innovation in the programming language space. We have been seeing new languages as well as dramatic improvements in existing languages (C# comes to mind).
As for the rest of the piece, there is weird stuff like “It takes some training to learn how not to write 2000-line classes and 500-line methods“. But this even violates top-down design. A 500-line method is not broken down into “lower-level pieces”. Someone who does that has no concept of code organization, reuse and maintainability. It is not an effect of OO programming, as the author seems to imply.
Opinions expressed by DZone contributors are their own.