From owner-freebsd-current Tue Feb 2 01:32:32 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA15226 for freebsd-current-outgoing; Tue, 2 Feb 1999 01:32:32 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from titan.metropolitan.at ([195.212.98.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA15215 for ; Tue, 2 Feb 1999 01:32:27 -0800 (PST) (envelope-from mladavac@metropolitan.at) Received: by TITAN with Internet Mail Service (5.0.1458.49) id <1CLHRCV9>; Tue, 2 Feb 1999 10:34:33 +0100 Message-ID: <97A8CA5BF490D211A94F0000F6C2E55D09752E@s-lmh-wi-900.corpnet.at> From: Ladavac Marino To: "'mi@aldan.algebra.com'" , current@FreeBSD.ORG Subject: RE: btokup().. patch to STYLE(9) (fwd) Date: Tue, 2 Feb 1999 10:30:43 +0100 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > -----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