Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63463 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55930 invoked from network); 16 Oct 2012 12:29:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2012 12:29:33 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.220.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:37525] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/30-10021-C235D705 for ; Tue, 16 Oct 2012 08:29:33 -0400 Received: by mail-vc0-f170.google.com with SMTP id fo14so7465158vcb.29 for ; Tue, 16 Oct 2012 05:29:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=9K1RXFTVzI2G/ykqmftnol5VZaxKURQxI6crfKVsHJI=; b=BORt27BLZKMFgvmYoyaoqnrGrYwv/t5xBecotzydG1X4LYpEubIpPaR8JiYwAK13zO 8ut6R+4O6+Z51VUEZQrrFlPUWPWRRUztnlnXbdB+JpRHPs7ctAJSps2+c4JEpvK401NV c+hNKPikeq//MzsxGfvcQTbAOUO+clG1UtJeXG2RPd/V9+EfUXMFq+rIP28BUw5SYGDJ w+CWXwhK4SHiPm/wXH3qpkCW35MS5xaCRzEiVTmfzJmdUn3BUz7KraKbCKNL1haTffR8 HNGWEZ8ywVvwtOmbkg/Q28zRPRDkXrsoSTN/Hc/4CvHwdh/ALTrAXNhod2UrVYTbw+Gy vgAQ== MIME-Version: 1.0 Received: by 10.52.75.72 with SMTP id a8mr6945786vdw.66.1350390570213; Tue, 16 Oct 2012 05:29:30 -0700 (PDT) Received: by 10.58.146.103 with HTTP; Tue, 16 Oct 2012 05:29:30 -0700 (PDT) Date: Tue, 16 Oct 2012 08:29:30 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf3071cf983ee0a704cc2c4edf X-Gm-Message-State: ALoCoQlUdrXTuxe9TD8CyU/Nc2C8UWKe+YUlEBfsNOc4/TLsXUQ6dtQobR22KeYZpldAAGmQ+Ub/ Subject: static analysis and early warning systems From: rasmus@mindplay.dk (Rasmus Schultz) --20cf3071cf983ee0a704cc2c4edf Content-Type: text/plain; charset=ISO-8859-1 Since there's a heavy debate on the list about strong typing right now, I just want to briefly share my point of view. PHP is not and won't be a strongly typed language. What it can be (and is on the way to be, with Clint's work) is a language that supports type-checking. Not the same as strongly typed. There's a time for unchecked properties and arguments, and there's a time for type-checking - you can argue against type hints and type-checks until you're blue in the face, but they exists for a reason: static analysis, which means better tooling and faster (and more well-documented) codebases in larger projects. And early warning systems - making sure that code fails at the point of failure, rather than bad arguments (or worse, property-values) slipping through the cracks, costing you many hours of painstaking debugging. Code that doesn't fail in the place where it's actually broken, is harder to debug than anything else. Type hints are optional, so PHP can still be a beginner-friendly language. To classify PHP as a "beginner-language" seems unfair to experienced professionals, who brought projects like Symfony and Zend Framework to life. The recent injection of new talent and renewed interest in the past 1-2 years has happened because those people stuck with PHP rather than "moving on" to other languages - let's face it, nobody wants to be stuck in "beginner mode", and if PHP was really strictly a "beginner language", it would be largely a waste of time. To me, it is much more than that - it is a language where you can dip your toes and test the water safely, but you can go really, really deep if you want to. The modern tools, libraries and frameworks available today are a testament to that fact - if the people behind these projects had simply "moved on", where would PHP be today? Growing the language is key to maintaining the interest of smart people who are willing to invest their time in building great software with PHP and sharing it with the community. A language is only worth as much as the community is willing to invest! Don't be afraid of scaring off beginners with advanced features - because PHP is such a loose language, those people can still get on board and start learning, without having to go the whole way on day 1. Beginners are unlikely to start picking apart Symfony or Zend Framework anyhow - but they are likely to start trying them out eventually. Most people do not get into PHP development intending to learn only the basics - they usually have a more long-term plan. Those who get in, intending to learn only a little, are usually designers and front-end people, who will never touch more than a view/template script anyhow, and thus will never even encounter classes, closures, or any of the other "advanced" stuff. Just my two cents. --20cf3071cf983ee0a704cc2c4edf--