On Tue, Jul 2, 2024 at 1:20 AM Rowan Tommins [IMSoP] <imsop....@rwec.co.uk> wrote: > On 1 July 2024 15:37:49 CEST, Alexander Pravdin <alex.prav...@interi.co> > wrote: > >I personally support the movement from the current "plain-text > >template-first" language to a "coding-first" language, where files > >contain code by default. > > I honestly don't read the <?php at the top of files as an "opening tag" any > more, just as a "magic number" that indicates it's a PHP file, like the > doctype at the top of an HTML file. It might as well be "I <3 PHP". > > Any suggestion to add a special of avoiding those 4 characters scores a big > shrug from me.
The issue is that without this legacy "magic number" the PHP file contains plain text/html/whatever. This is weird. This means PHP is a template processor in the first place. And adding some code is a feature on top of the template processor. I was actually talking not about avoiding 4 chars for the sake of avoiding 4 chars, but about making the PHP source file a programming code file, not a template. And in addition, cut some weird legacy allowing further engine optimizations. Historical/legacy/BC reasons pop up regularly in discussions about something that can not be optimized/improved. What is the percentage of files containing PHP code only and pure PHP templates in an average project? 100% vs 0%? 99% vs 1%? Who uses plain PHP templates today? Why programmers should care about templating legacy in each and every PHP file? I think it's time to switch from "templating PHP" to "programming PHP". Alexander