Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105059 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7171 invoked from network); 3 Apr 2019 20:39:16 -0000 Received: from unknown (HELO mail-lj1-f176.google.com) (209.85.208.176) by pb1.pair.com with SMTP; 3 Apr 2019 20:39:16 -0000 Received: by mail-lj1-f176.google.com with SMTP id r24so15655102ljg.3 for ; Wed, 03 Apr 2019 10:34:42 -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=C+i+UjuaqsSOni9V2lnjIxvCgspIGIMuNUizAL27tEE=; b=oRS2nnwVfMXSnkSzhC6/Tz5jjlteqV50+uz9smefMtqO/lGv65wUJacpH4wvIKTvIU qfyEjFictwx1CPYb86WoNnYldegskkXZ125/yT/80xAyTiTpJCbUQpc59kRWl8ANlU1H eygCacBmsxEkFbfIsuP36d0Qxjl9vWX9FuMFx96udh7I45fBh6EhjQPf8OcXHwjA7mIS ewoYryIgd9nqMYHao9GeGJIZPikQBxyiUFTdGAFrppt7GVGooabn8qvBa4R0LmVxBKEa xDrIdRs5CDubgLMSv7Nli8MNICuk6RXSErwt7MLrrxzajKAKz98P/LOMVqdSJr5Qx+b2 qkhg== 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=C+i+UjuaqsSOni9V2lnjIxvCgspIGIMuNUizAL27tEE=; b=H+cg+sVkI/FS5rnJ9Qj4fy41RPqzxz3KD193vh9Mw4kMkQ4OLqWOa6ZJ+Mq+yLWXtu rFcvTQwh+q27J9TVw5blNBB58lIrE2GfD8oPkgnRnN91CtgoM8qFtRdf8XP4APKVPMDf TaqgvgRGyngAyj+U8G/CKYJg5RK1QsAEMJTl65YvqFWm1uz+XYOvZKF2DXD4gpwNYxQ5 /0m8opgiycNPnhvrwoG0OdHuqixSR7XJ5eKYZv9nWrPK2HQZNhY096i0PvI4hs9v8S2o KFLC7I53rMj5Dixpp9gSWR+Vle0fkDL0CJnHqSFhHmRnVkqf43wp6Y6HQYCxFVb4b0YV ccRQ== X-Gm-Message-State: APjAAAUWVfvefyVS1tFbvSBdCH91blQjBFUakJpvuN7n3MN8r1+DvzvB uAWWYvKMS+vxXNZlfD7xh77LquAKUk2tjZN/l0Q= X-Google-Smtp-Source: APXvYqze9BfzVXW/5HV59b69fEkcB+t2Wu9xb4AgQMGaEvl+K9u8LLeE+4WP3iHb8vBGJSdyGQSmF4fyVlNOCG+DElY= X-Received: by 2002:a2e:9d99:: with SMTP id c25mr550680ljj.159.1554312881702; Wed, 03 Apr 2019 10:34:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 3 Apr 2019 10:34:30 -0700 Message-ID: To: Rowan Collins Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000002f0c420585a3ab14" Subject: Re: [PHP-DEV] Question about adding !function_identifier From: mo.mu.wss@gmail.com ("M. W. Moe") --0000000000002f0c420585a3ab14 Content-Type: text/plain; charset="UTF-8" Hello, quick commenting usually ends up in a `circus`; either you enforce extra qualifiers in term of signature or you don't encourage it 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. We are a shop where people are using terminal emulators; vim or emacs not cumbersome IDEs or for some not even a window manager ; reality; you deal with it. Moreover an exception state is not really like a status; this is an internal language behavior, should be carried by the syntax even if informal, anyhow could evolve over time. On Wed, Apr 3, 2019 at 10:24 AM Rowan Collins wrote: > On Wed, 3 Apr 2019 at 17:52, M. W. Moe wrote: > > > not documenting at first is not really a question of laziness or so, as > > things are still moving around > > you absolutely need this agility; a good design layout between theory > and > > stable state will refactored > > discussed a thousand times; that what I expect from engineers; filling > the > > gaps between assumptions > > and reality. > > > > > I think we have different assumptions about what "documentation" means > here. I'm not saying you have to write a 500-word paragraph explaining the > theory and edge-cases in the code; just that you should write a quick > comment saying what the function expects, and what it will return, beyond > the ability of the language's syntax. > > You *could* write every function like this: > > function tbc(...$args) { > } > > That way, you can change the visibility, the argument types, the return > types, and the name, without "documenting" it in advance. Clearly, that > would be ridiculous, so you probably actually write this: > > public function convertFooToBar(Foo $foo): Bar { > } > > What I mean by "documentation first" is to go a small step further and > write: > > /** > * Convert using the lookup tables > * > * @param Foo $foo Should only be given pre-validated Foo > * @return Bar Will always be pre-validated > * @throws InvalidFooTypeException > */ > public function convertFooToBar(Foo $foo): Bar { > } > > > This is all part of the *current* design of this function. It might change, > but if it changes, you change the docblock, just as you'd change the > signature if you realised it should actually be private, or accept a > PreValidatedFoo object, or the name is wrong. > > > You seem to want to do this same job, but with as few characters as > possible, and I don't really understand why, if your aim is to be explicit > and clear. If you just want to type less, use an IDE or editor with good > auto-complete support. > > > Regards, > -- > Rowan Collins > [IMSoP] > --0000000000002f0c420585a3ab14--