Tuesday, January 3, 2017

Lecture 03 - Concepts of Programming - Part I



Amateur vs Professional Programing

Writing programs is not only a creative activity but also an intellectual discipline. We must be careful to distinguish between 'amateur' and 'professional' programming.

Amateur software development is concerned with producing a correct solution to a problem for the individual programmer. The elegance of the solution may not seem important and documentation may seem to be unnecessary as the author will be the program's only user.

Professional software development, involves, large and complex systems to be operated and maintained by people other than the original author. It may last for many years during which time it will be continually enhanced and amended to meet the changing environment in which it operates. The elegance or style with which the software is written and the clarity of its documentation will be more important than the correctness of its solution.


History of Software Design

The purpose of a brief consideration of the development of the practice of program design is to be able to appreciate the refinement of thinking which has taken place over the years under the influence of theoreticians and practitioners who have shaped our discipline. There is perhaps a tendency to think that software design was always as it is now. This is not so, and a brief look at its development may help to shed some light on the reasons why current practices and development tools are promoted as desirable.


Programming is an art, rather Engineering

When programming emerged as an activity some forty years ago, the main preoccupation was with the correctness of the solution. Precisely how that solution was derived was very much subordinate to the actual solution itself.

The design tool that emerged from this period was the flowchart. Flowcharts are a diagrammatic representation of the flow of logic within a program or within an individual process' To some extent, they provided a means of depicting the program structure, but their main concern was with logic flow. This reflected the contemporary -view that programming was mainly concerned with logic.

Structured Programming
Structured programming was developed during the 1950s after Edger Dijkstar's insightful comments into the harmful nature of the GO TO statement. Dijkstar and others subsequently created a set of acceptable structures in programming that would enable development without GO TO statements.
The structured programming uses three control constructs namely;

  1. Sequence
  2. Selection
  3. Repetition

These structures produced programs that were easier to read by humans easier to debug and easier to test.

Unstructured Programming
This is a programming style that was used before "structured" programming and predominantly used with lower level languages. These languages did not offer selections such as IF / ELSE and repetitions such as WHILE/DO and REPEAT/UNTIL. Therefore, they accomplished the required control of the program by using GO TO statements. These were branch instructions that allowed the control to be transferred from the current instruction to a specific place (Label). An example of an unstructured program is given below:

Input A
Input B
GO TO ADD
BACK : Print Total
GO TO END

ADD : Total = A + B
GO TO BACK
END: STOP 

Object-Oriented Programming
Object-oriented programming (OOP) is an emerging major programming paradigm. Much of its approach to program and system design is owed to concepts which also gave rise to structured programming. An object is a particular instance of a class and consists, essentially, of data which defines its characteristics and current status together with procedures, or 'methods', which operate on the object.

For example, an object may be a bank account possessing data items which record the name and address of its owner and its current balance. lt may have associated methods which allow its creation, deletion and amendment with deposits and withdrawals.

No comments:

Post a Comment

Important Notice!

Dear students and friends. When you commenting please do not mention your email address. Because your email address will be publicly available and visible to all. Soon, it will start sending tons of spams because email crawlers can extract your email from feed text.

To contact me directly regarding any inquiry you may send an email to info@bcslectures.website and I will reply accordingly.