Say we have the following code
function ABC() {
if (....) {
if (....) {
if (....) {
...
}
}
else {
...
}
}
else {
...
}
}
my question is... Is that 3 levels of If/while-blocks already way too much to withstand?
if not, how much levels of these statement blocks can you tolerate?
will it be much more tolerable if the function only do simple things like
function ABC() {
if (x>0) {
if (y<0) {
if (x*y>r) {
r+=1;
}
}
else {
y+1;
}
}
else {
x+1;
}
}
Thanks for reading, it will be great if you can leave some advice to me