Top Down vs. Bottom Up Approach.


       I have seen many people who refer to E. Balagurusamy's OOP with C++ are quite confused as to what is the difference between BOTTOM-UP and TOP-DOWN. Just to make it clear, this thread only deals with the basics of the 2 approaches.

      Coming to the book, it talks about C++ being BOTTOM-UP and C being TOP-DOWN. I personally feel he was wrong there as the approach doesn't depends on the programming language but on the Software Engineering methodology adopted by the company for a particular software product. In general, however he was right, how read below.

Figure. Simple Diagram which describes both methods.

       To put it in the simplest way, bottom up means, you make the smallest pieces of your program first and then use them as blocks to build a bigger program.

       In top down, you start building the highest level of abstraction and then make small bits that will fit it.



To put it in an example from automotive engineering....

Say Ferrari decided they want to make two new cars, one bottom up and the other top down :

Top down design :

  • An artist decides how it will look.
  • An expert car driver decides how it should handle.
  • The marketing team decides what design features will appeal to the target demographic
  • They build all the parts needed to fulfill that (or utilize existing parts from other car models).

Bottom up design :
  • An engineer decides it's going to be a 4 liter V8 with a new engine design, and they build that.
  • A race car driver decides it needs a certain kind of suspension and transmission.
  • They test in a wind tunnel, which body shape is ideal for the performance goals.
  • They build a car around these various parts.
  • The marketing team decides what target demographic this car will appeal to.
Of course the reason why Ferrari is Ferrari is because they balance the two approaches.

In coding it is different. Bottom up seems to work better.
Notice that in the software industry, engineers tend to think bottom up, worrying about which language, library, platform, architecture etc. is ideal.

The entrepreneurs tend to look top down, as to how the product looks and works, no worries about what is used internally.

Facebook seems like it started as top down project, using PHP, which is a very, very poor choice. When it began to have problems, they hired top notch engineers to build XHP and a PHP to C++ compiler.



Comments

  1. There is this blogger who writes good stuff when it comes to CS. Here's he
    talking about TOP-DOWN vs. BOTTOM-UP here

    ReplyDelete

Post a Comment

Popular posts from this blog

Python - the programming language.

Platforms of Java