Friday, September 26, 2014

Chapter 1 Programming Language Concepts R Sebesta

Nama: Stefanus Eduard Adrian
NIM: 1801382963


Kali ini saya akan menjawab Assignment #1 dari Chapter 1 Programming Language Concepts R Sebesta



Review Questions

6. In what language is most of UNIX written ?

UNIX is mostly written in C.


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

The disadvantage of having too many features in a language is will make the users confused in choosing which feature to solve the problem and not all of the features will be used by the users.


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

User-defined operator overloading wil make an operator has more than one meaning. Maybe it can reduce the process needed but it will make the computer confused to read or compute our program because one operator can have more than one meaning so user-defined operator overloading can harm the readability of a program.


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

One example of a lack of orthogonality in the design of C is in structured data type (record and array). Record can be returned from function but array can’t be returned.


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

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




Problem Set

6. What common programming language statement, in your opinion, is most detrimental to readability ?

I’ve just learned one programming language, that is C. So far I can’t find any detrimental to readability in C.


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 this design is the ease and simplicity to mark the end of all compound statements. The mark is easy enough for us to remember. The argument against this design is sometimes the right brace can make us confused because we don’t know the matching left brace to the right brace we use to end of all compound statements. So sometimes we can have more or less either left or right braces.



8. Many languages distinguish between uppercase and lowercase letters in user-defined names. What are the pros and cons of this design decision ?


The pros of this design decision:

-It can make the program to read the code more precisely
-It can make the program code to be seen more easily
-It makes the languages looks more professional

The cons of this design decision:
-If we miswrite the uppercase or lowercase letters, it can make our code not running successfully
-It can make our program code somehow more complex



9. Explain the different aspects of the cost of a programming language.


a.  The cost to write programs in that language. If it’s hard to write programs in that language, it will increase the cost to write programs in that language.

b. The cost to train programmers to use the language. The harder the language is, the more cost needed to pay the trainer.
c. The cost for the language implementation system. A reliable interpreter system should be available after a language is released.
d. The cost to maintain the programs. It includes the cost to correct and modify the programs to fix bugs or add new functionality.



10. What are the arguments for writing efficient programs even though hardware is relatively inexpensive ?

We need to write effient programs even though hardware is relatively inexpensive because if we can write efficient programs, it will make our programs run better. It will not require high specification hardware to run that programs. Also if we can write efficient programs, it will make our programs work smoothly without any trouble because of the ineffectiveness of the program code.



Bonus Question

What is the difference between imperative language and procedural language ?

In imperative language, computation as statements will directly change a program state. It also defines sequences of commands for the computer to perform. An imperative language uses a sequence of statements to determine how to reach a certain goal. These statements are said to change the state of the program as each one is executed in turn. In procedural language (derived from structured programming), it’s based on the concept of modular programming or the procedure call. Procedural language, as the name implies, relies on predefined and well-organized procedures, functions or sub-routines in a program’s architecture by specifying all the steps that the computer must take to reach a desired state or output.