Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63581 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50395 invoked from network); 21 Oct 2012 12:39:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2012 12:39:49 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Received: from [195.226.6.51] ([195.226.6.51:50969] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/60-22055-41DE3805 for ; Sun, 21 Oct 2012 08:39:49 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 98EAD5E06EF; Sun, 21 Oct 2012 14:39:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at gna.ch Received: from mail.gna.ch ([127.0.0.1]) by localhost (darkcity.gna.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cD75eRtdjtHG; Sun, 21 Oct 2012 14:39:35 +0200 (CEST) Received: from [10.0.1.8] (178-83-161-240.dynamic.hispeed.ch [178.83.161.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 3B20B5E0383; Sun, 21 Oct 2012 14:39:35 +0200 (CEST) Content-Type: text/plain; charset=koi8-r Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) In-Reply-To: Date: Sun, 21 Oct 2012 14:39:37 +0200 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <45D978DC-C32F-4F87-BBCB-F7FF768A9984@cschneid.com> References: <712F4499-949C-4C6F-A142-736A1B156189@gmail.com> <50831148.1070808@lerdorf.com> <6E76ACFF-FD5B-4BB9-8180-990D0156ECD6@gmail.com> To: Nikita Nefedov X-Mailer: Apple Mail (2.1499) Subject: Re: [PHP-DEV] Generics proposal From: cschneid@cschneid.com (Christian Schneider) Am 21.10.2012 um 13:33 schrieb Nikita Nefedov : > No, this is useful in any OOP-language where there is such thing as = type, and people need to validate types. I question the "need to validate" types part. I'd say you're better off = using a completely different language if you want to use strong typing. = For PHP: Embrace duck typing, write less boiler-plate code (thus = reducing the need for "smart" IDE) and be happy :-) > I unerstand what you are saying about PHP being an easy language, but = in opinion if you don't want to use that feature you can not use it, as = you can not use typehinting in functions for example. That's the same as saying you can ignore most of the C++ feature and = that will make it a simple language. That's neither true for developers = nor users of the language. Example on why this is are 1) Makes language harder to maintain as there is more (and more complex) = code implementing it. 2) Makes documentation bigger so users have first to figure out what = part to read and what part to ignore. 3) Makes it harder to write portable user-land libraries as the = application and the different libraries might use different (clashing) = paradigms. See error codes vs. exceptions as an example of this. 4) Makes it harder to have extensions like APC as they have to implement = more features. 5) Makes it harder to write alternative implementations. ... So yes, I agree with Rasmus that this is not a good fit for PHP. - Chris