Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20150 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87650 invoked by uid 1010); 18 Nov 2005 14:18:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 87635 invoked from network); 18 Nov 2005 14:18:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2005 14:18:04 -0000 X-Host-Fingerprint: 195.225.34.5 fw01.axit.nl Received: from ([195.225.34.5:14208] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 4C/B2-07637-B92ED734 for ; Fri, 18 Nov 2005 09:18:03 -0500 Message-ID: <4C.B2.07637.B92ED734@pb1.pair.com> To: internals@lists.php.net References: Date: Fri, 18 Nov 2005 15:16:56 +0100 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Original X-Posted-By: 195.225.34.5 Subject: Re: [PHP-DEV] dropping curly braces From: r.korving@xit.nl ("Ron Korving") I hear a lot of opinions here on the curly braces issue, and while I don't use them, they're not in the way. I'd say let's keep them in. > > As far a code readability and obviousness goes, I doubt anybody would > > guess their way to the $str{5} syntax. If you were new to > > PHP and you > > were going to try to guess how you would get a character offset in a > > string, what would your first guess be? > > Well, it wouldn't be [] because I'd guess that's for array access as in > other > languages. I probably wouldn't guess at all, but look it up, and be very > happy to find it was {}. I remember being very, very surprised to find [] > doing double duty, and glad that {} existed as an alternative. You obviously have no C(++) experience. People with the C-background consider strings to be arrays of characters, and therefor it makes perfect sense to use [], just like it makes sense to use [] for strings in C. I don't see a problem with {} however, and see no reason why it should be removed. I don't find it disturbing when I have to read someone's code containing {}, so why remove it and make a lot of people angry? I don't see the improvement except that certain warm and fuzzy feeling... Ron