News for hackers. Stuff that matters.
Re:Let’s Stop Bashing C by pjc50 on Friday December 02, 2016 @05:49AM (#13087616)
Oh god, this is one of my least favourite parts of python. It is unnecessarily hard to restructure if-then code. It is risky to cut-and-paste from webpages. And as you say, you can't always paste from the editor to the interpreter.

Python has an "invisible close brace" character, the newline, which closes a varying number of braces. When you think of it like that, it makes much less sense.

Re:Let’s Stop Bashing C by voyou on Friday December 02, 2016 @06:43AM (#13087833)
"Python has an "invisible close brace" character, the newline, which closes a varying number of braces"

The idea that the end of a block is invisible isn't really right, though. The newline doesn't end the block. The block ends at the next line containing non-whitespace text at a lower indentation level. In other words, it only ends when it becomes visible that it has ended.

Re:Let’s Stop Bashing C by infogulch on Friday December 02, 2016 @11:39AM (#13090041)
I'm seeing several people complaining about this, but I've always found changing indentation very easy. Just select then [Shift+]Tab to [un]indent. I do this regardless of the presence of braces.
Re:Let’s Stop Bashing C by pjc50 on Friday December 02, 2016 @12:31PM (#13090547)
It's not that it's hard to change, it's just that you have to keep track of it, and if it's damaged you have to work out what it's supposed to be.

In an Algol brace-blocked language (or Pascal, Verilog etc which use begin/end), you can just put stuff in the middle of a block, check that what you've just inserted is balanced, let the editor reformat it, and you're fine. Whereas if you've lost the indentation from

    if a:
        print b
        a = a + 1
then you have to work out all over again whether the second line is part of the block or not.
Re:Let’s Stop Bashing C by infogulch on Friday December 02, 2016 @02:53PM (#13091721)
Ah true. Thanks for the explanation.

So maybe what C's missing is a standardized, popular, universal, automatic fmt-on-save. This eliminates its' issue problem with improperly indented code.

Re:Let’s Stop Bashing C by pjc50 on Friday December 02, 2016 @03:07PM (#13091850)
Yeah, most projects have a coding standard and you can run indent(1) to enforce it. I don't think it's high on the list of issues with C though.