2 ms·
concise != short. You can have short code by using single-letter variable names and avoiding whitespace. It doesn't gain you anything. But concise code says
by nostrademons 19y ago
concise != short.
You can have short code by using single-letter variable names and avoiding whitespace. It doesn't gain you anything. But concise code says exactly what it needs to say and no more, and that can be much more readable than lots of boilerplate.
- dfranke 19y agoUp 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.