Date: 11/19/99
- Next message: Faisal Nasim: "[PHP-DEV] Re: [PHP4BETA] MySQL module for Win32"
- Previous message: Andi Gutmans: "[PHP-DEV] MySQL module for Win32"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: ajr4 <email protected>
Operating system: All
PHP version: 4.0 Beta 3
PHP Bug Type: Feature/Change Request
Bug description: Better escaping leading to better code
A feature that would greatly improve code layout is the so called macro entity.
The reason we use HTML is because it is the easiest format that is directly related to the way we think of document layout. i.e. "Apply this format to this region", "insert this object here." When programmers make these documents dynamic, most of them tend to create a patchwork of code and HTML that no longer accurately represents the document layout it produces until after it is processed.
Inline code tags were the first step in the right direction. They allow the code to be inserted into the document instead of vice versa. However inline code tags lead to certain common abuses i.e. something like <NAME ATTRIBUTE="<? print $value ?>">. This kind of abuse decreases readability by both humans and programs like a syntax highlighter in an editor and is agains the w3c spec.
The next step that would further allow the programmer to preserve the layout structure without obfuscating the code is the addition of what are know as macro entities. The syntax is &{expr}; and is accepted by the w3c in their HTML 4.0 spec. They are already implemented to allow JavaScript macro entities and I believe PHP should adopt this form in addition to the inline code tags. The code &{expr}; would be semanticly equivalent to <? print expr ?>. This method also would have the added benefit of reducing the amount of code clutter for a very common operation - printing a value into the document.
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Faisal Nasim: "[PHP-DEV] Re: [PHP4BETA] MySQL module for Win32"
- Previous message: Andi Gutmans: "[PHP-DEV] MySQL module for Win32"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

