Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #67433

Re: why indentation should be part of the syntax

From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: why indentation should be part of the syntax
Date 2014-03-02 07:36 -0500
References <lev1t8$qt0$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.7573.1393763808.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 3/2/14 5:41 AM, Stefan Behnel wrote:
> Haven't seen any mention of it on this list yet, but since it's such an
> obvious flaw in quite a number of programming languages, here's a good
> article on the recent security bug in iOS, which was due to accidentally
> duplicated code not actually being as indented as it looked:
>
> https://www.imperialviolet.org/2014/02/22/applebug.html
>
> Stefan
>

As much as I like indentation as syntax, and am amused by this bug, I'm 
not sure we can chalk it all up to space-vs-brace. After all, who would 
have wanted two goto's in a row even with braces?  It's not like there's 
some engineer at Apple who meant for the code to read like this:

     if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) {
         goto fail;
         goto fail;
     }

This looks to me like a poorly handled merge conflict maybe?  I wonder 
if we'll ever get the details.

-- 
Ned Batchelder, http://nedbatchelder.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: why indentation should be part of the syntax Ned Batchelder <ned@nedbatchelder.com> - 2014-03-02 07:36 -0500

csiph-web