Re: Miserable escape string problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2006-10-06 at 01:35 +0200, intra_test@xxxxxxxx wrote:
> Dave Goodchild wrote:
> > Is this really worth all the keystrokes? Do we not have any more 
> > valuable ways to spend our time?
> 
> Good point Dave. But on the wrong side.
> 
> By counting all the keystrokes the PHP developers have to type extra
> for code like this:
> "{{$foo}: {$bar}}"


> '{'.$var1.': '.$var2.'}'

My prefered way is definitely this one. It's simple really, let me sing
it for you...

    "in, out... in, out... shake it all about..." ;)

When adding variable data to strings, by using the in, out (shake it all
about method), the technique is identical whether you are using object
properties, nested array fields, simple variables, functions, constants.
That's right, I said one way fits every last one of them, try that with
your precious interpolation :B Interestingly, it also happens to be the
fasted method from a processor standpoint :)

Cheers,
Rob.


> etc.
> 
> vs. such code
> "\{$foo: $bar}"
> 
> and actually not accounting for the ease of reading and assimilating
> such code, guess what's better? Ramp about it? Or try rise the problem?

I have a PHP coprocessor embedded in my skull, it's all easy to read...
well as long as the braces are properly formatted anyways *haha* ;)

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux