+ 2

What the mean of robust

please help me to know

7th Jan 2017, 8:02 AM
adi
adi - avatar
5 odpowiedzi
+ 4
When I say 'I want to make this code more robust', It means to simplify and make nicer codes as well as making the code much more powerful and friendly to the IDE/Compiler. For example : if (x != null && y != null) { x.Afunction(y.TakeSomething); } becomes into : if (x == null) return; if (y == null) return; x.Afunction(y.TakeSomething); Aka that helps to prevent overlapping in the conditions and allows the code to get out of a certain block of area/code easily.
7th Jan 2017, 8:20 AM
Wen Qin
Wen Qin - avatar
+ 1
mmmh why the downvote? someone disagree?
7th Jan 2017, 6:07 PM
ifl
ifl - avatar
0
robust code will fail gracefully (eg report meaningful errors, rather than crashing) when unexpected events happen or invalid user input is entered.
7th Jan 2017, 9:15 AM
ifl
ifl - avatar
0
also robust code is easy to read and maintain even by others.
7th Jan 2017, 9:15 AM
ifl
ifl - avatar
- 1
Robust code is achieved by making sure any data from outside the code (user input, parameter values ) is valid before using it. And/or using try/catch constructs to report errors gracefully when smthing goes wrong.
7th Jan 2017, 9:24 AM
ifl
ifl - avatar