Top down and Bottom up programming

前端 未结 10 1171
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 03:37

Why do we say languages such as C are top-down while OOP languages like Java or C++ are bottom-up? Does this classification have any importance in software development?

相关标签:
10条回答
  • 2021-01-30 03:38

    In Top-Down development you start out with your main function, and then think of the main steps you need to take, then you break up each of those steps into their subparts, and so on.

    In Bottom-Up programming you think of the basic functionality and the parts you're going to need and build them up. You develop the actors and their methods, and then you tie them together to make a coherent whole.

    OOP naturally tends toward Bottom-Up as you develop your objects, while procedural programming tends toward Top-Down as you start out with one function and slowly add to it.

    0 讨论(0)
  • 2021-01-30 03:39

    This Wikipedia page explains it pretty well http://en.wikipedia.org/wiki/Top-down#Programming

    0 讨论(0)
  • 2021-01-30 03:46

    C is structured language and the sequence of programs is from top to bottom. starting from the main method.

    while OOP depends upon number of classes and objects. flow of program is not in top down approach in OOP

    0 讨论(0)
  • 2021-01-30 03:49

    In top-down approach the system is first formulated specifying but not detailing any subsystem at the beginning, and then each system and its subsystem is defined in great detail until specifying it to the base.

    e.g.- In a C program one needs to declare functions at the top of the program and then through the main entry to every subsystem/subroutine is defined in great detail.

    In bottom-up approach first designing, beginning from the base level to the abstract level is done.

    e.g.-In c++/java starts designing from class from basic level of the programming features and then goes to the main part of the program.

    0 讨论(0)
  • 2021-01-30 03:51

    I've never heard the terms "top-down" and "bottom-up" used in that way.

    The terms are usually used to describe how one approaches design and implementation of a software system and so apply to any language or programming paradigm.

    In "On LISP", Paul Graham uses the term "bottom-up" slightly differently to mean continually extracting common functionality into shared functions so that you end up creating a new, higher level dialect of LISP that lets you program in terms of your application domain. That's not a common use of the term. These days we would call that "refactoring" and "domain-specific embedded languages" (and old LISP programmers would sneer that LISP has been able to do that since the 1950s).

    0 讨论(0)
  • 2021-01-30 03:56

    I do believe the difference between the top down approach and bottom up approach to programming is that the top down approach takes the problem and into and breaks into manageable steps and bottom up approach is actually detailing those steps.

    0 讨论(0)
提交回复
热议问题