Rabu, 01 Oktober 2014

Assignment From Chapter 1 Programming Language Concepts R.Sebesta

Part: Problem Set

14. Describe the advantages and disadvantages of some programming environment you have used.

C++ - Best suited for general purpose and low level programming.
Advantages: Extremely fast, works very well for GUI programming on a computer. Good language to write operating systems, drivers, and platform dependent applications with. Good language to learn to program with. Good language for engineers. 
Disadvantages: Although it is platform independent, it is mostly used for platform specific applications. A library set is usually chosen that locks you into a single platform or operating system. Overly complex for very large high level programs. Overly complex and difficult to debug when used for web applications. Marketable skills are low level programming, vendor software, and video games, making it difficult to find jobs unless you have are very advanced in a target area.

C# - new language to take advantage of C++ foundation and add new features.
Advantages: Can be used for web applications on Microsoft computers. Works well with the Microsoft product line. Marketable skill set.
Disadvantages: Almost completely locks you into the Microsoft Platform. New language, so not a great deal of published free code yet.

VB - Used mainly to modify and complement the Microsoft product line.
Advantages: Extremely easy to use, even for people who are not computer programmers. Allows the typical computer user to modify MS Office applications to suite their needs. Works very well on a Microsoft intranet to complement the network shares and permissions. Can be used for low level programming on Microsoft computers. A marketable skill set. Excellent for writing little programs and pieces of programs.
Disadvantages: Completely locks you into using the Microsoft product line. Not a true Object oriented language although it claims to be. VB .Net is an object oriented language. Becomes overly complex and difficult to manage on very large programs. 

15.  How do type declaration statements for simple variables affect the readability of a language, considering that some languages do not require them? 

 The use of type declaration statements for simple scalar variables may have very little effect on the readability of programs. If a language has no type declarations at all, it may be an aid to readability, because regardless of where a variable is seen in the program text, its type can be determined without looking elsewhere. Unfortunately, most languages that allow implicitly declared variables also include explicit declarations. In a program in such a language, the declaration of a variable must be found before the reader can determine the type of that variable when it is used in the program.

16. Write an evaluation of some programming language you know, using the criteria described in this chapter.

Readability :Java has some issues with simplicity with respect to readability. There is feature multiplicity in Java as shown in the textbook, example count=count + 1, count ++, count +=1 and ++count.
Control statements in Java have higher readibility than BASIC and Fortran because they can use more complex conditionals like for loops 

Writability :
Java has a fair bit of orthogonality in that its primitive constructs can be used in various different ways.

Reliability :
Java uses a type checker at compile time which virtually eliminate most of the type errors during run time.

17. Some programming languages—for example, Pascal—have used the semicolon to separate statements, while Java uses it to terminate state-ments. Which of these, in your opinion, is most natural and least likely to result in syntax errors? Support your answer.

I personally feel that Pascal's usage of the semicolon to separate statement is rather counterintuitive but possibly it's because I learned the usage of the semicolon to terminate statement in C before I learned Pascal. Java consistency is more intuitive than the sructure of Pascal, it's easier to remember not to put a semi colon after a right brace than it is to have watch out for not putting it after each statement.

18.  Many contemporary languages allow two kinds of comments: one in which delimiters are used on both ends (multiple line comments), and one in which a delimiter marks only the beginning of the comment (one line comments). Discuss the advantages and disadvantages of each of these with respect to our criteria.

The main disadvantage of using paired delimiters for comments is that it results in diminished reliability. It is easy to inadvertently leave off the final delimiter, which extends the comment to the end of the next comment, effectively removing code from the program. The advantage of paired delimiters is that you can comment out areas of a program. The disadvantage of using only beginning delimiters is that they must be repeated on every line of a block of comments. This can be tedious and therefore errorprone. The advantage is that you cannot make the mistake of forgetting the closing delimiter.

Tidak ada komentar:

Posting Komentar