.

Monday, January 14, 2019

Computer programming Essay

1. What harsh computer computer programmeing spoken communication statement, in your opinion, is most detrimental to legibility and why do you think that?The go to statement in my opinion plenty be the most detrimental to program readability, beca implement it makes it demanding 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 sack down format.2. How does the distinguishing between upper- and lowercase in identifiers mend the three criteria?The affect to readability toilet be supreme when it is used in confederacy with a cohesive programming technique. The use of upper case garner to jockstrap certain types of identifiers stand extinct in the code merchantman be highly beneficial.The affect on writability will be positive because the readability of a program helps to break the writability.The affect on dependableness will in addition be positive b ecause the more readable, and writable a talking to then there is a positive affect on the reliability.3. How do type declaration statements for simple inconstants affect the readability of a language?Having type declarations that are easy to understand are truly all-important(a) to the readability of a programming language. When the type declarations are cryptic or easily confused it degrades the readability because it is non 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 movement/justification for your evaluation.C++ readabilityC++ is not an overall simple language which complicates its readability. It does however prevail really good control structures and info type structures which can help the readability. But in general it can be difficult to read.WritabilityC++ allows for high levels of data abstraction, and expressivitys in t he language allowing the coder to cloudless a myriad of structures to solve different programming problems making it very writable.ReliabilityC++ has extensive exception handling and type checking capabilities, which three to a more reliable language.JavaReadabilityJava because it is a operational programming language, which is structured completely differently than all new(prenominal) 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(a) languages. Alone this causes enough of a problem with the readability of Java, but the syntax for Java is doubly ambiguous because the same pick out syntax is used for two data and function calls.WritabilityJava has a high amount of expressivitys with the use of functions, but the difficulties that can be encountered in readability will affect the writability of the language.ReliabilityJava does not have the extensive exception handling of C++.5. Evaluate both Java and C++ with respect to the ultimate total live (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 its maintainability over time which is a major component to the cost of package development.The total cost of Java is potentially more than that of C++. The functional programming environment is sufficiently different from all other unequivocal languages that training for programmers to learn and become proficient in Java can take longer. Also the syntax similarities with data will make tending costs for Java programs to be higher because of their poor readability.Readability. Requiring the declaration of variables forces the programmer to document his/her expectations regarding variable names, data types, and scope (the region of the program where the variable will be applicable). Thus, the program becomes much more readable to the programmer and to others.Writability. Requiring the declaration of variables may actually decrease writability in its most reckon sense, since a programmer cannot simply use variables as needed, but mustiness write declarations in their appropriate places to avoid error messages. This increased perfume on the programmer can increase programming time. On the other hand, without declarations there can be no topical anaesthetic variables, and the use of local variables can increase writability by allowing the programmer to reuse names without perturbing more or less non-local references. Forcing the programmer to plan the use of variables may also improve writability over the long run.Efficiency. As we saw, readability an d writability can be viewed as efficiency issues from the point of view of maintenance and software engineering, so the comments about those issues also apply here in that sense. The use of declarations may also permit more efficient implementation of the program. Without declarations, if no assumptions are do about the sizing of variables, less efficient access mechanisms using pointers must be used. Also, the programmer can use declarations to specify the exact size of variable needed (such as short int or long int). constraining scope by using local variables can also continue memory space by allowing the automatic deallocation of variables. Note, however, that Fortran is a very efficient language in terms of execution speed, so it is not endlessly true that requiring declarations must improve execution speed.Also, speed of translation may actually be decreased by the use of declarations, since more cultivation must be kept in tables to keep track of the declarations. (It i s not true, as Fortran and BASIC attest, that without declarations a translating program must be multi-pass.) Security. Requiring declarations enhances the translators ability to track the use of variables and report errors. A clear example of this appears in the difference between ANSI C and old-style Unix C. Early C did not require that parameters to functions be declared with function prototypes. (While not on the button variable declarations, parameter declarations are closely related and can be viewed as essentially the same concept.) This meant that a C compiler could not guarantee that a function was called with the appropriate number or types of parameters. much(prenominal) errors only appeared as crashes or garbage values during program execution.The use of parameter declarations in ANSI C greatly improved the security of the C language. Expressiveness. Expressiveness may be reduced by requiring the declaration of variables, since they cannot then be used in arbitrary way s. Scheme, for example, while requiring declarations, does not require that data types be given, so that a single variable can be used to store data of any data type. This increases expressiveness at the cost of efficiency and security.

No comments:

Post a Comment