Full Transcript

New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: co...

New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] Week 4 GENERATIONS OF PROGRAMMING LANGUAGE AND ITS PARADIGM This module will discuss the generation of programming language and explain the different programming paradigm. Learning Outcomes: At the end of the learning content, the learner should be able to: 1. Identify the generations of Programming Language; 2. Describe the different Programming Language Paradigm; 3. Understand the functions of Programming Language Paradigm. GENERATIONS OF PROGRAMMING LANGUAGE Programming languages have been developed over the year in a phased manner. Each phase of developed has made the programming language more user-friendly, easier to use and more powerful. Each phase of improved made in the development of the programming languages can be referred to as a generation. The programming language in terms of their performance reliability and robustness can be grouped into five different generations: 1. First generation languages (1GL) 2. Second generation languages (2GL) 3. Third generation languages (3GL) 4. Fourth generation languages (4GL) 5. Fifth generation languages (5GL) 1. First Generation Language (Machine language) The first generation programming language is also called low-level programming language because they were used to program the computer system at a very low level of New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] abstraction. i.e. at the machine level. In the machine language, a programmer only deals with a binary number. Advantages of first generation language They are translation free and can be directly executed by the computers. The programs written in these languages are executed very speedily and efficiently by the CPU of the computer system. 2. Second Generation language (Assembly Language) The second generation programming language also belongs to the category of low- levelprogramming language. The second generation language comprises assembly languages that use the concept of mnemonics for the writing program. In the assembly language, symbolic names are used to represent the opcode and the operand part of the instruction. Advantage of second generation language It is easy to develop understand and modify the program developed in these languages are compared to those developed in the first generation programming language. 3. Third Generation languages (High-Level Languages) The third generation programming languages were designed to overcome the various limitations of the first and second generation programming languages. The languages of the third and later generation are considered as a high-level language because they enable the programmer to concentrate only on the logic of the programs without considering the internal architecture of the computer system. Advantages of third generation programming language It is easy to develop, learn and understand the program. New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] As the program written in these languages are less prone to errors, they are easy to maintain. Examples: FORTRAN, ALGOL, COBOL, C++, C 4. Fourth generation language (Very High-level Languages) The languages of this generation were considered as very high-level programming languages required a lot of time and effort that affected the productivity of a programmer. The fourth generation programming languages were designed and developed to reduce the time, cost and effort needed to develop different types of software applications. Advantages of fourth generation languages These programming languages allow the efficient use of data by implementing the various database. They require less time, cost and effort to develop different types of software applications. Examples: SOL, CSS, coldfusion 5. Fifth generation language (Artificial Intelligence Language) The programming languages of this generation mainly focus on constraint programming. The major fields in which the fifth generation programming language are employed are Artificial Intelligence and Artificial Neural Networks Advantage of fifth generation languages In this generation of language, the user can communicate with the computer system in a simple and an easy manner. Examples: mercury, prolog, OPS New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] PROGRAMMING LANGUAGE PARADIGMS Paradigm can also be termed as method to solve some problem or do some task. Programming paradigm is an approach to solve problem using some programming language; also it is a method to solve a problem using tools and techniques that are available to us following some approach. There are lots for programming language that are known but all of them need to follow some strategy when they are implemented and this methodology/strategy is called paradigm. Imperative Programming Paradigm It is one of the oldest programming paradigm. It features close relation to machine architecture. o It is based on Von Neumann architecture. o It works by changing the program state through assignment statements. o It performs step by step task by changing state. The main focus is on how to achieve the goal. The paradigm consists of several statements and after execution of all the result is stored. New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] Advantages: 1. Very simple to implement 2. It contains loops, variables etc. Disadvantages: 1. Complex problem cannot be solved 2. Less efficient and less productive 3. Parallel programming is not possible Examples of Imperative programming paradigm: C : developed by Dennis Ritchie and Ken Thompson Fortan : developed by John Backus for IBM Basic : developed by John G Kemeny and Thomas E Kurtz Imperative programming is divided into three broad categories: Procedural, OOP and parallel processing. These paradigms are as follows: A. Procedural programming paradigm – This paradigm emphasizes on procedure in terms of under lying machine model. There is no difference in between procedural and imperative approach. It has the ability to reuse the code and it was boon at that time when it was in use because of its reusability. Examples of Procedural programming paradigm: C : developed by Dennis Ritchie and Ken Thompson C++ : developed by Bjarne Stroustrup Java : developed by James Gosling at Sun Microsystems ColdFusion : developed by J J Allaire New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] Pascal : developed by Niklaus Wirth B. Object oriented programming – The program is written as a collection of classes and object which are meant for communication. The smallest and basic entity is object and all kind of computation is performed on the objects only. More emphasis is on data rather procedure. It can handle almost all kind of real life problems which are today in scenario. Advantages: Data security Inheritance Code reusability Flexible and abstraction is also present Examples of Object Oriented programming paradigm: Simula : first OOP language Java : developed by James Gosling at Sun Microsystems C++ : developed by Bjarne Stroustrup Objective-C : designed by Brad Cox Visual Basic.NET : developed by Microsoft Python : developed by Guido van Rossum Ruby : developed by Yukihiro Matsumoto Smalltalk : developed by Alan Kay, Dan Ingalls, Adele Goldberg C. Parallel processing approach – Parallel processing is the processing of program instructions by dividing them among multiple processors. A parallel processing system poses many numbers of processor with the objective of running a program in less time by New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] dividing them. This approach seems to be like divide and conquer. Examples are NESL (one of the oldest one) and C/C++ also supports because of some library function. DECLARATIVE PROGRAMMING PARADIGM It is divided as Logic, Functional, and Database. In computer science the declarative programming is a style of building programs that expresses logic of computation without talking about its control flow. It often considers programs as theories of some logic. It may simplify writing parallel programs. The focus is on what needs to be done rather how it should be done basically emphasizes on what code is actually doing. It just declares the result we want rather how it has be produced. This is the only difference between imperative (how to do) and declarative (what to do) programming paradigms. Getting into deeper we would see logic, functional and database. A. Logic programming paradigms – It can be termed as abstract model of computation. It would solve logical problems like puzzles, series etc. In logic programming we have a knowledge base which we know before and along with the question and knowledge base which is given to machine, it produces result. In normal programming languages, such concept of knowledge base is not available but while using the concept of artificial intelligence, machine learning we have some models like Perception model which is using the same mechanism. In logical programming the main emphasize is on knowledge base and the problem. The execution of the program is very much like proof of mathematical statement, e.g., Prolog B. Functional programming paradigms – The functional programming paradigms has its roots in mathematics and it is language independent. The key principal of this paradigms is the execution of series of mathematical functions. The central model for the abstraction is the function which is meant for some specific computation and not the data structure. Data are loosely coupled to functions. The function hide their implementation. Function can be replaced with their values without changing the meaning of the program. Some of the languages like Perl, Javascript mostly uses this paradigm. New Era University College of Computer Studies Rm. 247-B, High School Annex B, New Era University Tel. No.: (+632) 981-4221 loc 3825 E-mail: [email protected] Examples of Functional programming paradigm: JavaScript : developed by Brendan Eich Haskwell : developed by Lennart Augustsson, Dave Barton Scala : developed by Martin Odersky Erlang : developed by Joe Armstrong, Robert Virding Lisp : developed by John Mccarthy ML : developed by Robin Milner Clojure : developed by Rich Hickey C. Database/Data driven programming approach – This programming methodology is based on data and its movement. Program statements are defined by data rather than hard-coding a series of steps. A database program is the heart of a business information system and provides file creation, data entry, update, query and reporting functions. There are several programming languages that are developed mostly for database application. For example, SQL. It is applied to streams of structured data, for filtering, transforming, aggregating (such as computing statistics), or calling other programs. So it has its own wide application. References: Wempen, Faithe, Hattersly, Rosie, Millet, Richard and Shoup, Kate. (2015). Computing Fundaments: Introduction to Computers. John Wiley and Sons Inc. https://ecomputernotes.com/fundamental/introduction-to-computer/computer- components https://www.ictlounge.com/html/computercomponents.htm https://www.tutorialspoint.com/computer_fundamentals/computer_components.htm

Use Quizgecko on...
Browser
Browser