nav

       HOME    BINUS EVENT   HOW TO   KBP   THOUGHTS

About



Sunday, September 28, 2014

Assignment #1

Source:
Concepts of Programming Languages, Robert W. Sebesta.
Chapter 1: Preliminaries, page 32-34

By:
Name : Helena Natanael
NIM  : 1801380333


Review Question:

6. In what language is most of UNIX written?  
The UNIX operating system is written almost entirely in C language.

7. What is the disadvantage of having too many features in a language?
If a language has a large number of different constructs, some programmers might not be familiar with all of them. This situation also can lead to a misuse of some features and a disuse of other language. It's also possible to use unknown features accidentally, with bizarre results.

8. How can user-defined operator overloading harm the readability of a
program?
Operator overloading itself is often useful, but if the users create their own user-defined operator overloading, it can harm readability if they do not do it sensibly. There are possible misconception for both the author and the program’s readers.

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), however 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?
ALGOL 68 is the most orthogonal programming language.


Problem Set:

6. What common programming language statement, in your opinion, is
most detrimental to readability?
In my opinion, the rarely-used statements is very detrimental to readability, and also poorly written variables (not taking uppercase and lowercase differently) would be the cause of bad readability.

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 a right brace always terminates statements and compound statements before it. I don't see any problem with this design, the logic in using the right brace to end statements and left brace to open statements is efficient. However for some users that are not familiar with this kind of language, might have difficulties in seeing which statements are ended by the right brace. 

The argument against this design is another language (for example Fortran) use "END" than right brace, to end any statements and compound statements. It looks more like human language so people will learn it easily and not being confused with thoughts "where is the left brace" and "where to put the right brace so this program will be terminated correctly".
 
8. Many languages distinguish between uppercase and lowercase letters in
user-defined names. What are the pros and cons of this design decision?
pros: 
by taking uppercase and lowercase differently, there would be more variables available to be used, for example, a and A will be looked by the compiler as different variable. This also would help user to avoid keywords/reserved words as variable accidentally that might cause error.

cons:
user has to be very thorough to write the variables, because if there's mistyping and caps lock, there will be an error.

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

There are several aspects of the cost of a programming language: 

1. There is the cost of training programmers to use the language, which is a function of the simplicity and orthogonality of the language and the experience of the programmers.

2. There is the cost of writing programs in the language. This is a function of the writability of the language, which depends in part on its closeness in purpose to the particular application.

3. There is the cost of compiling programs in the language. A major impediment to the early use of Ada was the prohibitively high cost of running the first-generation Ada compilers. This problem was diminished by the appearance of improved Ada compilers.

4. The cost of executing programs written in a language is greatly influenced by that language’s design. A language that requires many run-time type checks will prohibit fast code execution, regardless of the quality of the compiler. Although execution efficiency was the foremost concern in the design of early languages, it is now considered to be less important. 

5. The cost of the language implementation system. One of the factors that explains the rapid acceptance of Java is that free compiler/interpreter systems became available for it soon after its design was released. A language whose implementation system is either expensive or runs only on expensive hardware will have a much smaller chance of becoming widely used. 

6. There is the cost of poor reliability. If the software fails in a critical system, such as a nuclear power plant or an X-ray machine for medical use, the cost could be very high. The failures of noncritical systems can also be very expensive in terms of lost future business or lawsuits over defective software systems. 

7. The cost of maintaining programs, this is the final aspect of consideration, which includes both corrections and modifications to add new functionality. The cost of software maintenance depends on a number of language characteristics, primarily readability. 

Of all the contributors to language costs, three are most important: program development, maintenance, and reliability.

10. What are the arguments for writing efficient programs even though
hardware is relatively inexpensive?
In my opinion, inexpensive or expensive hardware shouldn't be a consideration when it comes to write efficient programs, because a good program is the one that runs effectively. Effectively means using the best of the hardware provided, such as using the best of memory provided, runs well, using space and storage as minimum as it takes (as long as it doesn't affect the program's performance). However, there's a difference between "inexpensive hardware" and "outdated hardware". Inexpensive doesn't always mean outdated, but outdated hardware are mostly inexpensive. Some programs may have it own specification of hardware to make sure that it will run at it best performance, and as far as I know these programs could run in an inexpensive hardware, but it will not run in an outdated hardware.


Bonus Question: 

What's the difference between "Imperative Language" and "Procedural Language"?

Programming languages nowadays are often categorized into four bins: imperative, functional, logic, and object oriented. For your information, Procedural Language is developed before those programming languages are developed, so imperative language and procedural language are in different state of programming paradigm.

Procedural programming is a list or set of instructions telling a computer what to do step by step and how to perform from the first code to the second code. Procedural programming languages include C, Go, Fortran, Pascal, and BASIC. 

In computer science terminology, imperative programming is a programming paradigm that describes computation in terms of statements that change a program state. In much the same way that imperative mood in natural languages expresses commands to take action, imperative programs define sequences of commands for the computer to perform.



Tuesday, September 23, 2014

Welcome



Simplicity is the ultimate sophistication.
- Leonardo Da Vinci


Quote dari Ilmuwan terkenal tersebut, cocok banget dengan saya. Saya itu orangnya paling gak mau ribet, sebisa mungkin yang ribet disimpelkan karena hidup udah susah, ngapain disusahin (hahaha). Tapi meski punya prinsip anti-ribet, saya justru masuk ke salah satu jurusan paling ribet di tahun 2014:  

TEKNIK INFORMATIKA

Trus ambil jurusan ini juga gak nanggung-nanggung, di:

BINA NUSANTARA UNIVERSITY

yang merupakan salah satu kampus paling unggul dalam jurusan Teknik Informatika. Aneh ya? Tapi jalan hidup saya yang membawa diri saya sampai menginjakkan kaki di kampus ini. Bermula dari ketertarikan sama HTML, lalu dapet basic PHP di SMA, punya mantan yang anak IT lalu keinginan menciptakan program untuk membantu pelajaran di SMA karena saya sempat kesulitan sama pelajaran SMA (belom sadar aja tuh saya, ternyata di kuliah pelajarannya lebih susah lagi).


Awalnya orang tua saya ga yakin saya ambil fakultas teknik. Orang tua saya malah ingin saya masuk jurusan lain. Pada akhirnya orang tua saya mengijinkan saya mengambil jurusan IT, maka dari itu saya ingin sekali bisa meraih IP yang bagus supaya menunjukkan ke orang tua saya bahwa saya tidak salah jurusan. Saya juga ingin perkuliahan di BINUS ini membawa peluang untuk berelasi dengan orang-orang sukses di masa depan, karena lingkungannya baik dan sistemnya juga baik, tidak seperti kampus ecek-ecek yang hanya bisa menjamin cepat lulus dan cepat kerja tanpa memikirkan kualitas lulusan. Karena kampus saya adalah world class university, semoga dengan begitu saya menjadi world class graduate nanti. Doakan saya ya!