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
-
Bibliography: Johnson, R. A. (2007). An Introduction to Java Programming and Object-Oriented Appilcation Development. Boston: Bob Woodbury.…
- 480 Words
- 2 Pages
Satisfactory Essays -
What is used to translate high level language programs to machine language (or machine code)? Compiler…
- 738 Words
- 3 Pages
Good Essays -
Venit, S., & Drake, E. (2011). Prelude to Programming Concepts and Design (5th ed.). Boston, MA: Addison-Wesley.…
- 1800 Words
- 6 Pages
Better 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 -
Venit, S., & Drake, E. (2009). Prelude to programming: Concepts & design (4th ed.). Boston, MA: Addison-Wesley.…
- 890 Words
- 4 Pages
Better Essays -
The following information will introduce general knowledge in basic programming concepts. It shall discuss basic types of computer programming languages as-well-as program development. There are three basic types of computer programming languages that will be discussed in a simple and easy to understand manner. We shall also describe the program development cycle and discuss why it is important to use a structured and organized process to create a computer programming language.…
- 1318 Words
- 6 Pages
Powerful Essays -
Schneider, G.M. & Gersting, J.L., (2013). Invitation to Computer Science. (6th ed.). Boston, Ma: press…
- 2002 Words
- 9 Pages
Better Essays -
The earliest programming languages were procedural, meaning a program was made of one or more procedures. A procedure is simply a module or function that performs a specific task such as gathering input from the user, performing calculations, reading or writing files, displaying output, and so on. The programs that you have written so far have been procedural in nature. The steps a program must perform to reach the desired outcome. Procedure is an independent entity and a sequence of instructions that are grouped together. In procedural programming, a task is broken down into assortment of variables and subroutines. In OPP, a task is broken down into objects which summarize the data and execution. In a procedural approach, the entirely called variable is termed as a trait of the object. The idea is to encapsulate data and a…
- 511 Words
- 3 Pages
Good Essays -
References: Drake, E., & Venit, S. (2011). Prelude to programming: Concepts and design (5th ed.). Boston, MA: Addison-Wesley.…
- 739 Words
- 3 Pages
Good Essays -
|1.2 Demonstrate an understanding of the |Code listings show a variety of objects | |…
- 2281 Words
- 10 Pages
Powerful 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 -
References: Venit, S., & Drake, E. (2011). Prelude to Programming: Concepts and Design (5th ed.). Retrieved from The University of Phoenix eBook Collection database.…
- 880 Words
- 4 Pages
Good Essays -
Compilation: programs are translated into machine code which can directly execute on the computer. Compiler analyzes the whole code and generates the machine code which makes it very fast process. And due to this, compiled programs don’t require any second application or package to run it. The time takes to create a program from compilation is relatively faster than interpretation. As a disadvantage, compilation process is hardware specific into which machine it get compiled. Architecture of the computer affects…
- 1672 Words
- 7 Pages
Better Essays -
D.3.3 [Programming Languages]: Language Contructs and Features – abstract data types, polymorphism, control structures. This is just an example, please use the correct category and subject descriptors for your submission. The ACM Computing Classification Scheme: http://www.acm.org/class/1998/…
- 5662 Words
- 23 Pages
Powerful Essays -
I have learned many things from this class as it relates to computer programming. There are a few areas covered in this course by either the text or in our weekly class discussions about computers and computer programming that stood out to me. This paper is broken up into two discussions. The first part will cover general ideas and skills involved with computers and computer programming. The second part of my paper will go over some topics covered in the text for the class. Some areas that were discussed are as follows: Logic and Decision Structures, Using Repetition Structures, Checking user input for errors and lastly, Using Arrays for more Advanced Programs.…
- 1406 Words
- 6 Pages
Powerful Essays