Vous êtes sur la page 1sur 12

Visual Programming Environment

Procedure and Event- oriented Languages


Besides low-level and high-level languages, computer languages can be classified as procedure-oriented or event-oriented. Procedure-oriented languages tend to run without human interference or without taking some action by the user. Event-oriented languages are different from Procedure-oriented languages because they depend on the user.

Procedure and Event- oriented Languages


In Procedure-oriented languages a computer program is executed by a simple run instruction, and usually runs from top to bottom, with all the code executed until the program ends. Event-oriented languages wait for the user to take some action before they execute. The program waits for an event (or happening) to occur before beginning a program execution.

Procedure and Event- oriented Languages


Prior to 1990, most commercial high-level languages were procedure-oriented languages. The emphasis in writing a computer program was to identify a set of processing tasks and to describe the steps important to each task. Collectively, the set of tasks represented a procedure: a listing of a set of tasks required to perform an activity.

Procedure and Event- oriented Languages


As an example, consider the procedure required in processing an employees pay check, in which the steps of the procedure are expressed as tasks:
Get employee name. Get hours worked. Get hourly wage. Multiply hours worked by the hourly wage to compute gross pay. Compute taxes based on gross pay. Subtract taxes and other deduction (such as union dues) from gross pay to compute net pay. Print the employees check.

Procedure and Event- oriented Languages


Event-oriented languages became possible with the advent of the Macintosh operating system for Apple Macintosh computers and Microsoft Windows for MS-DOS computer systems. Both environments were designed to bring hardware and software together into a standard user interface by employing a graphical user interface (GUI).

Procedure and Event- oriented Languages


An event-oriented language implies that an application (the computer program) waits for an event to occur before taking any action. What is an event? It might be the press of a key on the keyboard or the click of a mouse button. With these events (there are many types), the computer waits for a key press or a mouse click.

Difference b/w Procedure and Eventoriented Languages


In the event driven programming language we can directly interact with user interface by making use of mouse or any other means of controls. But in procedural programs you cannot interact with user interface through any of the control. you can only interact through codes.

Difference Contd.
Events are caused by actions the user performs. For example, clicking the mouse generates a mouse event, pressing a key on the keyboard generates a keyboard event, and so on. In procedural-driven or top-down architectures, the application executes a set of instructions in a specified sequence to perform a task. The structure and sequence of the program of a procedural-driven application control the execution order , not the user actions.

Difference Contd.
In an event-driven program, the program first waits for events to occur, responds to those events, then returns to wait for the next event.
The program response depends on the code written for that specific event. The order in which an event-driven program executes depends on which events occur and on the order in which those events occur. While the program waits for the next event, it frees up CPU resources that might be used to perform other processing tasks.

In Procedure-oriented languages the program execution begins in main and then flows through method calls and control statements in a fairly predictable manner.

Difference Contd.
Procedural: Monolithic programs that run from start to finish with no intervention from user other than input. E.g.
Basic, QBasic COBOL FORTRAN C

Difference Contd.
Event oriented: Programs that use objects which respond to events; use small segments to code for each object
Visual Basic Visual C++

Vous aimerez peut-être aussi