Structural vs OOP Concept

This was actually the fairy tale that my lecturer told me years ago, before he started the OOP concept.

There were two man that worked for timber company. Their job were to cut down the trees. But the company only had two tools: saw (manual saw) and chain saw. The first person that saw the saw, took it right away and saying to the other person “I always work with this tool all of my life. I’m sure I can finish my job faster than you using this tool”. The second person took the chainsaw, but he never used it or knew how to use it. But he didn’t want to be fired from the company. So, he managed himself to learn it anyway.

In the first few days, the first man who used manual saw looked very productive. He cleared out the forest very fast, while the second man still playing around with his chainsaw. But on the third day, the second man finally got an idea of how the chainsaw should be used. So, he started to work on that day.

In the end of the week, the man with the chainsaw could only finish 50% of what the man with the manual saw did. So, the man with manual saw said to him “You’d better replace your tool with mine”, but the man with the chainsaw refused. He said “Let’s wait until the next week”.

The next week, the man with manual saw worked slower than before. His human force didn’t allow him to work that hard for a long time. The man with chainsaw worked as fast as the last week. So, in the end of the second week, the man with the manual saw couldn’t cut anymore trees, while the man with the chainsaw was ready to cut the next forest.

The story is analogue with the procedural and OOP concept. Procedural programming allows program to be created easily, and faster than OOP one. But, while the procedural programming gains more code, it’s effectiveness is getting lower. The programmer that works with procedural programming spends his/her time to prevent the code breaking while new code is inserted. In the bigger code, such as OS kernel, programmer spends his time, not by adding new features, but by tracking defects and fixing bugs. At some certain level, procedural programming cannot be extended anymore and has to be terminated. This problem is the main reason why OOP was developed, to make the program reusable and extendable with less headache.

At first, OOP was just a concept and can be deployed using any procedural language. Then Eiffel (the first OOP language) started to put language barrier to force its user think in OOP concept. C++ was also developed to extend C language to implement OOP, but it never force its user to think in OOP. As the result, there’s a lot of people that use C++ similar like procedural programming. Sun was addressing this problem, by creating C++ compatible language but with strict OOP (think in OOP or don’t use this language), called java.

IMHO, programming language is not the main issue when creating a program. The main issue is whether the programer has such concept about quality, maintainability, extensibility, etc or not.


    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s

  • Recent Posts

  • Archives

  • Categories

%d bloggers like this: