LWN.net Logo

Cracks in the Foundation (PHP Advent)

Cracks in the Foundation (PHP Advent)

Posted Dec 19, 2011 3:30 UTC (Mon) by imgx64 (guest, #78590)
In reply to: Cracks in the Foundation (PHP Advent) by Richard_J_Neill
Parent article: Cracks in the Foundation (PHP Advent)

> Actually, being able to quickly swap from PHP to HTML (especially using short-tags <? ... ?> ) can be useful. One way to create, imho, legible code is to do all the processing first, and then write out the bulk of the HTML, inserting <?=$variable;?> as needed. Like any language feature, this can be abused.

Yes, this is called a template engine. Every other web language has one, and it's by no means PHP specific. Even statically-typed languages like Java and Go have template engines (Go even has two in the standard library, although the older one will be deleted before Go1 is released).

On the other hand, making the whole language a template engine is just wrong IMO.

> BTW, ironically, you *didn't* disable your rant. String "0" IS equal (==) to false, though it isn't identically equal (===).

Yes, that was the intention.

> If you wanted to complain, you'd have to complain that "0.0" is considered true; "0.0" is considered equal to 0.0, and that 0.0 is considered false. Sadly there is no perfect way to write automatic-casting rules.

Wow. PHP is even worse than I remember.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds