Subject: Re: Time to update KNF?
To: Ted Lemon <mellon@isc.org>
From: Greywolf <greywolf@starwolf.com>
List: tech-kern
Date: 01/19/2000 22:40:43
On Tue, 18 Jan 2000, Ted Lemon wrote:

# The real problem with 8-position tabbing is that it virtually requires
# you to use terse variable and function names.   Some people like
# that.   Personally, I find it annoying, because it means I have to
# keep things in my head that don't need to be in my head.   So I'd
# rather code like this:
# 
# void check_for_error (parse)
#      struct parse *parse;
# {
#   if (parse -> error_code != success)
#     {
#        parse_error_count++;
#     }
# }
# 
# Than:
# 
# void cfe (p)
#      struct prs *p;
# {
# 	if (p->err != OK) {
# 		++errs;
# 	}
# }
# 
# The reason for the tradeoff I describe above doesn't get obvious until
# you have two more levels of nesting, but if you do have two more
# levels of nesting, you quickly get to the point where you're coding
# like this:
# 
# 							check_for_error (
# 								current_parse);

actually, it would be:
							cfe(prs);
							
# 
# Yes, that's seven levels of indents, but if you try to do goto-less
# programming, it's _very_ easy to get to seven levels of indents - two
# loops and a couple of conditionals and you're whacked up against the
# right margin, doing one line per variable.   Yuck.

Well, I agree with that, but...

The verbose_function_names(), (highly_descriptive_typedef_ts) and
natural_language_oriented variable names can take their own handbasket,
thank you very much.  It's possible to reach a readable medium
which isn't quite as terse as cfe(prs) without being quite so blathering
as check_for_error(current_parse).

Something like

chkparse(curparse);

works for me.  Obviously, our mileages vary :-D.

Equally, I think I'd puke if braces were always on the subsequent line
AND indented.  One or the other, but not both.

Sorry if this is a waste of bandwidth, but I hardly think that
it's out of vogue in this thread to state one's opinion, however
unpopular it may seem.

As one of us keeps saying, "de gustibus non est disputandum."  Or
something pretty close to it.

# 
# 			       _MelloN_
# 
# 


				--*greywolf;
--
NetBSD: "Progress on your system is closer than it appears."