Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85803 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56270 invoked from network); 14 Apr 2015 12:40:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2015 12:40:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:36874] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/01-47925-7AA0D255 for ; Tue, 14 Apr 2015 08:40:08 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id D68274A207; Tue, 14 Apr 2015 14:40:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on km31408.keymachine.de X-Spam-Level: * X-Spam-Status: No, score=1.4 required=3.0 tests=ALL_TRUSTED, DNS_FROM_AHBL_RHSBL autolearn=no version=3.3.2 X-Spam-HAM-Report: * 2.4 DNS_FROM_AHBL_RHSBL RBL: Envelope sender listed in dnsbl.ahbl.org * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-93-104-8-165.dynamic.mnet-online.de [93.104.8.165]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 2EB564A203; Tue, 14 Apr 2015 14:40:43 +0200 (CEST) Message-ID: <1429015200.3492.39.camel@kuechenschabe> To: Johannes Ott Cc: internals@lists.php.net Date: Tue, 14 Apr 2015 14:40:00 +0200 In-Reply-To: <65.35.08334.AC2EC255@pb1.pair.com> References: <006d01d07603$3a104a70$ae30df50$@php.net> <65.35.08334.AC2EC255@pb1.pair.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-ammf9ZZhayb0D3fldf6t" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Subject: Re: [PHP-DEV] New RFC draft "static class constructor" From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-ammf9ZZhayb0D3fldf6t Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-04-14 at 11:49 +0200, Johannes Ott wrote: > Am 14.04.2015 um 00:16 schrieb Levi Morrison: > >> - IMO, the method should be called when the class is created, just aft= er every parent class and implemented interfaces are created. > >=20 > > In general I think static class data and static class constructors are > > a sign of poorly designed code, which means I am against this feature. >=20 > Thanks for the flowers as we would say in Germany! I didn't hear I'm > doing poor code for a long time now :( If static elements need initialisation they apparently have state. If they have state they in 95% of the cases shouldn't be static but bound to an object instance. Yes there might be cases where this is a good design, but the language should provide the syntax sugar to lead the 95% to write good code instead of leading them to write bad code which can be tested harder and where changes might have unexpected side-effects. So even if you're code is good and your own use-case is good design, which I won't question, I don't think advertising it to all users by providing a language feature is good. johannes --=-ammf9ZZhayb0D3fldf6t Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJVLQqgAAoJEH3sTmn8nIPXfp0IAI4BYR2UtzFs/lyaKxWqWaqA O1cL94q9aijz1UvdhL6Gh4wH2ywR5KgC+btX/xGTATUGINZqWT3mXGc+kvHO8WnA avITfJxoby670xcj88NmNW6HZxggzAT2uL3mZtirI72uhKfYQqitQvtW7C21Y6dK 9i1JbfSA8BO8S29QPqjvDpa0AObzTtfByZQ2LbkWWFgeAyMUwNA3Spyep+nIWLeI KU30dnICODJqqggQOlgP8L5eGoOCKolYvu0mdifTiFfgUgkSugbqaY6U4qsf53HY AH2PcB7/JfpLfOXvDfxp0ssUnBQI56J+6cmQ+Sxw7EHApcOUNd8AY2dif/OZ98k= =YdLG -----END PGP SIGNATURE----- --=-ammf9ZZhayb0D3fldf6t--