Top down and Bottom up programming

前端 未结 10 1174
佛祖请我去吃肉
佛祖请我去吃肉 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.

提交回复
热议问题