Changes

Jump to navigation Jump to search
1,266 bytes added ,  18:51, March 3, 2012
expand classification
Line 19: Line 19:  
Various studies have found that programmers with a comparable amount of experience may differ in skill levels by a factor of 10 or more.
 
Various studies have found that programmers with a comparable amount of experience may differ in skill levels by a factor of 10 or more.
   −
==About programming languages==
+
==Classifying programming languages==
−
Some programming languages are general-purpose and some are specific to a particular problem domain.  However, programming languages evolve over time and usually become more general-purpose.  For instance, the [[BASIC programming language]] and the [[Pascal programming language]] were originally intended as teaching languages, for students of programming.  But both are now popular as general-purpose languages.  The features of most modern programming languages are similar, but the words and syntax differ.  For instance, the PRINT statement is used to output data in BASIC, whereas WRITELN is used for the same purpose in Pascal.  Even when the words and syntax are similar between two languages, often the meaning (semantics) is different.
+
The initial distinction is between '''low-level languages''' and '''high-level languages'''.
   −
==Distinguishing features==
+
Low-level languages are generally referred to as '''assembly''' languages. Most instructions in such languages equate directly to a single machine instruction. Each machine architecture has its own assembly language, so programs written in such languages are generally very machine-specific and are not portable. The instructions in such languages are usually fairly cryptic, often using abbreviations such as ADD, JNE, LR, LI, etc. In the early days of computing (up to about 1ate 1950's) most programming was done in assembly language, partly due to the limited power and memory capacity of early computers.
−
Programming languages can be divided into '''declarative''' and '''procedural''' languages. Declarative languages define information such as relationships and attributes. Prolog is an example of a declarative language.  Procedural languages define processes (algorithms) for the computer to follow.  C is an example of a procedural language.
     −
Languages can also be divided into '''low-level languages''' such as Assembly, and '''high-level languages''' such as [[Cobol|COBOL]]. Low-level languages are those where the program code interacts directly (or fairly directly), with the CPU, whereas high-level languages have a higher level of abstraction, leaving the compiler or interpreter to deal with issuing the appropriate commands to the CPU, and similar issues.  
+
High-level languages generally use a mixture of English words and simple mathematical notation, and are often available with little or no change on many different types of computers. These are often referred to as 3rd-generation languages (the 1st generation was raw binary machine code, the 2nd was assembly language). A single high-level statement may be equivalent to using 3 to 10 assembly language statements, so programming in a high-level language can be much more productive. Example statements include: 
 +
  X = 5 + Y*3
 +
  '''if''' result < 3 '''then''' stop
 +
  '''print''' "Hello world"
   −
The level of a language is a sliding scale, with some languages considered more high-level than others. Low-level langauges tend to require more steps to accomplish the same tasks than high-level languages. [[Assembly language]] is not '''a''' specific language, such as BASIC, but rather any of a group of languages that are each specific to a particular [[CPU]].
+
The two main types of high-level languages are '''imperative''' and '''declarative''', with the first type being far more common.
 +
 
 +
Declarative languages define relationships and facts, ask a question, and leave it to the underlying program implementation and its theorem prover to work out how to derive an answer. An example of such a language is Prolog (Programming in Logic). These languages can be effective in areas such as database analysis, symbolic mathematics, and language parsing.
 +
 
 +
When using an imperative language, the programmer is responsible for giving precise instructions as to exactly what has to be done and in what order. Note that some programs may have a random element included so that the results of a program are not necessarily predictable. One of the key reasons for the success of high-level languages is that they provide a level of abstraction (sometimes several such levels). which means that a programmer can concentrate more on the problem to be solved and less on the detail of how to solve it.
 +
 
 +
Early high-level programming languages were often intended for use in a particular problem domain (e.g. COBOL for business purposes, Fortran and Algol 60 for scientific calculations). Other programming languages were originally intended for teaching purposes (e.g. BASIC and Pascal). The language '''C''' was originally intended for systems programming (writing operating systems and compilers).
 +
 
 +
Successful programming languages evolve over time to become more general-purpose, or form the basis for other languages (e.g. '''C''' -> '''C++'''). The evolution often involves incorporating good features from other languages. The general trend is for languages to become more general-purpose and provide more levels of abstraction. The concepts of structured programming were put on a sound theoretical basis in the early 1970's and these have also influenced the evolution of some programming languages (e.g. Fortran 66 -> Fortran 77). The idea of objects (combining data with the applicable operations) was available in Simula in the mid 1960's, but did not become popular until the advent of C++ and Java; confusingly, Java and C++ have a lot of syntax in common, but the meaning (semantics) may differ drastically for what looks the same when written down.
    
Most, if not all, high-level languages support the following features: sub-routines (functions and procedures), variables, flow-control, data types, I/O, arithmetic operations, string operations, dynamic allocation (heaps), arrays, structures, constants, and literals.  Unique features of some languages will find their way into other languages if the feature is generally useful, or will remain unique to the language otherwise.  An example of a feature that has not received widespread acceptance is '''sets'''.
 
Most, if not all, high-level languages support the following features: sub-routines (functions and procedures), variables, flow-control, data types, I/O, arithmetic operations, string operations, dynamic allocation (heaps), arrays, structures, constants, and literals.  Unique features of some languages will find their way into other languages if the feature is generally useful, or will remain unique to the language otherwise.  An example of a feature that has not received widespread acceptance is '''sets'''.
−
  −
'''Objects''' are a means of encapsulating data and algorithms that operate on that data, with polymorphism.  Originally specified in Simula, objects became popular with the advent of C++.  Many languages which originally did not support objects have since acquired them.  For instance [[Visual BASIC]] is a version of BASIC supporting objects.  Likewise, [[Borland Delphi]] is a version of Pascal supporting objects.
      
==Implementation of programming lLanguages==
 
==Implementation of programming lLanguages==
SkipCaptcha
265

edits

Navigation menu