4 ms·
It feels like a common sentiment that concise code == good code
by dajohnson89 7y ago
It feels like a common sentiment that concise code == good code
- smt88 7y agoThat's true, and Kotlin definitely leans into it, but extremely concise code basically ends up looking like Brainfuck -- lots of symbols jammed together and hard to read.
- driver733 7y agoTo be more precise, I would say that expressive code == good code
- martin1975 7y agoAs long as expressive doesn't mean too terse and somewhat readable to most...lest you commit perl's sins.
- dajohnson89 7y agoYeah. This was the point I was halfheartedly making -- concise code for the sake of concise code is a dogma that needs to go away.
- rongenre 7y agoWell, more to the point - bugs / LOC is remarkably constant in real code across coding languages, so one of the best things you can do is reduce LOC.
- pkolaczk 7y agoYou're missing the fact that the constant factor differs between languages. The density (bugs per LOC) of memory handling bugs is much different in Rust than in C.
- rongenre 7y agoNope. https://softwareengineering.stackexchange.com/questions/185660/is-the-average-number-of-bugs-per-loc-the-same-for-different-programming-languag https://softwareengineering.stackexchange.com/questions/1856...
- pkolaczk 7y agoThe link you gave confirms what I've said here. > The quote is either wrong or outdated. In the second edition, it's on page 521: "Industry average experience is about 1 - 25 errors per 1000 lines of code for delivered software. The software has usually been developed using a hodgepodge of techniques. 1-25 is not a single number - it is a range.
- mjcohen 7y agoAPL may be a counterexample, at least when trying to understand what you have written a few months later.
- ivolimmen 7y agoWell: less code means less bugs doesn't it?