2. What is it?
• Divide the logical complexity of programs into
procedures or methods or sub-routines or
functions.
• Most of the data is shared as global that can
be accessed from anywhere within the
program.
3. Features & Benefits
•
•
•
•
Prevent code duplication. Reuse code.
DRY : Don’t repeat yourself
Improves readability of program code.
Code is more flexible as you can change a specific
procedure in one place & this procedure can be
reused across the application.
• Easy to maintain program code as various
procedures can be tested & debugged in isolation.
5. Structured Programming
• Enforces a logical structure on the program being
written to make it more efficient and easier to
understand and modify.
• Uses a top-down design model in which developers
map out the overall program structure into separate
subsections (procedures).
• No goto & jump statements.
• All loops terminate at the bottom. (the condition may
be at the top). No infinite loops.
• Single point of entry and preferably a single point of
exit from a method or a block.
• Precursor to Object Oriented Programming.
6. Disadvantages of Procedural
Programming
• Typically lack the syntactic sugar necessary to
enforce abstraction and encapsulation.
• Harder to reuse as code and data are separate.
Code you write on one project will be harder to
reuse in another project. May have to reinvent
the wheel on every new project.
• Has a tendency to be difficult to understand. As it
evolves, it becomes even harder to understand,
and thus, harder to maintain as code grows
larger.