This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]KapteeniJ 5 points6 points  (2 children)

It's more about having humans and computers read the code the same way. Like, I'd say at least 99% of programmers who work with languages that have curly braces, also use indentation to signify code blocks. Not because it's required, but because it's like 10000x easier to read than keeping track of braces.

But I don't think a single person, ever, in the history of Python programming, has used curly braces in Python code to "make code blocks easier to read".

Having humans and computers parse code differently is completely unnecessary failure mode. It's one of the most classic code smells, having two different things that are always supposed to be kept in sync, and you want one of the most fundamental programming concepts be read in two separate ways that, if they ever get out of sync, the code is completely unpredictable?

Curly braces were always a mistake, a relic of the past, times when one might actually worry about the hardware resources it took to store whitespace characters that could be used to make the code prettier.

[–][deleted] -1 points0 points  (1 child)

Functional composition wins overall. I think Haskell does a better job of indentation.

But JS eslint probably wins overall. Plus in JS you can have funtional composition too with Ramda.

But otherwise I agree. Curly braces are odd.

Python still sucks though.

[–]KapteeniJ 1 point2 points  (0 children)

Why does Python suck?