[Tutor] How (not!) lengthy should functions be?
Alan Gauld
alan.gauld at btinternet.com
Sat Apr 18 22:05:51 CEST 2015
On 18/04/15 20:30, boB Stepp wrote:
>> line screens. Actual measurements has shown that function length (within
>> reason!) is not a major factor in comprehension or reliability.
>
> Would not your comments above apply to line length as well?
Actually no.
Research has shown that people's comprehension hits a limit with
lines around 12-15 words long. That's about 70 characters. So
translating that (text based) metric to code means the 80
character limit is still quite sane.
Although I have written code with a limit of 130 chars (on an old VT330
that had a "wide" setting and could print out on a 30inch line printer)...
But there is a reason most books are portrait format and use the
font sizes they do. (and why newspapers use columns). It's the
limits of human comprehensibility. A topic that has been studied
in some depth, not just in CompSci but also in graphics
design, linguistics and journalism.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list