4 ms·
The comment-based data-binding syntax <?{ }?> proposed is not going to be PHP compatible. Besides, I don't really want programming right in the HTML and never
by hyperhello 3y ago
The comment-based data-binding syntax <?{ }?> proposed is not going to be PHP compatible.
Besides, I don't really want programming right in the HTML and never did. Your mind doesn't read text the same way it reads programming code; the HTML tags are enough. Put the code elsewhere.
- lifthrasiir 3y agoPHP has supported a long tag syntax `<?php` since PHP 3 in order to be compatible with XML, and a short tag `<?` can be always turned off. As long as it doesn't conflict with `<?=` (which is now an always-available short tag syntax for `<?php echo`), `<?{ ... }?>` should be okay even for PHP.
- hyperhello 3y agoTo me, this is like designing a language with // as a division operator. You can do it, but it strongly signals that you're not interested in the relationship between your language and C. That's fine. But if you tell me this is a superset of C that uses // as a division operator, I assume you are not designing from a place of experience. That's what this says to me.
- lifthrasiir 3y ago> But if you tell me this is a superset of C that uses // as a division operator, [...] Just in case, you are referring to C89, right? (Such language can't be a superset of C99 or later.) > That's what this says to me. I haven't written any PHP for years, but I think `<?` was already heavily discouraged back when I was still doing PHP things. Any surviving PHP codebases should have a similar guideline (for example, [1] for WordPress). [1] https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#no-shorthand-php-tags https://developer.wordpress.org/coding-standards/wordpress-c...
- int_19h 3y agoI remember it being discouraged 20 years ago.
- pests 3y agoYep pretty much since it was released
- chuckadams 3y agoThe `<?` isn't the problem, it's the closing `}?>`. Processing instructions don't nest. They're also xml, not html, so jolly good luck getting WHATWG to put them into the HTML standard.