Programming Concepts
Essay by Maxi • July 6, 2012 • Essay • 457 Words (2 Pages) • 1,404 Views
Lecture 1: Reasons for Studying Concepts of Programming Languages
1. Increased the capacity to express ideas.
2. Improved background for choosing appropriate languages.
3. Increased ability to learn new languages.
4. Better understanding of the significance of implementation.
5. Overall advancement of computing.
Lecture 2: Programming Domains
Machine code is too difficult for us to read, understand and debug. Machine code is not portable between architectures. Different people and companies developed high-level programming languages. Different languages are either designed to or happen to meet different programming needs.
1. Scientific applications
-FORTRAN
2. Business applications
-COBOL
3. AI
-LISP, Scheme (& Prolog)
4. Systems programming
-C
5. Web programming
-Perl, PHP, Javascript
6. "General" purpose
-C++, Ada, Java
Lecture 3: Language Evaluation Criteria
Programming language qualities and evaluation criteria
* Readability
* Writability
* Reliability
* Cost
Lecture 3.1: Language Evaluation Criteria - Readability
* How much can non-author understand logic of code just by reading it?
* Is code clear and unambiguous to reader?
* These are often subjective, but sometimes is fairly obvious
* Examples of features that help readability:
Comments
Long identifier names
Named constants
Clearly understood control statements
Language orthogonality
* Simple features combine in a consistent way
* But it can go too far, as explained in the text about Algol 68
Readability example:
C++:
if (score <= 100)
if (score >= 90)
cout << "A" << endl;
else
cout << "A+";
Ada:
if (score <= 100) then
if (score >= 90)
put ("A");
end if;
else
put ("A+");
end if;
Orthogonality example:
Class declaration in Java allows programmer to create new type
Array declaration in Java can be of any Java type
So:
Now programmer can make arrays of primitive types, arrays of objects, arrays of arrays,
...
...