4 ms·
I have been personally screamed at for suggesting One True Brace Style over K&R in response to a request for feedback on an architecture standards document. Th
by pkteison 16y ago
I have been personally screamed at for suggesting One True Brace Style over K&R in response to a request for feedback on an architecture standards document. That was when I learned that corporate architecture teams don't actually want to get feedback when they ask for it.
I find it odd that I have a strong opinion on the topic but have never seen a convincing argument that one way is actually better than another, it's just that one feels right to me and the others don't and I can't articulate but neither can anyone else I've seen.
- davej 16y agoI don't know about other languages but there are real practical reasons to choose 1TBS in Javascript, consider the following code: return { key: 'value', anotherKey: 'another value' } This is fine and works as expected, now consider the following K&R/Allman style code... return { key: 'value', anotherKey: 'another value' } In Javascript this is parsed as `return;` (notice the semi-colon), this is because Javascript does its dreaded automatic semicolon insertion magic. So, I think that's a pretty good practical reason to prefer 1TBS in Javascript.