Homework 2

Topics: Programming language, Computer programming, C++ Pages: 7 (1897 words) Published: June 19, 2013
Homework 2
1. What common programming language statement, in your opinion, is most detrimental to readability and why do you think that?

The go to statement in my opinion can be the most detrimental to program readability, because it makes it difficult to keep track of where the program has been and will go during debugging. Extensive use of go to statements make it difficult to impossible to keep the program code in a top down format.

2. How does the distinguishing between upper- and lowercase in identifiers affect the three criteria?

The affect to readability can be positive when it is used in conjunction with a cohesive programming technique. The use of upper case letters to help certain types of identifiers stand out in the code can be highly beneficial.

The affect on writability will be positive because the readability of a program helps to improve the writability.

The affect on reliability will also be positive because the more readable, and writable a language then there is a positive affect on the reliability.

3. How do type declaration statements for simple variables affect the readability of a language?

Having type declarations that are easy to understand are very important to the readability of a programming language. When the type declarations are cryptic or easily confused it degrades the readability because it is not as easy to identify the variable type or distinguish between them.

4. Write an evaluation of Java and of C++, using the criteria described in this chapter. Please be thorough and provide a reason/justification for your evaluation.

C++

Readability:

C++ is not an overall simple language which complicates its readability. It does however have very good control structures and data type structures which can help the readability. But in general it can be difficult to read.

Writability:

C++ allows for high levels of data abstraction, and expressivity’s in the language allowing the programmer to create a myriad of structures to solve different programming problems making it very writable.

Reliability:

C++ has extensive exception handling and type checking capabilities, which lead to a more reliable language.

Java

Readability:

Java because it is a functional programming language, which is structured completely differently than all other common programming languages. All of the computations in Java are carried out by applying functions to arguments. Java does not have the assignment statements or variables common in other languages. Alone this causes enough of a problem with the readability of Java, but the syntax for Java is doubly ambiguous because the same exact syntax is used for both data and function calls.

Writability:

Java has a high amount of expressivity’s with the use of functions, but the difficulties that can be encountered in readability will affect the writability of the language.

Reliability:

Java does not have the extensive exception handling of C++.

5. Evaluate both Java and C++ with respect to the ultimate total cost (as discussed in Chapter 1 of the Sebesta text). Again, please be thorough and provide a reason/justification for your evaluation.

The total cost of C++ is acceptable. C++ is a very complex language that for a programmer to learn completely can take well over a year, but a programmer can learn enough to make powerful programs in a relatively short time. The style constructs of C++ help to improve it’s maintainability over time which is a major component to the cost of software development.

The total cost of Java is potentially more than that of C++. The functional programming environment is sufficiently different from all other imperative languages that training for programmers to...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Essay about Homework-"Such a Frustration"
  • Homework Ban Essay
  • No More Homework Essay
  • arguments for homework Essay
  • Essay about Chapter 2 Study Habits
  • spanish 2 Essay
  • Homework: harmful or helpful Research Paper
  • Athletes Too Tired For Homework Essay

Become a StudyMode Member

Sign Up - It's Free