Re: if statements

From: Date: Tue, 15 Feb 2000 22:01:42 +0000
Subject: Re: if statements
References: 1 2  Groups: php.template 
Request: Send a blank email to php-template+get-52@lists.php.net to get a copy of this message
On Tue, 15 Feb 2000, Tobias Ratschiller wrote: > For me, if-statements should remain in the application logic. I'm trying to > save my designer from the need to write things like this, after all. > > Your example could easily be written as > "Your search found {products_total} {matches}", and the app logic determines > whether it should be "match" or "matches". Not if the single match needs to be shown in red, for example, or have some other formatting? Since now we're talking about formatting, that belongs in the designer domain. I'm not sure if 'if' statements are evil per se, it's just how you use them. If you try to save your designer from needing to write things like this, then you can always not use 'if' statements and explicitly do all the work yourself. Some designers do like the flexibility, though. I'd be interested to hear more opinions on this matter. -Andrei Complexity in the mind is not caused by learning; learning is caused by complexity in the mind. -- Steven Pinker

« previous php.template (#52) next »