The high level programming languages are machine independent, which means they don’t rely on specifications of a particular machine. Brookshear (2012, p.242) indicate that "Since the statements in a third-generation language did not refer to the attributes of any particular machine, they could be compiled as easily for one machine as for another".
Since machines can understand and execute instructions written in machine language, then a program has to be machine-specific, although the program source code language may be machine-independent, but the compiler target specific machine output. Brookshear (p.243) "A program written in a third generation language could theoretically be used on any machine simply by applying the appropriate compiler".
The pros of compiling code into machine-specific output is to perform optimizations on the output for the target machine on which the program will run, such optimization won 't be doable if the program is compiled to run on unknown target machine.
Machine-independent language may offer optimization in their abstract concepts like structures, objects, loops and conditions, those are machine independent, but the most effective optimizations are those that best exploit special features of the target platform. E.g.: Instructions which do several things at once, such as decrement register and branch if not zero. Wikipedia(2013).
2- Four programming paradigms.
Imperative paradigm: is the traditional approach and also known as procedural paradigm. the process of programming is a procedure has one or more actions or commands executed in sequence. the commands or steps are derived by an algorithm in order to produce the desired result. it describes the details of HOW the results are to be obtained, in terms of the underlying machine model.
Functional paradigm: functional programming is to do computation by calling or applying functions. each function is an abstract of single or multiple expressions which can be evaluated. Brookshear (p.245) define how functional programming is constructed by having smaller units connected in order so that output of each unit is used as an input in another unit till the desired overall output is obtained. the functional paradigm is simple functions are nested together to build to build main one.
As per (Laird ,2009, p.17), The main ideas of functional programming are high-order and pure functions, recursion, evaluation of equations, and pattern matching.
Logic paradigm:
This paradigm logic based and is different from other main programming paradigms. It 's designed for Artificial intelligence to deal with problems that requires extraction of knowledge and training driven from facts and making use of rules and relations. Nørmark(2010) highlighted one of its characteristics in program execution becomes a systematic search in a set of facts, making use of a set of inference rules
Prolog language is one of the languages that uses logical paradigm. (Laird ,2009), In logic programming, set of facts and rules are analyzed in each step, referred as clauses. Prolog is the widely known language of logic programming.
Object Oriented paradigm:
Any top language is known by its support of object-oriented programming (OOP). it has gained great popularity in the recent decade. It has 3 main features:
Encapsulation: classes are types that are self-contained modules and an instance of the class is an object.
Inheritance: Classes could have relationships and organized in hierarchies, inheritance passes the structure and methods in one class down to child classes in the hierarchy.
Polymorphism: common types can be presented by using a uniform interface.
These features facilitates programming process when programs become larger and complex.
Brookshear (p.247) in OOP a software system is represented as a collection of objects,each object is capable of performing actions or requestion actions from others objects. These objects interacts with each other to work out the domain problem.
As per (Laird ,2009), All four of the main programming paradigms are useful in their own way, but pure programmg languages of only one paradigm are known to be slightly more limiting. Object-oriented design is currently the most versatile and widely used programming paradigm. 3- Machine language vs. assembly language
Assembly Language: is the first step in the evolution of programming languages. (Rajaraman
, 1998) "In an assembly language, mnemonics are used to represent operations to be performed by the computer and strings of characters to represent addresses of locations in the computer’s memory".
There 're one-to-one correspondence between assembly statement and machine code instructions. Thus, assembly language is machine dependent as it 's matched to a particular processor structure.
A program written in assembly language has to be translated by an assembler to set of machine code/instructions, thus it can be executed by computer. a disassembler performs reverse function.
Machine language: called machine or native code, is the lowest level representation of program. every program is made of a series of instructions executed directly by CPU. Machine language is set of instructions executed directly by CPU. every task has one or more specific instructions. Wikipedia(2013).
"Unfortunately, writing programs in a machine language is a tedious task that often leads to errors that must be located and corrected (a process known as debugging) before the job is finished." Brookshear (p.240).
Although assembly language is low-level language, but is higher level than machine code. It 's more logical and human readable than machine code.
4- Operator precedence means each operation such as (+ - * /) have precedence over others. as per Brookshear (p.255), multiplication and division are performed before addition and subtraction.
Using parentheses to evaluate each operation separately will help to override the operator precedence in languages
Following this convention, 6 + 2 * 3 = 12.
References:
Brookshear, J. G. (2012) ' Programming Languages ' in computer science: AN OVERVIEW. 11th Edition. Massachusetts: Addison- Wesley. pp.240-55. (Accessed: 24 April 2013)
Laird, A. (2009) 'Survey of Programming Languages ' Ohio: Cedarville University. pp.17. (Accessed: 24 April 2013)
Nørmark, K. (2010) Overview of the four main programming paradigms [Online] Denmark: Aalborg University. http://people.cs.aau.dk/~normark/prog3-03/html/notes/paradigms_themes-paradigm-overview-section.html (Accessed: 24 April 2013)
Rajaraman, V. (1998) 'Programming Languages: A Brief Review ', RESONANCE, pp.44. (Accessed: 24 April 2013)
Wikipedia. (2013) Machine code [Online] Wikipedia. http://en.wikipedia.org/wiki/Machine_code (Accessed: 24 April 2013)
Wikipedia. (2013) Optimizing compiler [Online] Wikipedia. http://en.wikipedia.org/wiki/Optimizing_compiler (Accessed: 24 April 2013)
References: Brookshear, J. G. (2012) ' Programming Languages ' in computer science: AN OVERVIEW. 11th Edition. Massachusetts: Addison- Wesley. pp.240-55. (Accessed: 24 April 2013) Laird, A. (2009) 'Survey of Programming Languages ' Ohio: Cedarville University. pp.17. (Accessed: 24 April 2013) Nørmark, K. (2010) Overview of the four main programming paradigms [Online] Denmark: Aalborg University. http://people.cs.aau.dk/~normark/prog3-03/html/notes/paradigms_themes-paradigm-overview-section.html (Accessed: 24 April 2013) Rajaraman, V. (1998) 'Programming Languages: A Brief Review ', RESONANCE, pp.44. (Accessed: 24 April 2013) Wikipedia. (2013) Machine code [Online] Wikipedia. http://en.wikipedia.org/wiki/Machine_code (Accessed: 24 April 2013) Wikipedia. (2013) Optimizing compiler [Online] Wikipedia. http://en.wikipedia.org/wiki/Optimizing_compiler (Accessed: 24 April 2013)
You May Also Find These Documents Helpful
-
Venit, S., & Drake, E. (2011). Prelude to Programming Concepts and Design (5th ed.). Boston, MA: Addison-Wesley.…
- 1800 Words
- 6 Pages
Better Essays -
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 Chapter 24 Chapter 25 Chapter 26 Chapter 27 An Introduction to Hardware, Software, and the Internet An Introduction to Software Development Objects and Classes Algorithms Java Syntax and Style Data Types, Variables, and Arithmetic Boolean Expressions and if-else Statements Iterative Statements: while, for, do–while Implementing Classes and Using Objects Strings Class Hierarchies and Interfaces Arrays…
- 3908 Words
- 16 Pages
Powerful Essays -
What is used to translate high level language programs to machine language (or machine code)? Compiler…
- 738 Words
- 3 Pages
Good Essays -
Explain what is meant by a modular approach to programming. Why is this approach important?…
- 503 Words
- 3 Pages
Satisfactory Essays -
Explain what is meant by a modular approach to programming. Why is this approach important?…
- 503 Words
- 3 Pages
Satisfactory Essays -
This lab accompanies Chapter 5 (pp. 163-183 and pp. 196-201) of Starting Out with Programming Logic & Design.…
- 1242 Words
- 7 Pages
Satisfactory Essays -
This lab accompanies Chapter 2 (pp. 56-68) of Starting Out with Programming Logic & Design.…
- 1264 Words
- 7 Pages
Satisfactory Essays -
|1.2 Demonstrate an understanding of the |Code listings show a variety of objects | |…
- 2281 Words
- 10 Pages
Powerful Essays -
Venit, S., & Drake, E. (2011). Prelude to programming: Concepts and design (5th ed.). Boston, MA: Addison-Wesley.…
- 2760 Words
- 12 Pages
Powerful Essays -
Deitel, H.M., & Deitel, P.J. (2002). Java: How to program (6th ed.). Upper Saddle River, NJ: Pearson…
- 253 Words
- 2 Pages
Satisfactory Essays -
© 2012 Pearson Education, Inc. All rights reserved. Chapter 1: Introduction to Computers and Java Starting Out with Java: From Control Structures through Data Structures Second Edition by Tony Gaddis and Godfrey Muganda Chapter Topics Chapter 1 discusses the following main topics: – Introduction – Why Program? – Computer Systems: Hardware and Software – Programming Languages – What Is a Program Made Of? – The Programming Process –…
- 2953 Words
- 29 Pages
Satisfactory Essays -
Drake, E., & Venit, S. (2011). Prelude to programming: Concepts and design (5th ed.). Boston, MA: AddisonWesley.…
- 1379 Words
- 6 Pages
Satisfactory Essays -
Venit, S., & Drake, E. (2009). Prelude to programming: Concepts & design (4th ed.). Boston, MA: Addison-Wesley.…
- 890 Words
- 4 Pages
Better Essays -
Course Description This course provides students with a basic understanding of programming practices. Concepts covered include flowcharting, pseudocode methodologies, and an understanding of programming practices. Students will learn how these concepts, when properly applied, improve program design. Policies Faculty and students/learners will be held responsible for understanding and adhering to all policies contained within the following two documents: • • University policies: You must be logged into the student website to view this document. Instructor policies: This document is posted in the Course Materials forum.…
- 2333 Words
- 10 Pages
Good Essays -
Submit complete answers to the following end-of-chapter Review Questions [RQ] from the Digital Planet: Tomorrow's Technology and You textbook.…
- 340 Words
- 2 Pages
Satisfactory Essays