0% found this document useful (0 votes)
72 views

Structured Programming

Top-down programming is an approach where a program is constructed starting with a high-level description and breaking it down into simpler pieces until it reaches the primitives of the language. It complicates testing since nothing is executable early on. Modules tend to be very specific to the application and not reusable. The main disadvantage is that changes to the high-level specification risks requiring large code rewrites. It generates modules based on functionality as functions or procedures, refining the high-level description into simpler pieces recursively. There is a risk of implementation details being globally exposed and unwanted dependencies forming between modules.

Uploaded by

Nenek Kebayan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Structured Programming

Top-down programming is an approach where a program is constructed starting with a high-level description and breaking it down into simpler pieces until it reaches the primitives of the language. It complicates testing since nothing is executable early on. Modules tend to be very specific to the application and not reusable. The main disadvantage is that changes to the high-level specification risks requiring large code rewrites. It generates modules based on functionality as functions or procedures, refining the high-level description into simpler pieces recursively. There is a risk of implementation details being globally exposed and unwanted dependencies forming between modules.

Uploaded by

Nenek Kebayan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Structured Programming

Top-down programming
Top-down programming is the opposite of bottom-up programming. It refers to a style of
programming where an application is constructed starting with a high-level description of
what it is supposed to do, and breaking the specification down into simpler and simpler
pieces, until a level has been reached that corresponds to the primitives of the programming
language to be used.

Disadvantages of top-down programming


Top-down programming complicates testing. Nothing executable exists until the very late in
the development, so in order to test what has been done so far, one must write stubs .

Furthermore, top-down programming tends to generate modules that are very specific to the
application that is being written, thus not very reusable.

But the main disadvantage of top-down programming is that all decisions made from the start
of the project depend directly or indirectly on the high-level specification of the application.
It is a well-known fact that this specification tends to change over time. When that happens,
there is a great risk that large parts of the application need to be rewritten.

How does top-down programming work?


Top-down programming tends to generate modules that are based on functionality, usually in
the form of functions or procedures. Typically, the high-level specification of the system
states functionality. This high-level description is then refined to be a sequence or a loop of
simpler functions or procedures, that are then themselves refined, etc.

In this style of programming, there is a great risk that implementation details of many data
structures have to be shared between modules, and thus globally exposed. This in turn makes
it tempting for other modules to use these implementation details, thereby creating unwanted
dependencies between different parts of the application.

Object oriented programming, or OOP, is one model of programming language. Unlike other examples of computer
programming language, object oriented programming focuses on the use of objects instead of actions in order to carry
out tasks. This use of objects to design applications instead of actions also involves taking an approach that is more
mindful of data and less concerned with logic, which is more commonly the case in other paradigms.
This different approach taken by object oriented programming means that the view of objects and actions is reversed.
The emphasis is on the objects themselves rather than on the execution of tasks that employ the objects. In like
manner, the structure of object oriented programming does not consider deciding on how to employ the logic, but on
the definition of the data that will be used in the programming.

You might also like