> One thing I like PHP for is a distinct lack of huge amounts of syntax
> sugar.  Take Ruby - it's a hell to read the code.

I think it is unfair to reference Ruby's capabilities as a counter-example for 
syntax sugar.

The Ruby language allows developers to create what are effectively new language 
constructs and it is possible in Ruby to write code that cannot be recognized 
anyone that has not written the language extensions being used.

PHP does not have that capability, thankfully, and I do not think any proposed 
syntax sugar has any chance of adding those meta-language capabilities into PHP.

Syntax sugar is a good thing when it reduces the need to write boilerplate code 
for a commonly occurring pattern, especially when the boilerplate code is 
tedious and potentially error prone because of typos or logic.  And it is 
naturally occurring in language evolution, i.e. newer languages often provide 
"syntax sugar" for features that are more verbose in earlier languages.

Personally I am not sure I like the proposed syntax, but I am definitely fond 
of the idea to eliminate the boilerplate code that would be otherwise needed to 
build a robust solution.

#fwiw

-Mike
P.S. I wrote a blog post in defense of syntactic sugar a while ago. 
If you are interested in all the arguments in support of syntactic sugar, 
here is the post: https://mikeschinkel.me/2019/in-defense-of-syntactic-sugar/ 
<https://mikeschinkel.me/2019/in-defense-of-syntactic-sugar/>




> Even Vagrantfile has tons of
> results about what syntax for arrays to use and things breaking because you
> end up mixing stuff and you get at least 4 different answers to the same
> question and it looks like all are correct. Confusing as hell :)
> 
> What I'm trying to say is some of us choose PHP for it's "there is one
> syntax - use it". If people want syntax sugar - there are other languages
> that fit that much better. Leave us, peasants, in our peasant non-syntax
> sugar world alone :D
> 
> But many of us would also like the language engine to tighten up some of
> its extremely relaxed parts that do not fit in modern development
> environments and the lowest bar of the code quality rise a bit. Otherwise,
> the gap between high-end development and newbies is going to be even bigger
> than it is now.
> I hire people, that's part of my job. One of the criteria is the approach
> to errors/warning/notices. Imagine how that goes.
> 
> -- 
> Arvīds Godjuks
> 
> +371 26 851 664
> arvids.godj...@gmail.com
> Skype: psihius
> Telegram: @psihius https://t.me/psihius

Reply via email to