You are here: Re: Shortened "If - Then - Else"? « PHP Programming Language « IT news, forums, messages
Re: Shortened "If - Then - Else"?

Posted by JDS on 10/26/00 11:20

On Mon, 04 Jul 2005 04:47:10 -0700, binderup@gmail.com wrote:

> Why would people use the shortened version?
>
> I find it much harder to read, and I doubt that it will shave off many
> milliseconds

I will use it for things that work better (for me) on one line. For
example, I might use it to optionally stick an "s" on the end of a result
description

<? echo "There were $number item" . ( count($result) != 1 ? "s" : "" ) . "
found";?>

I actually use the ternary operator all the time. This is just one
example.

later...

--
JDS | jeffrey@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация