Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100498 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2346 invoked from network); 10 Sep 2017 10:22:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2017 10:22:46 -0000 X-Host-Fingerprint: 62.31.75.76 76.75-31-62.static.virginmediabusiness.co.uk Received: from [62.31.75.76] ([62.31.75.76:19373] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/AC-10715-07215B95 for ; Sun, 10 Sep 2017 06:22:40 -0400 Message-ID: <14.AC.10715.07215B95@pb1.pair.com> To: internals@lists.php.net References: <7B.DB.10715.48405B95@pb1.pair.com> <7cd2884a-6606-4c3f-8f95-776fd277878b@Spark> In-Reply-To: <7cd2884a-6606-4c3f-8f95-776fd277878b@Spark> Date: Sun, 10 Sep 2017 11:22:36 +0100 Lines: 1 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3564.1216 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3564.1216 X-Posted-By: 62.31.75.76 Subject: Re: [PHP-DEV] Re: [RFC] Match expression From: TonyMarston@hotmail.com ("Tony Marston") wrote in message news:7cd2884a-6606-4c3f-8f95-776fd277878b@Spark... > >Hi Tony > >> … you sometimes forget to insert a break statement then that is your >> fault. > >Any bug in your source code is ultimately your fault. But as mentioned >before human error is inevitable. You can make it easier for your users to >make less mistakes though. Other languages (e.g. Rust or Swift) have >implicit breaks in their switch statements. This has been done for a >reason, I wouldn’t call this a non-issue. The problem with implicit breaks is that it makes it impossible to group several conditions with a single break. My previous language use implicit breaks, and this problem really annoyed me. With PHP I have more control, and the fact that I have to insert explicit breaks I do not see as an inconvenience. >> Millions of other programmers have no problem with the switch statement > >It’s all they know. They don’t complain about null pointers even though it’s >inventor calls it his billion-dollar mistake. The customer rarely knows >what he truly needs. They know what they want to achieve, and they have to know which language features are available to help them meet their objectives. The fact that some language features have turned out to be a big mistake is purely the fault of the people who introduced those features. Some programmers complain about some languages features even though they are useful features which work as advertised as are not deemed to be a mistake - take yourself for example who is now complaining about issues with the switch statement. If what you want to achieve can be done better with a series of if/elseif statements than the switch statement, then why can't you use if/elseif instead of making the language more complicated? -- Tony Marston