Home  |  Linux  | Mysql  | PHP  | XML
From:Adam Richardson Date:Thu Mar 18 17:06:53 2010
Subject:Re: Re: PHP in HTML code
On Thu, Mar 18, 2010 at 11:28 AM, tedd <tedd.sperling@gmail.com> wrote:

> At 9:34 AM +0000 3/18/10, Pete Ford wrote:
>
>>
>> I do tend to use <?php for blocks of code - so I guess I'm in the middle
>> camp here.
>>
>
>
> Whoa, that's even worse -- make a choice and stick with it -- IMO.
>
> I'm all for consistency and have often found myself redoing dozens of
> scripts because I changed something -- not because the change worked and the
> other didn't, but rather to maintain consistency throughout the project.
>
> Granted, different reasons promote different programming styles. While what
> I do is to solve the problem at hand for the client, it also has to pass
> through my vision of code elegance. I program for myself first and solve the
> client's problems second. I also realize that I have the privilege of doing
> so because my needs are few. I probably wouldn't do well in a production
> oriented environment.
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

What Pete described is consistent.

For blocks that merely echo out a variable in templates or views, he uses a
<?=, and in code that's actually doing some manipulation, he uses <?php.

This consistency does make it very easy to discern the difference, saves on
typing, and similar approaches are used in other frameworks (e.g., ASP.Net),
too.

Adam

--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com

Navigate in group php.general at sever news.php.net
Previous Next


Your recent visits
Re: [PHP] Re: PHP in HTML code



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants