Ken Moffat wrote:
On Fri, May 22, 2015 at 05:39:22PM -0500, Bruce Dubbs wrote:
Ken Moffat wrote:
For C-style code, 8 helps show the structure of a long function much
better IMHO.
That's your opinion. Actual research, including my own formal research,
shows differently. Would you like to read my dissertation? The title is
"The Effect of Comment and Code Style on Software Maintenance."
I didn't think so.
Online searching only finds it in Texas,
LOL. I didn't think to search for that!
In the kernel, using a tab length of 8 helps to provide an
indication that maybe you should refactor the code because the line
lengths are becoming excessive. But then, kernel coders do not
normally use a dictionary to help determine function names so
perhaps the context is very different.
For some other projects, with long names, an indentation of 8 is
unwieldy.
Yes, line length matters. So does the number of characters in function and
variable names. Generally, good naming for comprehension uses names that are
8-13 characters long. Too short and the names are confusing. Too long and the
eye has to move to read the name and that slows comprehension. t hlps t nt rmve
vwls t.
If course very short variable names are OK when the scope is very small, say
less than 10 lines.
In any case, IFF a program works correctly, my experience suggests
that the biggest maintenance burden is changing user requirements
or a changing environment (I used to support payroll, very much
subject to statutory changes). And almost any idiot coder can make
a program hard to understand if you piss them off enough.
Or if there are not coding standards or they are not enforced. It's my
experience that readability of code is not taught. Only functionality is
considered and that is a big mistake.
Personally, I still adhere to what I learned in my DP work: "The
great thing about standards is that we have are so many of them."
In other words, pick and choose - particularly appropriate if you
are doing something for pleasure, which is why we are here, but not
appropriate for certain areas such as the military or tick-box
employers, or safety-critical systems. But I do not code for those.
I have. Quite a bit actually.
1. One of my colleagues used to read out some of the advert titles in
the weekly trade rag for jobs in the Thames Valley : "Anal Progs,
Berks" and then she would say "I've got a chance, then" ;-)
LOL.
-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page