How do you think about the flooding of bracket?

BLS lietz at wanadoo.fr
Thu Jun 15 07:24:56 PDT 2006


"Deewiant" <deewiant.doesnotlike.spam at gmail.com> schreef in bericht
news:e6rno9$1ju8$1 at digitaldaemon.com...
>> I find something like that gets very annoying quickly, when "PROCEDURE
xyz" is
> one or two lines long. Imagine something like (mixed-syntax pseudocode):

Hi Deewiant,
a two line inner function seems , at least to me, to be a quit seldom used
construction.
But anyway, i guess exept me nobody is interested in such kind of language
extension.
and it will be nearly impossible to keep the D compiler compatible with
ancient versions..
kind regards and thanks for your feedback.
bjoern


> PROCEDURE foo(int x)
> PROCEDURE bar
> PROCEDURE baz
> return 6;
> END baz
> x += baz();
> END bar
> if (x) BEGIN
> while (x < 10) BEGIN
> bar();
> foo(x);
> END
> END
> return x;
> END foo
>
> At least to me, the extraneous foo/bar/baz in the above make it harder to
> quickly read and understand.
>
> In my mind, when things start to get unreadable due to them spanning many
lines
> and/or there being a lot of nesting, you can just use a comment at the
ending
> curly bracket:
>
> void foo() {
> ...
> } // end foo()





More information about the Digitalmars-d mailing list