3 ms·
Up to a point, avoiding whitespace does gain you something. It means you can fit more code on the screen at one time. In languages with C-like syntax, I've
by dfranke 19y ago
Up to a point, avoiding whitespace does gain you something. It means you can fit more code on the screen at one time. In languages with C-like syntax, I've taken to putting consecutive close-braces on the same line, at the indentation level matching the outermost brace. It's surprising how much it helps.
- boucher 19y agoI disagree. The amount gained to having more on the screen is much less than what is lost to readability. Whitespace is your friend. I do exactly the opposite, where each bracket gets its own line, never going on the same line as code. This helps create an excellent visual division of blocks on the page.