Object-Oriented Programming
|
OOP is a technique in which programs are written on the basis of objects. An object is a collection of data and functions. Object may represent a person, thing or place in real world In OOP, data and all possible functions on data are grouped together. Object oriented programs are easier to learn and modify. C++ and Java are most popular object-oriented languages.
Example
A person can be an example of an object. It has some properties or characteristics that describe it. Some properties of Person object can be as follows:
- Name
- Age
- Height
The Person object also has some functions that describe what it can do. Some functions of Person object can be as follows:
- Walk
- Talk
- Eat
Event-Driven Programming
Event-driven programming is a programming technique in which the statements are executed in response to an event. An event occurs when something happens.
In event-driven programming, the programmer writes the code that is executed when a particular event occurs. The event-driven programming technique is typically used with visual programming environments.
Some examples of events are as follows:
- Clicking the mouse button.
- Typing a character from keyboard
- Moving the mouse
- Deleting or changing a value
Some examples of event-driven programming are as follows:
- A popup menu appears when the user right clicks on a window.
- The current window is closed when the user presses ALT+F4.
- The file is printed when the user clicks Print button.
Visual Programming
Visual programming is used to provide a user-friendly interface for interacting with the programs. A visual programming environment provides different objects to develop a graphical user interface such as windows, menus, buttons and list boxes. The programmer can select any object from the toolbox to use in the program. These components can be moved, resized and renamed easily.
The visual programming environment allows the programmer to design the user interface and then attach the code with each object. The attached code is executed when the user interacts with different objects. For example, a window is closed when Close button is clicked Some examples of popular visual programming environments are Visual Studio NET and NetBeans.
Advantages/Features of Visual Programming
Some advantages of visual programming are as follows.
- Visual programming is easy to use and learn.
- A programmer does not have to write code to create components.
- The visual components can be moved, resized and deleted easily.
- The programmer can create the user interface easily.
- The components provided by the visual programming environment contain some built-in code.
- The visual components can react to different events For example, a button can display a message when the user clicks it.
Disadvantages of Visual Programming
Some disadvantages of visual programming are as follows:
- Visual programming environments are heavy and require more memory.
- It requires a computer with higher capacity of hard disk.
- Visual programs need a computer with faster processor for executioners.
- Visual programming can be implemented only on graphical operating systems like Microsoft Windows.
Object-Oriented Languages
What are the fully object-oriented languages?
|
A type of high-level language in which a program is written on the basis of objects is called object oriented language. An object is a collection of data and functions. It may represent a person, thing or place in real world such as Student and Car. In OOP, data and all possible functions on data are grouped together. Object oriented programs are easier to learn and modify.
Features of Object-Oriented Programming
Some important features of object-oriented programming are as follows.
Objects
OOP provides the facility of programming based on objects. An object is an entity that consists of data and functions.
Classes
Classes are the designs that are used to create objects. OOP provides the facility to design classes to create different objects. The properties and functions of the objects are specified in classes.
Real-world Modeling
OOP is based on real-world modeling. The things in real world have properties and working capabilities. The objects in OOP have data and functions. Data represents properties and functions represent working of the objects.
Reusability
Information Hiding
Polymorphism
Important Object-Oriented Programming Languages
C++
C++ is an object-oriented language. It was developed in 1980 at Bell Laboratories. It is an improved version of C language. It provides the facility of working with objects and classes. It is very powerful language and is used to develop a variety of programs.
Java
Java was developed at Sun Microsystems in 1995 by a team led by James Gosling, Sun Microsystems was purchased by Oracle in 2010. Java is an object-oriented programming language based on the syntax of C++. It is commonly used to develop applications for servers, desktop computers and mobile devices.
C#
C# is pronounced It was developed by Microsoft in 2000. It is a simple and modern object-oriented programming language. Its syntax is similar to C++. It can be used for desktop software and Web development.
Non-Procedural Languages
Non-procedural languages are also known as fourth generation languages or 4GL. In non-procedural languages, the user only tells the computer "what to do" not "how to do An important advantage of non-procedural languages is that they can be used by non- technical users to perform specific tasks. These languages accelerate programming process and reduce coding errors 4GL are normally used in database applications and report generation.
Structured Query Language (SQL)
SQL stands for Structured Query Language It is the most popular database query language. It was developed by IBM It is a national standard by the American National Standards Institute (ANSI) SQL works with database programs like MS Access, DB2 Informix, MS SQL Server, Oracle, Sybase, etc
Report Program Generator (RPG)
RPG stands for Report Program Generator. It was developed in early 1960s by IBM. It is used to generate business reports. It is a nonprocedural language. It is mostly used with IBM mid-range computers.
Difference between Procedural & Non-procedural Languages
Procedural Languages/3GL |
Non-procedural Languages/4GL |
Procedural language tells the computer what to do and how to do. |
Non-procedural language tells the computer what to do, not how to do. |
It is difficult to learn. |
It is easy to learn. |
It is difficult to debug. |
It is easy to debug. |
It requires large number of procedural instructions. |
It requires a few non-procedural instructions. |
It is normally used by professional programmers. |
It can be used professional and non- technical users. |
It is typically file-oriented. |
It is typically database-oriented. |
Procedural language provides many programming capabilities. |
Non-procedural
language provides less programming capabilities. |
0 Comments