Role Of Programming Language Attributes of a good

Role Of Programming Language

Attributes of a good Programming language �Clarity, simplicity, and unity �Have a minimum number of different concepts, with the rules for their combination being as simple and regular (conceptual integrity). �readability �Orthogonality �Being able to combine various features of a language in all possible combinations. �Naturalness for the application �The syntax of the language, when properly used, should reflect the logical structure of the algorithm 2 Principles of Programming Language-Module-1

Attributes of a good Programming language � Support for abstraction �Should allow data structures, data types and other operations to be maintained as self-contained abstractions. �The programmers use them in program knowing only the abstract properties, without concern for the details of implementation. � Ease of program verification �Proof of correctness, desk checking, test �Simplicity of semantic and syntax � Programming environment �Good programming environment makes it easier to work �Reliable, Efficient and well documented implementation of the language �Special editors, testing packages 3 Principles of Programming Language-Module-1

Attributes of a good Programming language �Programming environment �Good programming environment makes it easier to work �Reliable, Efficient and well documented implementation of the language �Special editors, testing packages �Portability of programs �Transportability of the resulting programs from the computer on which they are developed to other computer systems. 4 Principles of Programming Language-Module-1

Attributes of a good Programming language �Cost of use �Program execution �Important in case of large production programs that are executed repeatedly �Program translation �Fast and efficient compiler is important for a student program which is compiling many times and executing few times. �Program creation, testing, and use �Overall time and effort spend on computer should be less. �Program maintenance �Programs that are easily modifiable are less expensive 5 Principles of Programming Language-Module-1

Language paradigms �Imperative / procedural languages �Applicative / functional languages �Rule-based / declarative languages �Object-oriented languages 6 Principles of Programming Language-Module-1

Imperative / procedural languages • Statement oriented/command driven languages that change machine state • (C, Pascal, FORTRAN, COBOL) • Computation: a sequence of statements and the execution of statements causes the computer to change the value of one or more location of memory. • Syntax: S 1, S 2, S 3, . . . where S 1, S 2, … are statements 7 Principles of Programming Language-Module-1

Applicative / functional languages • Consists of building the function that computes the answer • Computation. Programming : Function composition is major operation (ML, LISP) • Syntax: fun 3(fun 2(fun 1(data))) 8 Principles of Programming Language-Module-1

Rule-based / declarative languages • Computation: Actions are specified by rules that check for the presence of certain enabling conditions. (Prolog) • The order of execution is determined by the enabling conditions, not by the order of the statements. • Syntax: Condition Action 9 Principles of Programming Language-Module-1

Object-oriented languages • Imperative languages that merge applicative design with imperative statements (Java, C++, Smalltalk) • Syntax: Set of objects (classes) containing data (imperative concepts) and methods (applicative concepts) 10 Principles of Programming Language-Module-1

Language standardization The need for standards - to increase portability of programs Problem: When to standardize a language? If too late - many incompatible versions If too early - no experience with language Problem: What happens with the software developed before the standardization? Ideally, new standards have to be with older standards. 11 Principles of Programming Language-Module-1 compatible

Internationalization • How to specify languages useful in a global economy? • What character codes to use? • Collating sequences? - How do you alphabetize various languages? position of non Roman characters • Dates? -What date is 10/12/01? 10 -12 -01? 12. 10. 01 ? Is it a date in October or December? 12 Principles of Programming Language-Module-1

Internationalization • Time? - How do you handle • time zones, • summer time in Europe, • daylight savings time in US, • Southern hemisphere is 6 months out of phase with northern hemisphere, • the date to change from summer to standard time is not consistent. 13 • Currency? - How to handle dollars, pounds, marks, Principles of Programming francs, euros, etc. Language-Module-1
- Slides: 13