Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63583 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57455 invoked from network); 21 Oct 2012 13:22:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2012 13:22:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-la0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:45722] helo=mail-la0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/A1-22055-507F3805 for ; Sun, 21 Oct 2012 09:22:14 -0400 Received: by mail-la0-f42.google.com with SMTP id e6so1176897lah.29 for ; Sun, 21 Oct 2012 06:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=fri3XftBFMMjrxf0fEjg8Vi3KNXAYl537zMFHfXX79U=; b=069Z+gJsMnHAvTlJIvVq4cMGZINaC2FnWOoVxZMn7yBzFvU1Eh9ATGE6jEcsAZ70ML Zp2OF1aCsQtPabD7mKYEPmyw0MhXdI4uge5MqFKRF63kd9xSjxqiW/0UvAoO0253Zl/o m00lt5T2JdLU1sCLusrAxMMlxrSAPusRdiU5xY0fWRpX70czTccSHgnKktFZs1DIbR0N GFv/Kl+NWsewySnNbUYk/aB9ayX3KrVbxrnToW2eRgT/V/BevfUnmBy2Z/+AhMcuwbzX Bfe8LxdvzoZUOCdtzxwQPOx2lUNG5A2R6olelWena1ZrPS3ccEfQ5fPbpFZ5PonUIMhq YPOQ== Received: by 10.112.84.131 with SMTP id z3mr2596737lby.70.1350825730895; Sun, 21 Oct 2012 06:22:10 -0700 (PDT) Received: from nikita-desktop (128-72-176-60.broadband.corbina.ru. [128.72.176.60]) by mx.google.com with ESMTPS id nr2sm2111848lab.5.2012.10.21.06.22.09 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 21 Oct 2012 06:22:10 -0700 (PDT) Content-Type: text/plain; charset=koi8-r; format=flowed; delsp=yes To: "Devis Lucato" , "Christian Schneider" Cc: "internals@lists.php.net" References: <712F4499-949C-4C6F-A142-736A1B156189@gmail.com> Date: Sun, 21 Oct 2012 17:22:08 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/12.02 (Linux) Subject: Re: [PHP-DEV] Generics proposal From: inefedor@gmail.com ("Nikita Nefedov") I actually don't have much experience with generics, so won't argue about their readability, but this article is all about Java's implementation of generics, so I don't know how much sense this article gives in that context. But it's ok, I see just one person that supported proposal. I think case closed. > I see what you are trying to achieve, but I hope this will never make > into > PHP mainly for impact on readability. I'd like to quote Eric Armstrong, > a > passionate Java/Ruby dev: > >> I decry their very existence. They are the ultimate condemnation of > static >> type checking--because their very addition has virtually destroyed both > the >> readability and elegance of the language. >> To make my case, let's start with a quasi-mathematical definition of > "elegance". >> In my view, elegance is a function of power and simplicity. Power is > measured >> by how much you can do. Simplicity is the inverse of the number of > characters >> it takes to achieve the result. So more power with fewer characters > equals >> "elegance" > > http://www.artima.com/weblogs/viewpost.jsp?thread=299081 __________________ > 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 :-) We have typehints, that was my point here. > 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. PHP now is multi-paradigm language (isn't it), so... yep, that's the same :) > 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. All this points are also applicable to namespaces, [abstract,final] classes, interfaces, traits, access modifiers (instead of using `var`), etc. If you would have said, this points in the context of... say... necessity of that feature, then yeah, maybe you would be right. Anyway, as long as almost no one didn't supported, I think we can close this discussion.