Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107032 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8416 invoked from network); 13 Sep 2019 01:08:55 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 13 Sep 2019 01:08:55 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 763FE2D2016 for ; Thu, 12 Sep 2019 15:44:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 12 Sep 2019 15:44:54 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id e5so1338198pls.9 for ; Thu, 12 Sep 2019 15:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=HyhEp8Fw90bKHKhgZ9rT1C8giSZB5MZskS4OpxOwHq8=; b=cVnFQQbJLc3Ped4KwAJtNBYEkguXKIne/OWXVq4o6qU4RR2MkN4aSN7qncCxw36Dx9 GJJRXZwvu1kRRGr3KYU4A3vLL7H4IIuAqtEN65a/Oxon859m+CVuFRCvPLDulVdvnHbv 9FxPWbNjDztwxy/PatkjJTnxEqiMfvt/nBWufmFoKTO2gBl9AFuxEIdPrkMz2KUfmD/3 3+ASu8I7mMr0ypkDm0ez9FESVzNE814uU5u4+jaY5dPG/gwwX0aHtuP2LhVBuLMOhKag nuYPAnZn7YoSR2DNLkOOeTaX7fo9Sy2bPVFSTgnXdnvxLHBi5xguWT0J0oPjQsSxg0wu /ACw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=HyhEp8Fw90bKHKhgZ9rT1C8giSZB5MZskS4OpxOwHq8=; b=IbycR0Q/gP8lZY/RAeiY4qp0Kggi4EVishnVbIxAm6C0K63xVjR8GPI/wmICcVll/m xgQCKWy3ZKEsYWEutz351kjMBsl/+8mN1eDPOYbP83LV/fKRyj0XnTVg3+pcaqt6JIqV mCVx1f2xsrz5KL2XWgFbxnXLsuiJQy6iRgoyiyJkKzHV1Unndfihxm3+SMY6MvGjaQo2 ddkmxUGkjZE5PhlXZ7fdga+c/Xm6Cpdh5z9KKMgFRteJoS93BmfeVfWrUZnr1qy28WEs IP1KJ+7Oqchgx8s5hXg5owFLxXdX/T5AXqO3BSaCHLWaHqGjj6Zy5KHbI2yTSJ6fxnV4 hTfA== X-Gm-Message-State: APjAAAVG6kkTuppafwaye0vHfZFx0Yjiyh6H/KoYfONUegGzNgvSrzB2 iNk0lVv8qKuCm6EjjQXBp6N/lF7nasCAJw== X-Google-Smtp-Source: APXvYqzHwoDZLB2ngY9jJJ9+S8qWzi0Cf7PxGnILrLO18ZsL/mOpdkTNJlsYawmLH4b7sE6lX5DBKg== X-Received: by 2002:a17:902:a50d:: with SMTP id s13mr6218360plq.248.1568328293531; Thu, 12 Sep 2019 15:44:53 -0700 (PDT) Received: from [192.168.101.137] (50-252-183-45-static.hfc.comcastbusiness.net. [50.252.183.45]) by smtp.gmail.com with ESMTPSA id w13sm27237146pfi.30.2019.09.12.15.44.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Sep 2019 15:44:51 -0700 (PDT) Message-ID: <31A45454-8A8D-4414-B8C7-29D7023EEBFD@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_7A2FD731-DCA0-497B-B3BA-DE67CD6973D6" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Thu, 12 Sep 2019 15:44:48 -0700 In-Reply-To: Cc: PHP internals To: Arvids Godjuks References: X-Mailer: Apple Mail (2.3445.104.11) X-Envelope-From: Subject: Syntax Sugar (was [PHP-DEV] [RFC] Reclassifying engine warnings) From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_7A2FD731-DCA0-497B-B3BA-DE67CD6973D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > One thing I like PHP for is a distinct lack of huge amounts of syntax > sugar. Take Ruby - it's a hell to read the code. I think it is unfair to reference Ruby's capabilities as a = counter-example for syntax sugar. The Ruby language allows developers to create what are effectively new = language constructs and it is possible in Ruby to write code that cannot = be recognized anyone that has not written the language extensions being = used. PHP does not have that capability, thankfully, and I do not think any = proposed syntax sugar has any chance of adding those meta-language = capabilities into PHP. Syntax sugar is a good thing when it reduces the need to write = boilerplate code for a commonly occurring pattern, especially when the = boilerplate code is tedious and potentially error prone because of typos = or logic. And it is naturally occurring in language evolution, i.e. = newer languages often provide "syntax sugar" for features that are more = verbose in earlier languages. Personally I am not sure I like the proposed syntax, but I am definitely = fond of the idea to eliminate the boilerplate code that would be = otherwise needed to build a robust solution. #fwiw -Mike P.S. I wrote a blog post in defense of syntactic sugar a while ago.=20 If you are interested in all the arguments in support of syntactic = sugar,=20 here is the post: = https://mikeschinkel.me/2019/in-defense-of-syntactic-sugar/ = > Even Vagrantfile has tons of > results about what syntax for arrays to use and things breaking = because you > end up mixing stuff and you get at least 4 different answers to the = same > question and it looks like all are correct. Confusing as hell :) >=20 > What I'm trying to say is some of us choose PHP for it's "there is one > syntax - use it". If people want syntax sugar - there are other = languages > that fit that much better. Leave us, peasants, in our peasant = non-syntax > sugar world alone :D >=20 > But many of us would also like the language engine to tighten up some = of > its extremely relaxed parts that do not fit in modern development > environments and the lowest bar of the code quality rise a bit. = Otherwise, > the gap between high-end development and newbies is going to be even = bigger > than it is now. > I hire people, that's part of my job. One of the criteria is the = approach > to errors/warning/notices. Imagine how that goes. >=20 > --=20 > Arv=C4=ABds Godjuks >=20 > +371 26 851 664 > arvids.godjuks@gmail.com > Skype: psihius > Telegram: @psihius https://t.me/psihius --Apple-Mail=_7A2FD731-DCA0-497B-B3BA-DE67CD6973D6--