4 ms·
I totally agre and that immediately popped out at me. When I started coding I would do this to 'save space', until burned by the breakpoint as you point out.
by fishanz 11y ago
I totally agre and that immediately popped out at me. When I started coding I would do this to 'save space', until burned by the breakpoint as you point out. Then I started putting it on the next line, indented, until a more seasoned developer told me about the gotchas of not having braces around a 'one-liner'. So now what used to take one line takes 4 lines, but I'm sure it will circumvent a 'goto fail' bug at some point!
- ufo 11y agoIts only 3 lines if you use the One True Brace Style.
- fishanz 11y agoWell, when I was learning c, Egyptian brackets apparently weren't even a thing. I have co-opted their use in certain places - I think it's a nice way to easily identify a lambda function, but I don't think I would ever use it in pure c. I simply like the way braces line up even if it takes up an extra line .. Kinda like reading HTML, you'd never put an opening tag at the end of a line, right? Anyway, I'm sure this topic has been exhausted a long time ago in a different post.