Name : Vina Melinda
NIM : 1801380106
NIM : 1801380106
Untuk kali ini saya akan menjawab Assignment #2 Problem Set dari Chapter 1 Introduction dari Sebesta.
Q&A session:
6. Q: What common programming language statement, in your opinion, is most detrimental to readability?
A: Poorly written, unordered, and undocumented programming language is the most commonly problem that another person will hard to follow and read.
6. Q: What common programming language statement, in your opinion, is most detrimental to readability?
A: Poorly written, unordered, and undocumented programming language is the most commonly problem that another person will hard to follow and read.
7. Q: Java uses a right brace to mark the end of all compound statements. What are the arguments for and against this design?
A: Java uses a right brace to mark the end of all compound statements. What are the arguments for and against this design The argument for using the right brace to close all compounds is simplicity a right brace always terminates a compound. The argument against it is that when you see a right brace in a program the location of its matching left brace is not always obvious in part because all multiple-statement control constructs end with a right brace.
A: Java uses a right brace to mark the end of all compound statements. What are the arguments for and against this design The argument for using the right brace to close all compounds is simplicity a right brace always terminates a compound. The argument against it is that when you see a right brace in a program the location of its matching left brace is not always obvious in part because all multiple-statement control constructs end with a right brace.
8. Q: Many languages distinguish between uppercase and lowercase letters in user-defined names. What are the pros and cons of this design decision?
A: The reasons why a language would distinguish between uppercase and lowercase in its identifiers are:
(1) So that variable identifiers may look different than identifiers that are names for constants, such as the convention of using uppercase for constant names and using lowercase for variable names in C.
(2) So that catenated words as names can have their first letter distinguished, as in TotalWords. (Some think it is better to include a connector, such as underscore.) The primary reason why a language would not distinguish between uppercase and lowercase in identifiers is it makes programs less readable, because words that look very similar are actually completely different, such as SUM and Sum.
A: The reasons why a language would distinguish between uppercase and lowercase in its identifiers are:
(1) So that variable identifiers may look different than identifiers that are names for constants, such as the convention of using uppercase for constant names and using lowercase for variable names in C.
(2) So that catenated words as names can have their first letter distinguished, as in TotalWords. (Some think it is better to include a connector, such as underscore.) The primary reason why a language would not distinguish between uppercase and lowercase in identifiers is it makes programs less readable, because words that look very similar are actually completely different, such as SUM and Sum.
9. Q: Explain the different aspects of the cost of a programming language.
A: There are 2 aspects of the cost of a programming language. Such as, first, the cost of testing/running the program. Second, the cost of maintaining and documenting the program.
A: There are 2 aspects of the cost of a programming language. Such as, first, the cost of testing/running the program. Second, the cost of maintaining and documenting the program.
10. Q: What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
A: One of the main arguments is that regardless of the cost of hardware, it is not free. Why write a program that executes slower than is necessary. Furthermore, the difference between a well-written efficient program and one that is poorly written can be a factor of two or three. In many other fields of endeavor, the difference between a good job and a poor job may be 10 or 20 percent. In programming, the difference is much greater.
A: One of the main arguments is that regardless of the cost of hardware, it is not free. Why write a program that executes slower than is necessary. Furthermore, the difference between a well-written efficient program and one that is poorly written can be a factor of two or three. In many other fields of endeavor, the difference between a good job and a poor job may be 10 or 20 percent. In programming, the difference is much greater.