Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Feb 1999 10:30:43 +0100
From:      Ladavac Marino <mladavac@metropolitan.at>
To:        "'mi@aldan.algebra.com'" <mi@aldan.algebra.com>, current@FreeBSD.ORG
Subject:   RE: btokup().. patch to STYLE(9) (fwd)
Message-ID:  <97A8CA5BF490D211A94F0000F6C2E55D09752E@s-lmh-wi-900.corpnet.at>

next in thread | raw e-mail | index | archive | help


> -----Original Message-----
> From:	Mikhail Teterin [SMTP:mi@misha.cisco.com]
> Sent:	Monday, February 01, 1999 9:41 PM
> To:	current@FreeBSD.ORG
> Subject:	Re: btokup().. patch to STYLE(9) (fwd)
> 
> =Whilst the official codebase may be under the control of a select
> =group of committers, the code should be capable of being understood
> by
> =anyone who is reasonably proficient with C.
> 
> Depends on your definition of "reasonably", Mr. Special Counselor...
	[ML]  
	I see no cause for name calling.

	A "Reasonably Proficient" programmer is the one who
	writes correct code.  The one who writes maintainable
	correct code is "Very Proficient".  The one who writes
	well-documented maintainable correct code is a target
	for a marriage proposal :)

	Sadly, few proficient programmers program exclusively 
	in C/C++.  Most of us have bills to pay and switch on
	a drop of a hat from C to PL/I to COBOL to VisualBASIC
	to Perl to FORTRAN to YouNameIt to ...

	And, guess what, none of these languages have the same
	operator precedence as C/C++.  But they all have
	parentheses.  Knowledge of operator precedence as a
	metric of programming proficience--ludicrous.  My brain
	would turn to pretzel if I had to know all the precedence
	rules in all the languages that I daily have to use.

	So, yes, I do use parentheses relying on assocciativity
	only around addition/multiplication.  Logical expressions
	are handled differently in every language--some of them
	do not even have short-circuiting logical operators--thus,
	they will be parenthesized.

	An example that was being thrown around would look like
	this in my code:

	/* the reason for branching */
	if ( (a * b  -  c * d) < (e / f) ) {
		true_part();
	}
	else {
		false_part();
		more_false_part();
	}

	You will have noticed that I put braces around single
	statements.  This has no performance penalty--a reasonable
	compiler will not create a stack frame--and helps in
	maintenance.

	/* copy null-terminated b to a */
	for (pa = a, pb = b; (*pa = *pb) != 0; ++pa, ++pb) {
		/* NOTHING */
	}

	Same thing here--okay, so it is a bit more verbose than
	absolutely neccessary.  The advantage is that the people
	who are not absolutely acquainted with the syntactical
	finesse of the language *can* read it and can actually
	*modify* it without undue hassle.

> That's what is being tirelessly debated for the last several days.
> 
	[ML]  Hopefully we will come to agreement about a
	reasonable metric for programmer proficiency (and
	when I am at that, I can also hope for a jackpot in
	lottery :)

	/Marino
> 	-mi
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-current" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?97A8CA5BF490D211A94F0000F6C2E55D09752E>