3 ms·
> My vote is to get rid of the curly braces. All of us have suffered from bugs and compiler complaints from deeply-nested blocks of code where we get mixed up a
by oneeyedpigeon 11y ago
> My vote is to get rid of the curly braces. All of us have suffered from bugs and compiler complaints from deeply-nested blocks of code where we get mixed up about how many closing braces are needed, and where they should be placed.
I cannot remember the last time this happened to me.
> I’d prefer requiring matching begin and end blocks, with the end statement indicating which block is being closed.
So you can close an outer block before closing inner blocks? Or you can omit closing of a block altogether? Why - doesn't this create loads of nasty ambiguity?
> Sure, careful indentation tells us the same thing, but so much code today has been modified by so many people that the original engineer’s careful indenting often becomes hopelessly mangled.
"Often"? Just fix that problem if, indeed, it IS a problem.
> I often put an indication of which brace is closing which block in the comments.
As others have pointed out, if you need to do this, you have bigger problems.
I do actually like Python's approach, although I don't have enough experience with it to judge if it's a big improvement.