Hi,
Well there a no problem, programming with ELSE or without it.
In your opinion, it's better to write multiple IFs with multiple RETURNs without specifies the niche or some real use cases.
And in most of cases when I see an article, with title like "don't use XYZ" or "Avoid using XZY in programming", it's about somebody consider it's better or worst for readability.
Maybe on a real example, where are involved at least 3 engineers, to perform some experiments about how ELSE (or other statements) affects readability.
I agree that using hierarchy of IFs are not good, I mean:
IF 1=1 {
Something;
IF 1=2 {
Pass;
...
IF 100=100 {
return;
}
...
}
}
I see your point Ceban. When I was planning this article I was in trouble to bring examples to explain that concept and I agree that they can be better.
But I think that if a new developer reads this he/she can at least think about it and try to write better code day after day. In the end, my goal with this post is that.
Thank you very much for your time contributing here!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Please, can you explain why exactly?
I will be very happy to discuss it and learn new things with you too.
Hi,
Well there a no problem, programming with ELSE or without it.
In your opinion, it's better to write multiple IFs with multiple RETURNs without specifies the niche or some real use cases.
And in most of cases when I see an article, with title like "don't use XYZ" or "Avoid using XZY in programming", it's about somebody consider it's better or worst for readability.
Maybe on a real example, where are involved at least 3 engineers, to perform some experiments about how ELSE (or other statements) affects readability.
I agree that using hierarchy of IFs are not good, I mean:
IF 1=1 {
Something;
IF 1=2 {
Pass;
...
IF 100=100 {
return;
}
...
}
}
I see your point Ceban. When I was planning this article I was in trouble to bring examples to explain that concept and I agree that they can be better.
But I think that if a new developer reads this he/she can at least think about it and try to write better code day after day. In the end, my goal with this post is that.
Thank you very much for your time contributing here!