> Le 31 oct. 2019 à 15:59, Theodore Brown <theodor...@outlook.com> a écrit :
> 
> Of course there will always be an infinite number of logical ways to
> structure a program, but this is quite different from having two
> different syntaxes in a language that do exactly the same thing. The
> latter is confusing since it's no longer clear which syntax should be
> used. The same situation existed with the curly brace array/string
> access syntax, which was deprecated in PHP 7.4.
> 

Yeah, curly brace string access syntax were deprecated in PHP 7.4, and it was 
IMO an error. Last day, I reviewed an old library (PHPMarkdown), whose 
algorithm (probably directly ported from the original markdown written in Perl) 
was not very readable. Replacing all $string{$index} instances with 
$string[$index] made it even less readable, because the conventional 
distinction between string indexes and array indexes used in that library (and 
in several others libraries) were lost. 

Sorry for the rant. But the message is: Existence of precedent is not an 
argument, because it may be a bad precedent.

—Claude

Reply via email to