3 ms·
I've worked on codebases where people consistently did things in 3-6 lines that could have been done in one (without it being an overly complex line). It was m
by nicoburns 7y ago
I've worked on codebases where people consistently did things in 3-6 lines that could have been done in one (without it being an overly complex line).
It was massively detrimental to readability, because it meant what should have been a 5 or 6 line function suddenly became 20 or 30 lines. A 20 line function is suddenly 100 lines. And you had to wade through each part to work out what it was doing rather than just glancing at it and it being obvious...
- userbinator 7y agoA 20 line function is suddenly 100 lines. ...and what's worse, that then gets broken up into smaller functions containing equally trivial-but-bloated code, and now you need to jump around even more to understand something that's actually very simple. At the extreme end of the terseness scale are the APL-family languages, and the people who work with them have no problems reading or writing code like this: https://code.jsoftware.com/wiki/Essays/Incunabulum https://code.jsoftware.com/wiki/Essays/Incunabulum I think it really says something about the state of software development when you consider that a not-insignificant number of people who are perfectly fine with that level of density (and they are making $$$$), and yet there are others who will complain that even K&R's style is not verbose enough. IMHO it's a matter of education and attitude.