Hacker News new | ask | show | jobs
by twykke 3199 days ago
some colleagues of mine have complained about the significant whitespace being difficult to understand. i can't argue with something subjective like that.

however i like to point that our entire codebase, CS, JS, TS, Python, Java, Swift, 100% of it already has significant whitespace.

...it's just that the JS/TS/Java also have curly brackets.

1 comments

I'm not sure I understood. I don't know about Swift but do JS and Java have significant whitespace?
No, twykke is saying that in almost every language, even ones that don't technically have significant whitespace, people still use coding conventions and style guides that restrict whitespace to match the curly braces. Some people even use automated commit hooks to reject commits that don't follow the guide.

The end result (or arguably, driving force) is that even in languages where whitespace isn't significant, people read the whitespace, not the curly braces. So the curly braces are basically redundant noise.

Ok, thanks.

I agree about { } being mostly noise but I think they are the lesser evil. I'm making most of my money with Python and I still believe significant whitespace is a very bad idea. The Ruby alternative of using end is better even if not super elegant (and Ruby is my language of choice). It's on par with curly braces. After 30+ years of programming I still have to find a satisfying solution to the problem.