Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126116 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 6E4711A00C5 for ; Thu, 5 Dec 2024 23:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1733442048; bh=lpKq5ssinB9PAahYCKS1/JLKLbOaAtdI0XU2Lqa72HA=; h=Date:From:To:In-Reply-To:References:Subject:From; b=BGsAPyYJ8rWZqZ81y/7mai7zndEQuxiOS+4vtbt2Rr5vHKWMFU57/d0B9N1cueByU FprsSTimMlmsBunZtjgdQD307h1rkpH+BrFE6Wo7lK10oEXUv7siI+T72oR+9hPNfG +5akiuIW1inYpCmaX2IcHz20fWvUxHWm/0XIn3AYMjIpGi+NgRhsrfcI6kOWT2BaoL BOJG3whOkTpUnBWXsZTepP267IZjN5j6voHDHQFSzh6kau9Y9ZWaz3gM/0bHcTpclq 11WFYeNFzQliQlS4LOg+aOkalJXhfdlY5m+Hf6rHZdJ9oGAUqkITCuZGwi/Rsk2HUX mzDmxY+iMV90Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DD3291801E5 for ; Thu, 5 Dec 2024 23:40:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 5 Dec 2024 23:40:44 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id AB9F425401B5 for ; Thu, 5 Dec 2024 18:43:51 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-01.internal (MEProxy); Thu, 05 Dec 2024 18:43:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1733442231; x=1733528631; bh=A7PqmTUcHlSqux8KV3Kn0 c/CfD/Ff4FgSjjGGeymOxo=; b=l0yqf5UVY2ib/lU1pqBAQe7H/3C9J3p+pXdYT PXNx+M9vqepTOJfeqxPCcbJTDYpnUHRNT2kck9khE8yx66MGWEWAIM49Ab4tSR3r JcFI1T4uSr5J4o6Dw+yfnJjoh3WEqPbnlRxjrwBnBHxjy6Q+mTn3tNijejYKXcht B/wqGUZgduRyvuOE3WZfmoK9JJ/5wgcM5DqPAEEgNl8bIH+VxOuubiF5LlD/MLD/ CZaPsu6QKHnsmDDo7nuz/YyyLkUxpmzgbjvmpzhJ/jRuQI+jFGxaZkHBl+Q8UIrI yirbMm9Yz+0Nq2+SH2LtHlBD3cBrc4f2BwkYdt/ETragJ8Emw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1733442231; x=1733528631; bh=A 7PqmTUcHlSqux8KV3Kn0c/CfD/Ff4FgSjjGGeymOxo=; b=owtlxwTWjn6D/0hjq PEdMfYw17Ds4VDS11pwbq9jBGNSUVz68nhTwpn6wA3qubCWE2uQmWmVYk6VnKESS /VL5Oyl+sVYi3Mae2hmGUo3Q5i3tcrLbrKh/2de9kEFXo75SdC8cbOyysIWCpHKK PfSXfFh4RFaOCHcehL0h2RqM/hVBQYzsZvO31hqUY8PsOyJg7yN4a451KswwCdNP zNPbNEFB2nxz0e7lIpQyRiQqDJP/l2q4NQpbznBbiymUSfWsYifmTnZusKx6aRQd 2WRRZJ37XubXUVEMCiIaf60LHjWXbNau3f19rm1EoU1M/Qm3sHpvPWxYIJmTtGAi abmyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieekgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefoggffhffvkfgjfhfutgfgsehtqhertdertdejnecu hfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivg hlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhepffeiiedvhfdvgedutddtgeet ieeugeevhfetheeffeefteduiedthedtgeejueeinecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghh rdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtth hopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 2552D29C006F; Thu, 5 Dec 2024 18:43:51 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 05 Dec 2024 17:43:29 -0600 To: "php internals" Message-ID: <2786d545-2047-40f9-a428-1437238b247d@app.fastmail.com> In-Reply-To: <6c1b378a-4c93-4747-bb5a-84d133c95d8b@gmx.de> References: <57d09ef6591a4c70e60569b9de7ce330@bastelstu.be> <6c1b378a-4c93-4747-bb5a-84d133c95d8b@gmx.de> Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Thu, Dec 5, 2024, at 5:16 PM, Christoph M. Becker wrote: > On 05.12.2024 at 22:49, M=C3=A1t=C3=A9 Kocsis wrote: > >>> I'm not sure I like the `Interface` suffix on the `UriInterface` >>> interface. Just `Uri\Uri` would be equally expressive. >> >> Yes, I was expecting this debate :) To be honest, I never liked inter= faces >> without an "Interface" >> suffix, and my dislike didn't go away when I had to use such an inter= face >> somewhere, because it >> was difficult for me to find out what the symbol I was typing actually >> referred to. > > By the same argument, you could come up with code like > > class User { > const defaultGroupNameConstant =3D "users"; > private string $nameVariable; > public function getNameMethod() {=E2=80=A6} > =E2=80=A6 > } > ?> > >> But apart from my personal >> experiences, I prefer to stay with "UriInterface" because the 2 most = well >> known internal PHP interfaces >> also have the same suffix (DateTimeInterface, SessionInterface), and = this >> name definitely conveys that >> people should not try to instantiate it. > > DateTimeInterface has been introduced after there had already been > DateTime. Otherwise, we would likely have DateTime, DateTimeMutable a= nd > DateTimeImmutable. (Or only DateTime as immutable class.) > > SessionHandler/SessionHandlerInterface have been bad naming choices, in > my opinion. The interface could have been SessionHandler, and the cla= ss > DefaultSessionHandler (and should have been final). I dislike these > Interface and Implementation (or abbreviations of these) suffixes. > > Christoph I used to be in favor of *Interface, but over time realized how useless = it was. :-) I have stopped doing it in my own code and my code reads wa= y better. Also, the majority of PHP's built in interfaces (Traversable,= Countable, etc.) are not suffixed, AFAIK, so it's better to avoid it fo= r consistency. As noted, DateTimeInterface is a special case outlier. --Larry Garfield