PROGRAMMING STYLE
PROGRAMMING STYLE
structured design entails developing a program as a series of independent sections for the
purpose of performing one task .Structured programming involves the use of facilities such as IF,
THEN, ELSE REPEAT,UNTIL, WHILE-DO and for –DO. Statements. This approach enables
program errors to be localized and assist in the maintenance of each section.
Refers to development of a modular basis under this method; the program is broken up in more
manageable units. Each unit represents a major uniquely identifiable component of a program
called a module can be written separately almost identifiable of others but are a coordinated
basis. This approach facilities the debugging (detecting errors) and maintenance of a program. It
also enables a large program to be developed in a shorter time by a team of programmers thus
making the work load lighter. The modules can be used in housekeeping input, processing and
output functions. In good programming practical program modules form a group of sources code
which translates into subprograms such as subroutines procedures or functions?
MODULAR PROGRAMMING HAS THE FOLLOWING ADVANTAGES.
1) A program can be developed into separate sub programs called modules
2) It facilitates the development a programs by terms of programmers.
3) System modules can be written and tested independently
4) It makes debugging of programs a lot easier because errors are localized in modules.
5) Programs can be developed in a shorter time.
6) Modules ounce compiled can be imported and exported to other programs written in the
same language or different languages.
In a top down design macro structures of main program is written first and the lower and lower
subprograms are written in stepwise structured modular decomposition
Subprogram Subprogram
Subprogram
Subprogram Subprogram
(e) Bottom-up
In bottom-up design the lower subprograms are tested and debugged in other words top-down
development creates a high-level logic complex structure and all important program or system
interfaces first before a great deal of detail code has been written. It is mostly used in new
systems. It saves time wasting and helps to avoid costly problems of interfacing. Empirically the
bottom –up development tends to run into interface problems, especially when you have to put
together programs systems modules written by different teams of programs there are three
problems.
a) They tend to involve more changes to existing code that say logic “bugs”, in that one
error in calculation is carried on to another part of the program.
b) They tend to be found one after the other.
c) In bottom-up development, interface bugs (problems) are found after most of the task. Or
project budget and most of the time have been spent and when the deadline for delivery
of the system or program is near or past.
Subprogram Subprogram Subprogram
Subprogram
Subprogram
Main program
In object oriented programming, data is declared as part of the code with object oriented
programs data and code, that is methods that operation on your data together that can be treated
as auni to objects=code + data . While other programming languages separate data elements from
the procedures or actions that will be performed upon them, OOP languages tie them together
into objects. In procedural languages, a program consists of procedures to perform actions on
each element, whereas in OOP, programs tell objects to perform actions on themselves.
Object – oriented languages like Objective C, C++, visual basic, visual C++, are easier to use
and more efficient for programming the graphics-oriented user interfaces required by many
applications. Once objects are programmed, they are reusable
The three features of OOP are_
(a) Encapsulation is the ability to combine data and code (procedures) that operate on it onto
self-contained entities called objectives.
(b) Inheritance is the ability for one object (parent) to have attributes similar to another object
(offspring).
(c) Polymorphism gives the code ability to act on many different objects, or be shared by many
different related objects.
The main benefits of OOP are
a) Simplification- Designing a program is easier , because corresponding more
closely to real world entities.
b) Reusability- Because objects are related so closely to the data they operate on ,
it is possible to reuse old ,reliable objects in new programs .
c) Reparability- while updating programs based on object oriented technology,
objects isolated programs functions from each other so that a change in one does not
change program operation elsewhere.
Some of the advantages that are also advanced in favors of OOP are faster and smaller programs,
which are easier to maintaining object-oriented programming for windows, the basic object is a
window, such a project window form window and properties window. Common objects include
controls forms and application programs
Object-Oriented languages