19.11.2016, 08:40
If you've got (or want) three different messages then the first one won't even be appropriate.
That said, sometimes it is appropriate to bundle multiple checks to avoid nesting too deep. Nothing is more annoying than reading something like this:
Yet many people do this and in many cases it isn't even properly indented. Gets even worse when "else return" is added into the mix.
That said, sometimes it is appropriate to bundle multiple checks to avoid nesting too deep. Nothing is more annoying than reading something like this:
PHP код:
if()
{
if()
{
if()
{
if()
{
if()
{
if()
{
if()
{
}
}
}
}
}
}
}