You are here: Re: Accessing arrays returned from functions « PHP Programming Language « IT news, forums, messages
Re: Accessing arrays returned from functions

Posted by Shelly on 04/10/07 10:52

<rick@fourfront.ltd.uk> wrote in message
news:1175087834.747284.228690@b75g2000hsg.googlegroups.com...
>> What led you to believe that? Where in the documentation does it say
>> you can do it that way?
>
> If only I could remember where ...
> As far as I can remember it was a write up about the functionality
> that was going to be available in php5 prior to the actual release.
>
> IMHO it should be valid - it would save a lot of time coding
> especially in the following instance ;-
>
> if ( setArr()[ 3 ] === 2 )
> {
> ...
> }
>
> instead of
>
> $X = setArr() ;
> if ( $X[ 3 ] === 2 )
> {
> ...
> }
>

Surely you are joking -- "it would save a lot of time coding"??? It is ONE
line and it makes the code clearer!

What you are saying here reminds me of (way back when) when I first learned
C coding. I found that some smart aleck programmers suffered from what I
called the "Name that Tune Syndrome". They played the game like
-- "I can write that code in 5 lines".
-- "I can write that code in 3 lines".
-- "I can write that code in one line".
-- "Write that code".

All it did was make debugging and maintenance a nightmare. Adding one extra
line for increased clarity? B.F.D.!

Shelly

 

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

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