News for hackers. Stuff that matters.
Re:Why do programming languages use curly braces? by cobrausn on Tuesday February 26, 2013 @12:01PM (#5286792)
You run into it again when you start working with other developer's code.

And once you learn to use curly braces, you don't forget that either. I haven't been plagued by curly braces since college - I work with C / C++ / Lua / Ruby on a daily basis. I seriously don't see how it's any different than remembering to indent your python code. An editor certainly doesn't absolve you of that responsibility either.

I'll put it this way - when I look at a block of code with braces (or begin / end), non-rendered characters don't affect the correctness of it.

Re:Why do programming languages use curly braces? by k3n on Tuesday February 26, 2013 @12:25PM (#5286962)
I just think they're redundant.

Indention in non-Python code is 100% aesthetic; it doesn't affect program behavior, we just do it because it helps us non-compilers understand the code. And if you follow most any sane coding standard, indention will always be congruent with braces.

So, you're essentially attempting to convey the same concept -- program structure -- via 2 different mechanisms: tokens (curly braces) and indention, where of course the former is required, while the latter is the fodder of more flame wars than anyone cares to count. The sad thing is, these flame wars over code formatting are the most contentious to humans and yet the least meaningful to the compiler.

One solution would be to remove the indention -- hey, we already have the tokens informing us of the lexical code boundaries...but this produces unreadable code. The other solution is to remove the tokens; since we as humans will naturally structure our code in block paradigms, then we can piggyback on a behavior that is already innate to programmers.

Re:Why do programming languages use curly braces? by qu4z-2 on Wednesday February 27, 2013 @12:21AM (#5290822)
I agree with you. It seems odd that we have the structural information in our program twice: Once for humans, and once for computers. The computers are perfectly capable of understanding the human construct, so let's use that.
Re:Why do programming languages use curly braces? by pekk on Tuesday February 26, 2013 @01:32PM (#5287402)
Enforcing a convention (like go fmt) will also take care of the issue.

However, this doesn't end up being really different from what Python does by rejecting mixed tabs and spaces. So.