2 ms·
I agree on all your points and I'd like to add that I don't know of any definitive research backing up an optimum line length. The only thing is that you don't
by oblio 13y ago
I agree on all your points and I'd like to add that I don't know of any definitive research backing up an optimum line length. The only thing is that you don't want to be near the extremes - say 40 characters per line or 120 characters per line. Everything in between is acceptable.
80-90-100 characters lines are perfectly readable and also easily diffable/viewable side by side on almost any screen (I hope you're not doing 3-way merges merges on a phone :p).
And thankfully new lines don't cost anything so we can just break up long lines like in this very good example: http://stackoverflow.com/a/903767 http://stackoverflow.com/a/903767, and we can afford better identifiers.
C/C++ people - break the cycle! Make new, human readable, 2000+ style APIs for C. Death to the fputcs of the world!
(IMO symbol versus word is a personal preference thing and has no actual impact on code readability unless I need to re-read the language spec after 6 months of not using the language).
- kibwen 13y agoRust prefers short keywords (e.g. `fn` instead of `function`) specifically to give people more room to write descriptive identifiers while keeping line lengths sane. The style guide also suggests limiting lines of code to 100 characters.