Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105061 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35211 invoked from network); 3 Apr 2019 22:36:34 -0000 Received: from unknown (HELO mail-lf1-f66.google.com) (209.85.167.66) by pb1.pair.com with SMTP; 3 Apr 2019 22:36:34 -0000 Received: by mail-lf1-f66.google.com with SMTP id m13so12567453lfb.6 for ; Wed, 03 Apr 2019 12:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tPZnfAGE32ic9D9BoUl5KopF86Kytp0/hK6lw68XMCk=; b=X/gVPvjyClBU9VGNGoEG0lM8bTIU8WCZAE+La+yvLxIc3LBtODEHMAf7/4/H9jLps3 RNtA9zpwm4InB5muarIHJyhXgEEXdnEKxjVEB7nCE1j0DuB32xR+ABqgKw+1t13Ove1t AGx/oGb/+WLM70EhyzqJVWBzYDNnQkfbxbrc+OaHR76FFW1iqAfO7mVjffdRkq84+miu zPg8W9T13Xanem/T9aq63RKxszQwbUtPiMbJ9Kmf3Pc+ETM880oDKBMp42C3hnbsjHH8 Xd79/sFKlMVELE/ldce+80SRKpCCazQ5Y1QTp1xBuxj97JSNbZBfSUC7YZvQR9PN40lT 8jCw== 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=tPZnfAGE32ic9D9BoUl5KopF86Kytp0/hK6lw68XMCk=; b=ORC7Krshk/QSpSR07KM9mmn9AGSiJ3hvacXUE4yfy6mu/hnH08bG9Yb9VI1huuLjoL 8uBPFzalrsl3EtmhJrzmPuYqRHLBuxU2rx/EXJa1e1/Kv1ajEVWPsqQ74347PDo4hWJk v5yOHc2lnYhqzl9s26IENGF2IGxVRuDChiFarrM4QyVCzCgJ1Iuag6EwU087N3+vZ4uS O0EKvEpfThDEERg6YOu8BrnstUKYZGgy7IToPEJ8IrY7ajKnoA9IHj0SPlPhXiqsEHcr k7P6JJdyg1t9DVPVGM17gAY7eAG0xmtCbr7Ad8u2q97KAa798pG7QSGQ1gZcfauTTr1T CbOw== X-Gm-Message-State: APjAAAWVpDnWWqL6/XNgMMYuD2rs7pjK7V7KWnhqWHH4ImRnrx+khwrd 0Kx9SMLMNWoPU9rm8TzcrTC+MhjWobhLgr6RwVQ= X-Google-Smtp-Source: APXvYqyqoM6Br4hffZY1eFzvFNtuPuXsirU+wNFv1kK0TXp8Rg5lTnIVTEForYAjEqW6Zp/eO282xvj0i5mSikultaM= X-Received: by 2002:a19:48d5:: with SMTP id v204mr794607lfa.70.1554319921607; Wed, 03 Apr 2019 12:32:01 -0700 (PDT) MIME-Version: 1.0 References: <65AF9E1E-DFA6-47AE-952B-9ABEBD9B6038@gmail.com> <284d1f9f-03d3-1488-77dd-82e18edf9f4c@gmail.com> In-Reply-To: <284d1f9f-03d3-1488-77dd-82e18edf9f4c@gmail.com> Date: Wed, 3 Apr 2019 12:31:50 -0700 Message-ID: To: Rowan Collins Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000cb7a7d0585a54ed0" Subject: Re: [PHP-DEV] Question about adding !function_identifier From: mo.mu.wss@gmail.com ("M. W. Moe") --000000000000cb7a7d0585a54ed0 Content-Type: text/plain; charset="UTF-8" Hello, you are very kind and trying hard but that's not the topic; the commenting section suggestion was some kind of decoy or trap; it does not address the original request and its scope; what's behind is more fundamental; I may have a polite discussion and argument with people; not bulls, they belong to the prairies. and what about ?String (cynicism) Have a good day. On Wed, Apr 3, 2019 at 11:42 AM Rowan Collins wrote: > On 03/04/2019 18:13, M. W. Moe wrote: > > The argument sits there. > > > > function handle(int $cmd, ...$arg) : int /* throw */ > > function !handle(int $cmd, ...$arg) : int > > > The first example is unambiguous, easy to understand by anyone with a > basic knowledge of the language, easy to spot when reading the code, > easy to grep for, and will be recognised as a comment by any tool for > parsing PHP. > > The second example is hard to spot, completely opaque in meaning, and > would break any tool which didn't have it added as a feature. I'm really > struggling to see any advantages at all, other than saving a few key > presses. > > Of course, neither documents what type of exceptions will be thrown, so > it's a bit like documenting every return type as either "void" or > "mixed"; which is why the more common practice would look more like this: > > /** @throws InvalidFooException */ > function handle(int $cmd, ...$arg): int > > > > you seems not having the experience of working on the same code base > > with basically literally dozen of people which can at > > some point intervene; this is reality, this not wrong or bad; you deal > > with it. > > > You're right, I haven't worked in a team that size, but if I did, I > would expect strict coding standards that emphasise clear intent and > documented behaviour to be absolutely essential for everyone to know > what was going on. > > > > either you enforce extra qualifiers in term of signature or you don't > > encourage it > > > I'm struggling to see the difference between enforcing "add an ! before > the name if it throws" and "add a comment next to the name if it > throws", or even "add X to the name if it throws", unless the language > itself is going to perform some extra check. > > > Regards, > > -- > Rowan Collins > [IMSoP] > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --000000000000cb7a7d0585a54ed0--