Friday, November 8, 2019

https://adhywiranatabinusian.wordpress.com/2013/03/04/concept-of-programming-languages-chapter-1-review-questions/



1. Why is it useful for a programmer to have some background in language design, even though he or she may never actually design a programming language?
By understanding the basic of language design, programmer can fully understood the concepts of the programming, so they can implement the concept to many other programming languages, since those concepts are used in common, such as control structures, error/exception handling, array/memory management. The basics are the most important part to establish something. This is also applicable in the programming development. Different languages, similar concept. It’s really useful for a programmer to be able to adapt to many programming languages.
2. How can knowledge of programming language characteristics benefit the whole computing community?
By knowing the characteristics of programming languages, it would make the learning of a new language is easier and get more people involved in a programming. Easier learning process and involving more people would resulted many new programming languages which are easier to understand and run things better.
3. What programming language has dominated scientific computing over the past 50 years?
Fotran (Formula Translator)
4. What programming language has dominated business applications over the past 50 years?
COBOL (Common Business-Oriented Language)
5. What programming language has dominated artificial intelligence overthe past 50 years?
LISP
6. In what language is most of UNIX written?
C, because it is relatively easy to port or move to different machines.
7. What is the disadvantage of having too many features in a language?
-When the features are not well-designed, it would be quite confusing to use
-The programmer don’t have a clue of how the features should be used or what is the purpose of the features
-Similar features with different names but works with similar purposes.
-Some of the features may be out of scope for the language, as this will increase memory requirements, and thin out performance efforts.
8. How can user-defined operator overloading harm the readability of a program?
User-defined operator can overloading harm the readability of a program because the built in operator has the precision and compiler knows all the precision between the operators, and it works on that precision. User can also create its own operator but the compiler does not come to know how to make precision of this operator. This will be the cause of the overloading harm.
9. What is one example of a lack of orthogonality in the design of C?
C language is inconsistent in its treatment of concepts and language structure,leading some exceptions to the rules of the language, for example, although C has two kinds of structured daya types which are arrays and structs, structs can be returned from functions but arrays not. A member of a structure can be any data type except void or a structure of the same type. An array element can be any data type except void or a function.
10. What language used orthogonality as a primary design criterion?
ALGOL 68
11.What primitive control statement is used to build more complicated control statements in languages that lack them?

The selection statement plus GOTO is used to build more complicated control statements such as FOR loop.


12. What construct of a programming language provides process abstraction?
subprogram which used to implement a sort algorithm that is required several times in a program.
13. What does it mean for a program to be reliable?
A program is said to be reliable if it performs to its specifications under all conditions.
14. Why is type checking the parameters of a subprogram important?
Type checking is an important factor in language reliability because it’s testing for type errors in a given program, either by the compiler or during the execution of a program. Type checking
the parameters of a subprogram would be necessary because a failure may lead to countless program errors.
15. What is aliasing?
Aliasing means having two or more distinct names that can be used to access the same memory cell.
16. What is exception handling?
Exception halding is the ability of a program to intercept run-time errors and other unusual conditions detectable by the program and take corrective measures then continue which is an obvious aid to reliability.
17. Why is readability important to writability?
Readability is important to writability because programs that are difficult to read will be difficult to be written or modified.
18. How is the cost of compilers for a given language related to the design of that language?
The cost of compilers for a given language is related to the design of it because a languange that requires many run-time type checks will prohibit fast code execution, regardless of the quality of the compiler.
19. What has been the strongest influences on programming language design over the past 50 years?
Von Neumann architecture
20. What is the name of the category of programming languages whose structure is dictated by the
von Neumann computer achitecture?
Imperative Language
21. What two programming language deficiencies were discovered as a result of the researh in software development in the 1970s?
Two programming language deficiencies were discovered as a result of the research in software development in the 1970s were called top-down design and stepwise refinement   
 Incompleteness of type checking and inadequacy of control statements (GOTO statements)  
22. What are the three fundamental features of an object oriented programming language?
Encapsulation, Inheritance, and Polymorphism
23. What language was the first to support the three fundamental features of object-oriented programming?
Smalltalk
24. What is the example of two language design criteria that are in direct conflict with each other?
Reliability and cost of execution
25. What are three general methods of implementing a programming language?
Compilation, Pure Interpretation, Hybrid Implementation.
26. Which produces faster program execution, a compiler or a pure interpreter?
Compiler
27. What role does the symbol table play in a compiler?
The compiler converts each user –defined line into a machine readable code then back to user readable language. The symbol table shows the process and how the user-defined code in translated to lexical and syntax analysis then is generated to semantics analysis and code generation. The Symbol table basically shows the load module, linking, and loading process.
28. What is the utility of byte code?
Byte code provides portability to any machine that has a byte code interpreter and an asspcoated run-time system.
29. What is a hybrid implementation system?
Hybrid implementation system is an implementation of a method which translate high-level language programs to an intermediate
language designed to allow easy interpretation.
30. What are the advantages of using Borland JBuilder?
Borland JBuilder provides an integrated compiler, editor, debugger, and file system for Java development,
where all four are accessed through a graphical interface.

No comments:

Post a Comment