Quoting from the archived forum thread:
One thing I’ve learned from my first year of EE development is that because of the parse order of advanced conditionals they usually cause more problems than they solve. This is unfortunate, because advanced conditionals can make for much cleaner template code, and sometimes simple conditionals just won’t do.
EE is the first program/framework/language I’ve used that treats advanced conditionals differently than simple conditionals. I’m assuming there was a good reason for this design decision - does anyone have insight as to what that reason is?
Thanks,
Aaron
There actually is a rhyme and reason to it, and it comes down to diminishing returns of using PHP to parse strings with pseudo-variables, and being able to anticipate all of the myriad of ways that one might employ a conditional. The result is making the most common and most basic conditionals as performance friendly and “active” as possible, and allowing flexibility for other more powerful use with a passive approach to avoid performance problems or inaccurate conditionals.
Simple conditionals are strings that can be easily parsed, and at a point in the application’s execution that it can know for a certainty that the values of the “variables” will be known.
Advanced conditionals are those that have multiple conditions, contain tags, have variables provided by tags, etc. and have a higher cost to parse the string to identify if they are “ready” to be evaluated. So rather than repeatedly running that expensive code at each step of the template parser to parse each individual conditional when it is ready to go, which would severely degrade performance, all “Advanced” conditionals are parsed at the end of template execution after all tags so that we are certain that any “variables” that might be used are available and have been replaced with the corresponding values.