Which one is better?
#7

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:
PHP код:
if()
{
    if()
    {
        if()
        {
            if()
            {
                if()
                {
                    if()
                    {
                        if()
                        {

                        }
                    }
                }
            }
        }
    }

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.
Reply


Messages In This Thread
Which one is better? - by Micko123 - 19.11.2016, 07:47
Re: Which one is better? - by iLearner - 19.11.2016, 08:03
Re: Which one is better? - by SickAttack - 19.11.2016, 08:10
Re: Which one is better? - by Micko123 - 19.11.2016, 08:20
Re: Which one is better? - by iLearner - 19.11.2016, 08:22
Re: Which one is better? - by setes7 - 19.11.2016, 08:24
Re: Which one is better? - by Vince - 19.11.2016, 08:40
Re: Which one is better? - by Micko123 - 19.11.2016, 08:57

Forum Jump:


Users browsing this thread: 2 Guest(s)