Not require round brackets for if statements #4312
-
I'm mostly wondering why this hasn't been implemented yet. What does it break? The incentive being to reduce bracket soup. A light example would be single line if statements that ditch the curly brackets would however still require round brackets but that also isn't bad as it's more readable that way. I'm semi dyslexic and often have a hard time reading code with multiple brackets competing for my attention; so places where we can reduce bracket clutter is a plus for readability. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Because no one on hte LDM believes enough that this is a step the language should take to push for it to happen. I was a supporter of allowing one to write
This is debatable. There's research i've read that talks about how having more htan one way to do something can hinder readability. So we have to feel the value this brings outweighs these (and other) sorts of costs.
I'm sympathetic to that. However, while this might be a benefit for some, that has to be weighed against it being a negative for other.
It makes many things ambiguous. For example:
What does that mean? is hte condition of the |
Beta Was this translation helpful? Give feedback.
Because no one on hte LDM believes enough that this is a step the language should take to push for it to happen.
I was a supporter of allowing one to write
if !(foo())
instead ofif (!(foo())
. But htat would still require one set of parens. We discussed this in the LDM and decided to not go with this.This is debatable. There's research i've read that talks about how having more htan one way to do something can hinder readability. So we have to feel the value this brings outweighs these (and other) sorts of costs.