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

I have never found significant whitespace to be a significant problem in practice.

Very few people use tabs. 4 spaces is the norm.

I just don't get the fuss surrounding this issue. It just works and the benefits far outweigh any cost - real or imagined.



The so-called benefits always boil down to "this suits my preferences" which is frankly not a compelling argument in any way.

Edit: autocorrect ran rampant


> The so-called benefits always boil down to "this suits my preferences"

The of significant white-space are:

1. Reduction of visual noise and improved readability. I find this uncontroversial. Your eye parses code by indentation, not by curly-braces. I could remove the curlies from javasscript and if the indentation was correct, you'd be able to follow it.

2. Reduction of cognitive load. Instead of giving me two jobs to do: indent correctly and match braces - Python only gives me one of those jobs.

These are real benefits that I experience whenever I work with Python. There are also genuine costs* but I find the balance to be very much in favour of significant whitespace .

* restrictions on possible choices of syntax being the only one I think actually affects me in anything other than a theoretical sense.


Eh, most languages and tools nowadays reduce the risk of indenting incorrectly or not matching braces to near zero, so in practice there is little cognitive load either way.

Only serious cognitive load for me writing code is whether to add new line at 80 or less chars. That's about it.


No, the so-called benefits boil down to the fact that, objectively, no professional Python programmer has ever considered more than 10 seconds a day fighting this, if ever.

This doesn't take the fact that if you consider it to be an aesthetic wart then there's not much that can be done about it. But it does suggest that perhaps you should recalibrate your aesthetic senses towards something that brings so much more to the table than what it might detract.

To give you an analogy, it's like Java programmers complaining that lambda syntax is "hard to undestand". Sure, if you don't put in a little effort to learn it or work with it might, but you're missing out.


> It just works and the benefits far outweigh any cost - real or imagined.

Both the costs and benefits are largely subjective, so whether this is true of not varies considerably from programmer to programmer. Hence, why it is a perennial issue of holy wars in the community.


> Very few people use tabs. 4 spaces is the norm.

And if they're not using 4 spaces, they're not following one of the more important documents there is for coding in Python in a way that other people can easily read - PEP8.




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

Search: