> -----Original Message----- > From: Mikhail Teterin [SMTP:m...@misha.cisco.com] > Sent: Monday, February 01, 1999 9:41 PM > To: curr...@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 majord...@freebsd.org > with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-current" in the body of the message