Harmony Clean Flat Responsive WordPress Blog Theme

Assignment 1

Review Questions

6. In what language is most of UNIX written ?
    UNIX is most written in C language.

7. What is the disadvantage of having too many features in language?

    If a language has a large number of different constructs, some programmers might not be familiar with all of them. This situation can lead to a misuse of some features and a disuse of others that may be either more elegant or more efficient, or both, than those that are used. It may even be possible, as noted by Hoare (1973), to use unknown features accidentally, with bizarre results.

8. How can user-defined operator overloading harm the readability of a program?

    Because The compiler does not come to know how to make precision of this operator.

9. What is one example of a lack of orthogonality in the design of C?

    C has two kinds of structured data types, arrays and records (structs), records can be returned from functions but arrays cannot. 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. Parameters are passed by value, unless they are arrays, in which case they are, in effect, passed by reference (because the appearance of an array name without a subscript in a C program is interpreted to be the address of the array’s first element).

10. What language used orthogonality as a primary design criterion?

      Language that used orthogonality as a primary design criterion is ALGOL 68.


Problem Sets

6. What common programming language statement, in your opinion, is most detrimental to readability?
    poorly written, unordered, and undocumented programming language is the most commonly problem that another person will hard to follow and read.

7. 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. Many languages distinguish between uppercase and lowercase letters in user-defined names. What are the pros and cons of this design decision?
    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. Therefore we don't use user-defined operator.

9. Explain the different aspects of the cost of a programming language.
    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. What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
      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.