Don't get me wrong, I'm not saying that all logic contained within PHP pages is poor. Of course, any platform that blatantly mocks structured coding with “features“ like variable variables is prone to create a whole slew of programming travesties. But that isn't always the case. See, here's a perfect example of some production code that Paul discovered. This illogic could easily be coded on another platform ...

He builds up an SQL query, and tries to execute it. If it succeeds, he builds up a second query, and executes that. Then regardless of whether the first one succeeded or not, he'll try another query - which will be an identical copy of either the first or the second.

 So if the first query didn't succeed, he simply executes it again, prints out a possible error message, and continues with the redirect. If the first one did succeed, he runs the second one, twice, and prints out a possible error message before continuing with the redirect.

Note that no where does execution actually halt if either query results in an error.

 

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!