Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Curly braces

Name: Anonymous 2008-04-21 17:12

Why would anyone seriously want to use curly braces to denote scope? Surely significant indentation, or implicit scope based on the surrounding keywords, is far superior.

Also consider this: every time you wish to enter { or }, you must hold down the shift key. That is one extra wasted keypress per scopening and sclosing.

And it just looks messy, like a spastic has been scribbling nonsense all over your screen.

Name: Anonymous 2008-04-22 19:34

>>37

You are correct. Semicolons are huge fail. Multiline statements are the exception not the rule. So forcing one to type a semicolon after every line, when only a few of their lines are going to be multiline is true fail.

>>38

The extra keywords at least have an explicit meaning. Where braces have no meaning other than something is ending (the starting brace does have an obvious meaning as it follows the keyword of whatever is starting). If you want to make it convey an obvious meaning (as in what exactly it is ending) you need combine it with spacing, or another popular trick is to use comments, fail). Python has shown us that spacing can be used to group code, and it does so without the braces because the spacing inherent to braces makes the braces redundant.

The only language where braces make sense is JavaScript on a webpage because of download performance concerns.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List