Dangling if

Jonathan M Davis jmdavisProg at gmx.com
Mon Oct 1 08:26:20 PDT 2012


On Monday, October 01, 2012 08:56:25 Nick Sabalausky wrote:
> I don't know if maybe this is somehow related to my inability to accept
> or feel comfortable with indent-based languages, but I don't think
> there's ever been a time I've forgotten to add curly braces when adding
> another statement to a one-statement 'if' or 'else' clause. It's just
> automatically the first thing I do, kinda like automatically turning
> the headlights off when I park the car (although the "headlights" thing
> is admittedly much more subconscious than the curly braces). I'll
> forget a semicolon pretty often, but the {} I haven't had a problem
> with.

I'm in the same boat. I've never had a problem with this, and it baffles me that 
people keep thinking that it's an issue.

> I might just be weird, though.

Well, you are. ;)

But not because of this.

- Jonathan M Davis


P.S. #1 reason to hate languages which don't use braces: there's no way in vim 
to hop to the beginning or end of a scope block (or function) from the other 
end. And _man_ is that annoying. God bless braces.


More information about the Digitalmars-d mailing list