Total Pageviews

Monday, May 16, 2011

Program Errors

Program Errors
In the world of computer programming, programmers develop computer applications that are intended to perform certain operations and without inaccuracies. In most cases, it will take a programmer more than a single attempt to fabricate a program with no errors or “bugs” as they are known in programming. In the following commentary, we shall focus on three types of program errors that occur in computer programming. The program errors we will address are Design Errors, Syntax Compilation Errors, and Semantic Run-Time Errors. In addition, we examine who three different programming languages address these different errors. The programming languages we will examine are JAVA, Visual Basic, and C++.

Design Errors
Design errors in programming are the more complex errors in programming because they indicate that there is a flaw in the overall scheme of the program and generally affect the overall outcome of the program. To put it simply, the program produces a result that is not the result it was intended to produce. For example, a program may be written to identify all employees over 50, but instead it identifies employees who are female. Design errors in all three programming languages are programming errors.

Syntax Compilation Errors
Syntax Compilation Errors in programming are errors in the syntax of an order of characters or tokens of the given programming language. In most cases, an integrated development environment (IDE) or compiler catches the program’s syntax errors.

In JAVA, the compiler catches the syntax error and then it will issue an error message that includes the syntax that contains the error.

In Visual Basic, the program code is checked as it is typed in the Code Editor window. If an error is made, such as misspelling a word or using a language element improperly, Visual Basic will alert the programmer.

In C++, the compiler catches the syntax error and provides the line number where the actual error occurred and an error message.

Semantic Run-Time Errors
Semantic Run-Time Errors in program are errors that occur when the program is executed or executing and results in the program stopping completely without producing a result.

In JAVA, the run-time errors are handled just like the syntax errors with the exception of involving the compiler since the program would have already been compiled. When the program crashes, JAVA will display the line number of where actual crash took place. In some cases, the line displayed may identify where the error took place, but not necessarily the line of the actual problem.

In Visual Basic, for run-time errors, custom errors can be generated of any data type, including Exception objects. This is carried out by utilizing the “Throw” statement. The error number and message of a caught exception to identify the error are usually displayed, but if an error is not caught, the program terminate.

In C++, the run-time errors are handled just like the syntax errors with the exception of involving the compiler since the program would have already been compiled. When the program crashes, C++ will display the line number of where actual crash took place.

No comments:

Post a Comment