On Mon, Mar 30, 2020 at 11:39 AM Benjamin Morel <benjamin.mo...@gmail.com>
wrote:

> If "they" don't care about syntax, then why do you?
>
>
> Sorry I was unclear. I was reacting to the argument about broken tests in
> php-src.
> I meant: they don't have *expectations* about the syntax, but they'll most
> likely want to be able to read it.
>
> And we circle back to the current syntax being perfectly readable. We
could keep this up all quarantine...

In a more practical example,
https://github.com/php/web-php/blob/master/include/releases.inc is an
example of a var_export() generated file that lives in the wild and is
regularly updated.

I would say it's fairly readable, HOWEVER I WOULD AGREE WITH YOU that it
would be MORE readable using short array syntax and skipping the index
numbers.  In fact, I had exactly this thought nearly 3 years ago when I
started touching this file regularly. (plus the fact that the structure of
this array is kinda gross).

You'll note though, that I'm not championing making this file more
reasonable. Because it doesn't matter.  Because accidental damage to
existing code isn't worth a minor bit of aesthetics by a file which is
primarily read by machines.  If it really mattered to me in any meaningful
way, I'd write the dozen or so lines of script needed to output in a
"pretty" way.  Or I'd go google and find brick/varexporter.

Lastly, there are at least six RMs at any given moment working on PHP's
release.  Can you imagine if we were updating this file using different
versions?  The git churn would be horrific.  Do not want.  If we really
wanted "pretty var_export", then there'd be no real choice BUT to use a
library script to do the serializing.

-Sara

Reply via email to