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?
because understanding the basic makes it easier ti learn and adopt new languages. it also helps to design and develop more better software. programmer’s need to understand how their code will work to ensure it is fault tolerant and high performing.
2. How can knowledge of programming language characteristics benefit the whole computing community?
it will provide insight on what functionally that certain languages provide works well, and what doesn’t work well. this also will allow programmers design languages that contain the great characteristics of languages.
3. What programming language has dominated scientific computing over the past 50 years?
programming language that has dominated scientific computing over the past 50 years is Fortran. It is still used because the primary concern of scientific applications is efficiency.
4. What programming language has dominated business applications over the past 50 years?
programming language that has dominated business applications over the past 50 years is COBOL. COBOL is an acronym for Common Business-Oriented Language. this programming language is one of the oldest programming languages, primarily designed by Grace Hopper. Defining its primary domain in business, finance, and administrative systems for companies and governments.
5. What programming language has dominated artificial intelligence over the past 50 years?
Lisp (List Processing) is one of programming language with a long history and a distinctive, fully parenthesized polish prefix notation. this is the second oldest high level programming language in widespread and also has changed a great deal since its early days. it was originally created as a practical mathematical notation for computer programs, influenced by the notation of Alonzo Church’s lambda calculus. it quickly became the favored programming language for AI (artificial intelligence) research. Lisp pioneered tree data structures, automatic storage management, dynamic typing, and the self-hosting compiler.
6. In What language is most of UNIX written?
C
7. What is the disadvantage of having too many features in a language?
It tends to lead to knowing only a subset.
8. How can user-defined operator overloading harm the readability of a program?
If the operations are used in odd unintuitive ways.
9. What is one example of a lack of orthogonality as a primary design criterion?
C has 2 structured data types (arrays and structs) arrays can be returned from functions butstructs can’t.
10. What language used orthogonality as a primary design criterion?
Language that used orthogonality as a primary design criterion is ALGOL 68. The main aims and principles of design of ALGOL 68 :
1. Completeness and clarity of design
2. Orthogonal design
3. Security
4. Efficiency : Static mode checking, mode-independent parsing, Independent compilation, Loop optimization, representations – in minimal & larger character sets.
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?
Subprograms.
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?
because it can lead to lots of hard to debug errors.
15. What is aliasing?
Aliasing is two or more distinct names that can be used to access the same memory cell.
16. What is Exception Handling?
is the process of responding to the occurrence during computation, often changing the normal flow of program execution and provided by specialized programming language constructs or computer hardware mechanisms. it is able to intercept run-time errors or take corrective measures. Commonly, it is resolved by saving the current state of execution.
17. Why is readability important to writability?
Readability is important to writability because if programming language is difficult to read and understand then it can be difficult for a programmer to create new code that might need to interact or use other code.
18. How is the cost of compilers for a given language related to the design of that language?
Many run time checks will prohibit fast code execution. If optimization is used compiling will be slower but execution will be faster.
19. What have been the strongest influences on programming language design over the past 50 years?
The basic architecture of computers(von Neumann).
20. What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture?
Imperative languages
21. What two programming language deficiencies were discovered as a result of the research in software development in the 1970s?
Incompleteness of type checking and inadequacy of control statements
22. What are the three fundamental features of an object-oriented programming language?
Data abstraction,inheritance and dynamic (run-time) method.
23. What language was the first to support the three fundamental features of object-oriented programming?
Smalltalk.
24. What is an example of two language design criteria that are in direct conflict with each other?
Reliability and cost of execution
25. What are the three general methods of implementing a programming language?
Compilation,pure interpretation, hybrid implementation systems
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 symbol table serves as a database for the compilation process in a compiler.
28. What is the utility of byte code?
29. What is a hybrid implementation system?
hybrid implementation system is a method that is not as fast as compiled languages, they are faster than interpreted languages and compile faster than compiled languages. The source language statements are decoded only once.
30. What are the advantages of using Borland JBuilder?
the advantages are :
1. provides the usual drag and drop, wysiwyg ui designer
2. comes with a set of neat data-aware swing components for rapid database application development.
3. supports pluggable add in’s.
Problem Set
2. Who is said to be the first programmer in human history?
Augusta Ada Byron or more known as Ada Lovelace, was an English mathematician and worked on Charles Babbage’s early mechanical general-purpose computer, the Analytical Engine. Her notes on the engine include what is recognised as the first algorithm intended to be processed by machine so that she is often considered the world’s first computer programmer.
As a young adult, her mathematical talents led her to an ongoing working relationship and friendship with fellow British mathematician Charles Babbage, and in particular Babbage’s work on the analytical engine. Between 1842 and 1843, she translated an article by Italian military engineer Luigi Menabrea on the engine, which she supplemented with an elaborate set of notes of her own, simply called Notes. These notes contain what is considered the first computer program – that is, an algorithm encoded for processing by a machine. Lovelace’s notes are important in the early history of computers. She also developed a vision on the capability of computers to go beyond mere calculating or number-crunching while others, including Babbage himself, focused only on those capabilities
3. What are the disadvantages of multiple programming language?
multiple programming language gives the disadvantages such as there are so many syntax that programmer needs to know.
4. In what way do the languages for scientific applications differ from the languages for business applications?
language for scientific application is mainly used for calculation and computing formula. it relatively uses simple data structures such as arrays and matrices.But language for business application commonly used to produce report and store decimal and character. it is able to specify decimal arithmetic operations.
5. In what way do the languages for artificial intelligence differ from the languages for web software?
Language for artificial intelligence uses of symbolic computations. it means that symbols are manipulated and more coneniently done with linked lists of data rather than arrays. the developer defines knowledge to be used only.
Language for web software uses markup languages where this is a modern system for annotating a document in a way that is syntactically distinguishable from the text. this is also use scripting and general purpose. the developer is obliged to define all the ways the web could follow.
9. Explain how orthogonality in a programming language is closely related to simplicity.
orthogonality in a programming language is relatively a small set of primitive constructs that can be combined in a relatively small number of ways to build the control and data structures of the language. Orthogonality follows from a symmetry of relationships among primitives. With orthogonality, it could compress the size of large amount of primitive feature to fewer number of primitive feature.
14. Describe the advantages and disadvantages of using different computer architecture for writing a program.
the disadvantage of using different computer architecture is it could create an incompability between the program and computer architecture itself, it also brings to an error. The advantage of using different computer architecture is it will allow the programmer to build their own program compatible with different computer architectures they have had.
15. Name some languages which use preprocessor directives and some which don’t. What are the advantages and disadvantages of preprocessor directives?
C,C++, and C# use preprocessor directives, it brings some advantages such as :
1. reduces length of the code and time spent for writing the codes.
2. increases execution speed of the program.
3. increases readability and writability of the program.
but somehow there are still some disadvantages such as :
1. Increases size memory of the program.
2. macros can only return the last value processed.
3. Causes an error.
17. Some programming languages – for example, SQL – use “=” to check the equality of two expressions, while C uses it to assign values to variable. Which of these, in your opinion, is most natural and least likely to result in syntax errors?
The using of “=” to check the equality of two expressions in SQL is more natural than in C, because in C, we use “==” to check do the first expression equals to the second expression or not. We have learned this symbol to check the equality from the basic mathematics before so it will reduce the possibility of syntax errors in this things. However, it becomes difficult to assign values to variable because the symbol of “=” has been used so that the use of C symbols are easier than SQL. C language has specified “=” symbol to assign values to variable and “==” to comparing two expressions.