On Sat, 16 May 2020 at 13:14, Max Semenik <maxsem.w...@gmail.com> wrote:
>
> Note how no language mentioned in that article has this keyword,

Except Swift which is one of the first languages to use this:
https://www.hackingwithswift.com/new-syntax-swift-2-guard

> I would go further claim that in my opinion all current
> control structures in PHP are intuitively understandable
> to anyone familiar with programming but not the
> language.

So you're saying that PHP should only have features that are familiar
to C style programming languages, and that we shouldn't either have
new features of our own design, or features that are new in Swift?

> "Can the same be said about `guard`?"

Yes. It's something that's new, so you're not used to it. And so
there's an instinctive feeling of doubt about it. But it's the type of
thing that once introduced would be easy to explain to a junior
programmer.

To be clear, I have the same feelings of "Oh wow this is totally weird
and I don't like it", but the more I think about "If I saw this in
some code, would it make reasoning about that code be easier?" the
more I get used to it.

cheers
Dan
Ack

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to