Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The difference here is that the former (your example) is automatically correctable whereas the latter is not.

If I highlighted that entire function in my editor of choice and hit TAB I'd get exactly the "correct" indentation.

Almost any modern editor can automate this for you. It's one of the benefits of having a syntax for blocks. Yeah, it's extra typing for something you're going to do anyways, but now the computer can manage the style for you.

Also, and this is just my personal experience, I've learned to read by those control characters. I have a really hard time reading python because I'm subconsciously looking for the control characters!

I really think that part is really down to how you learned to program and what language you use on a daily basis.

As an aside, I think something like this is much more demonstrative of the issue you're suggesting:

    def foo() {
        nums = [...]
        sum = 0
        for x in nums {
            print(x)}
            sum += x
        }
It's still automatically fixable, but it's way less immediately apparent that something is wrong with the indentation.


Right, so you do your automatic fix and you end up with indentation that's the same as the python example. Isn't this a case for syntactical indentation?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: