อ่านง่าย Readability
เขียนง่าย Writability
การทำงานตรวจสอบข้อผิดพลาด Reliability
Readability
"the most important criterium"
Factors:
Overall simplicity : พยายามทำอย่างไรก็ได้ให้ง่ายที่สุด
- Too many teatures is bad
- Multiplicity of features is bad e.g. increment an integer variable in c
- Operator overloading makes confusion
- Makes the language easy to learn and read
- Meaning is context independent
- e.g. pointer is able to point to any tpe of variable
- Lack of orthogonality leads to exceptions to the rules of the languages
Control statements
Poor readable control structure(e.g. using goto satement)
Data type and structures
Presence of adequate facilities for defining data types and ad structures in a language
e.g. Boolean type as indicator flag
Record(instead of Arrays)
Class(Abstract Data Type)
Systax considerations
- Identifier forms(FORTRAN 77 allows six charaters at most)
- Special words(Ada uses and if to terminate a selection control and end loop to terminate a loop construct->greater readability)
Writability
Simplicity and orthogonality : ง่ายสามารถทำ Overloading ได้
- Misuse of some features static keyword in Java,c++
- Unknown features usage causes bizarre results
- Too much orthogonality may produce undetecte errors(any combination of primitive is legal) score = 14 /3 * 2;
- Ability to define and use complicated structures or poerations regardless the details
- e.g. using a sub program to implement a search,sort algorithm
- e.g. count++ in C(Shorter and more convenient)
- Earlier errors detection,less expensive repair
- Compile-time Checking is preferred
- The ability of a program to intercept run-time errors,take corrective measures,and then continue
- e.g. Ada,C++ and Java
- Having two or more distinct referencing methods,or names,for the same memory cell
- e.g. Using reference in Java,pointer in C++
Cost
- Categories
- Programmer training(+simplicity+orthogonality+experience)
- Software creation(cost of writing program -> reduced in good IDE)
- Compilation(Fast)
- Execution(Fast)
- Compiler cost(For fee e.g. Java)
- Poor reliability(e.g. Critical system like nuclear power plant or X-ray machine if fail -> high cost of demange)
- Maintenance(corrections and modifications to add new capabilities)
- The ease of migrating from one implementation to another
- The applicability to a wide range of applications
- The completeness and precision of a language's official defining document
Language Categories
- Imperative
- Central features are variables,expression,assignment statement and iterative form of repetetive
No comments:
Post a Comment