What are some ways try / catch / throw can develop software , C/C++ Programming

Assignment Help:

 

Q: What are some ways try / catch / throw can develop software quality?

A: By removing one of the reasons for if statements.

The commonly utilized alternative to try / catch / throw is to return a return code (sometimes called an error code) that the caller explicitly tests through some conditional statement like if. For instance, printf(), scanf() and malloc() work this way: the caller is assume to test the return value to see if the function succeeded.

Though the return code technique is sometimes the most suitable error handling technique, there are some nasty side effects to needless adding if statements:

Degrade quality: This is well known that conditional statements are about ten times more likely to hold errors than any other sort of statement. Thus all other things being equal, if you can remove conditionals / conditional statements from your code, you will possible have more robust code.

Slow down time-to-market: As conditional statements are branch points which are associated to the number of test cases that are required for white-box testing, unnecessary conditional statements enhance the amount of time which needs to be devoted to testing. Essentially if you don't exercise all branch point, there will be instructions within your code that will never have been executed under test conditions till they are seen by your users/customers. That's terrible.

Enhance development cost: Bug finding, bug fixing, and testing are all enhanced by unnecessary control flow difficulty.

thus compared to error reporting by means of return-codes and if, using try / catch / throw is likely to result in code which has fewer bugs, is less costly to develop, and has faster time-to-market. Certainly if your organization doesn't contain any experiential knowledge of try / catch / throw, you might wish to use it on a toy project first just to make sure you know what you're doing you must always get used to a weapon on the firing range before you bring it to the front lines of a shooting war.


Related Discussions:- What are some ways try / catch / throw can develop software

Using substitution model write corresponding constructor, (a) Pairs may be ...

(a) Pairs may be represented using a lambda. Using only lambdas, create a procedure (triple x y z) that constructs a triplet. You may NOT use car, cons or cdr in the triplet proced

Write a c program to calculate the equation, Write a C program to calculate...

Write a C program to calculate the output Y for a given value of X for the following formula   Y=X 2 + 2X +3   #include stdio.h   void main()   {   char promt;   float y,x

Logic behind object oriented programming, In this we will take a closer loo...

In this we will take a closer look at the logic behind Object Oriented Programming.  Read through the pseudocode listed below and answer the following questions. Class Square

Explain the loop statements in computer programming, Explain the Loop State...

Explain the Loop Statements in Computer Programming? 1. C gives you a choice of three kinds of loop, while, do while and for. 2. The while loop remain repeating an action until

If/else statement, to compute the net pay of an emplyee, given his/her pay ...

to compute the net pay of an emplyee, given his/her pay rate, number of hours and tax rate

Want wellness software, Project Description: We are looking to have soft...

Project Description: We are looking to have software that we will use to track employee information regarding our wellness program. We would like the system to be able to follow

Explain the function prototype - computer programming, Explain the Function...

Explain the Function Prototype? The Functions must be declared before they are used, ANSI C provides for the new function declaration syntax called as the function prototype,

Explain in brief about the one-definition rule, Explain one-definition rule...

Explain one-definition rule (ODR). According to one-definition rule, C++ constructs should be identically defined in each compilation unit they are used in. As per ODR, two

Luminous jewels, Luminous Jewels - The Polishing Game Byteland county is v...

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd