Re: ANN: Dao Language v.0.9.6-beta is release!



Op 2005-12-07, Steven D'Aprano schreef <steve@xxxxxxxxxxxxxxxxxxxxxx>:
> On Wed, 07 Dec 2005 15:26:59 +0000, Zeljko Vrba wrote:
>
>> Braces are very convenient to match block start and end. Open a C program
>> in the VI editor, and press % in command mode on some brace.. It will take
>> you to its matching brace. How do you do something like that with python code
>> (or any code that is based purely on indentation..)
>
> (1) You don't need to, because you can *see* where the indentation
> changes, so you don't need to rely on your editor counting for you.

But you can't alway easily discern by how much.
>
> (2) And if you do need to, then you should use a smarter editor that
> understands indentation levels, not just braces.
>
> Braces are superfluous if you use consistent indentation, and indentation
> is superfluous -- to the compiler -- if you use braces. But indentation is
> *not* superfluous to the human eye: we can parse indentation very easily,
> but nested braces/brackets only with great difficulty. That's why
> programmers in languages that ignore indentation still indent their code,
> or at least the sensible ones do.

But sometimes you mess up and your code is no longer indented as it
should. If you marked the end of the indentations, you can easily
correct this.

--
Antoon Pardon
.



Relevant Pages

  • Re: AfxGetApp() returns NULL
    ... I've been using the same indentation style for about 30 years, ... basic tests of human perception limitations. ... Note that the "indent braces" option still gets the indentation wrong; ... fighting a third-rate editor when I have a first-rate editor already. ...
    (microsoft.public.vc.mfc)
  • Re: Coding [style] standards
    ... It also reduces the maintenance of braces; ... and other programmers to read, ... Use indentation to emphasize scope. ... But I indent curly brackets to the scope of the function body: ...
    (comp.lang.c)
  • Re: ANN: Dao Language v.0.9.6-beta is release!
    ... so you don't need to rely on your editor counting for you. ... screen reader that understands indentation. ... And sometimes you mess up and delete braces you shouldn't have. ... Start/end markers plus indentation carry ...
    (comp.lang.python)
  • Re: ANN: Dao Language v.0.9.6-beta is release!
    ... > Braces are very convenient to match block start and end. ... and press % in command mode on some brace.. ... because you can *see* where the indentation ... so you don't need to rely on your editor counting for you. ...
    (comp.lang.python)
  • alternatives to making blocks like { } or other ??
    ... > But here if there were braces, ... If you were writing in Python the logic would be right also. ... > doesn't meet our coding standards, yet there's no way for the compiler ... > the indentation! ...
    (comp.lang.python)