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

PROGRAMMING STYLE

The document discusses various programming styles including structured design, monolithic programming, modular programming, top-down and bottom-up designs, object-oriented programming, and visual programming. Each style has its own advantages and disadvantages, with modular and object-oriented programming being highlighted for their efficiency and ease of debugging. The document emphasizes the importance of structured approaches in programming to facilitate maintenance and collaboration among programmers.

Uploaded by

denking190
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

PROGRAMMING STYLE

The document discusses various programming styles including structured design, monolithic programming, modular programming, top-down and bottom-up designs, object-oriented programming, and visual programming. Each style has its own advantages and disadvantages, with modular and object-oriented programming being highlighted for their efficiency and ease of debugging. The document emphasizes the importance of structured approaches in programming to facilitate maintenance and collaboration among programmers.

Uploaded by

denking190
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

PROGRAMMING STYLE

(a) Structured design

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.

(b) Monolithic programming

This is a un formalized approach to programming. It refers to large undisciplined approach. It


has no advantages. It is a total program approach where all sub programs are planned together as
a logical application. It has a conventional approach which is unsystematic in treatment and it
can be unwieldy but it is common among amateur programmers. It is only unstructured method.

(c) Modular programming

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.

(d) Top- down

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

Controlling (main) program

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

(f) Object oriented programming

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

. They have become more popular because of this.

(g) Visual programming

Visual programming is structured objects-oriented programming in windows based on ready


made objects. It comprises a collection of procedures that responds to other procedures that
performs specific tasks such as event procedures and general procedures. It is also event –driven
programming in that all the activities in the program are triggered by one event or another, such
as click and key press. Each object has its own event handling procedures. An event procedure
executes when an event associated with the application occurs whereas a general procedure
contain code which performs common functions and can be used by other procedures.
Procedures can be either public (used throughout the program) or private (limited to the
procedures where it is defined).
The difference between object-oriented programming (oop) and event-driven programming is
that oop involves round-made objects whereas in event-driven programming activities in the
program are trigged by one event or a more such as click and key in input.

You might also like