Re: if statements

[email protected] (Andrei Zmievski)
Newsgroups php.template
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.