4 ms·
I think people underestimate the cost of vertical length. It's less obvious in small examples, but there's a huge difference in readability between a class or f
by lmm 10y ago
I think people underestimate the cost of vertical length. It's less obvious in small examples, but there's a huge difference in readability between a class or function that fits on one page and one that doesn't, so it's well worth making individual lines a bit less readable if it means you need less of them.
- amirouche 10y ago> so it's well worth making individual lines a bit less readable if it means you need less of them What does it mean?
- effie 10y agoOur teacher of programming told us something like this: if your program has so many lines it cannot fit on one screen, it contains at least one bug, so don't make them, keep them short. I try to make all projects made of small files, where each one can fit on one screen. Great for comprehensibility and productivity (less scrolling). Sometimes, a procedure gets longer than one screen, so what one needs to do is to put as much source as possible on a line, so that the entire thing fits into one screen.
- lmm 10y agoMaking individual lines a bit less readable is well worth it if making individual lines a bit less readable means you need less of them. ("Worth it" is a construct I don't really understand the grammar of - I'm a native English speaker)
- pyre 10y agoThe question here is with is "a bit less readable"? Many people with run with that advice and start playing code golf on a production codebase.
- zenojevski 10y agoIntermediate functions :)