Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110177 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63367 invoked from network); 16 May 2020 14:01:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 May 2020 14:01:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AC0151804C9 for ; Sat, 16 May 2020 05:39:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 16 May 2020 05:39:19 -0700 (PDT) Received: by mail-vk1-f182.google.com with SMTP id p139so1276845vkd.7 for ; Sat, 16 May 2020 05:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tItmanLcCsXSKe8REIjOZUBx4FnTdj4JPdexqrakM0Y=; b=zZpUWEaGsDxlvFHM4FyEE2EeMft7kqP0jpZyrW4g17PCXrlSPEJKQdUVvFy7GfrDJp 6SwXZnZJegkZ+UvBB++JPGvqRlxKSLsffvlZWKGXBotyILSkjIDuwb1DsWG7IT0gVKDX Vcc8mP+hQ+0Zrjb6HuCG5FJZZjb9zHtKtTofq3gneQ5C3My7Sq77n6V8JkL+KASBEH5Q RYjsZjvv3VM40zCJ6DX0e8eAJH8xw38E4lL7W60ARf/dynhjY6sQRbOsf9DFvESZpdU4 5JLD5CdTS2EOiq9j94fLAMf9Lu15Z3xptcjcyFEBwV4pwTQuIWQsDRYaQ4Ipvmyo3FVS U/pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tItmanLcCsXSKe8REIjOZUBx4FnTdj4JPdexqrakM0Y=; b=RdH38wahbEHRCxvrvGlj67A6Nx2e15LCODO4GurSJdS96u/WLRntvPdFpQTVZDy2lb gFzbu/qCsupZRpda3GeH7j9d4eFbsA4JFOGquBTlgB7TfkZNcOb+WSXGRVEutnYu79hr yumgGyFopaRbF1IpQ/BmrngTuujYOn4rbFdejdY0JmyHt811XzffuqfORlJyKOgmxfSl M5hvMDR+A8bjvlqDCFZFb84P4ITozdPZy0zj9MBjaSGouDS3ffhdf9wVrGll5oC+ZAxc oZ/3zHkcucuXGjQnpZiX0J2wBUUwDUVq7pcvBxekRUnSRD2uSbsXDP5GwZM3LLbIOAt/ lzWA== X-Gm-Message-State: AOAM533hNkC/33B3G+mC3RIDNui2j1OIXXVij0EW/hp38oMMprEkdV5/ yhNnZUFpYB6oOux1rwBS+LQvXs7BK3ryGThR1tAZoA== X-Google-Smtp-Source: ABdhPJwDVjOlR1xvF7VVcN6WF9pMxOK0SJyZxRJPxqBgFnP0mZgI255HYx3KSBJh9flCGe3Zv46faF2rsZEfwkZcW/4= X-Received: by 2002:a1f:17d7:: with SMTP id 206mr6029316vkx.2.1589632755797; Sat, 16 May 2020 05:39:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 16 May 2020 13:39:05 +0100 Message-ID: To: Max Semenik Cc: Pavel Patapau , Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Guard statement From: Danack@basereality.com (Dan Ackroyd) On Sat, 16 May 2020 at 13:14, Max Semenik 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