Group: comp.lang.fortran · Group Profile
Author: Paul van DelstPaul van Delst Date: Nov 27, 2006 08:19
David Flower wrote:
> I have in my time had to deal with a lot of legacy code, and could make
> quite a few unkind comments about it. But I am interested in how others
> feel.
>
> Well, I'll kick off with:
>
> Users who, finding a new language feature (often peculiar to the
> particular compiler/operating system they are using) use it in
> preference to a perfectly standard method of doing things, despite the
> fact that their approach presents no possible advantage.
Two things: Coding guidelines and code reviews.
Specify "no compiler specific extensions" in your coding guidelines. That's a pretty
simple one that most people will accept given that every man and his dog has a different
setup (platform, compiler, etc).
As for the second point (using a feature when there is no obvious advantage), the coder
should justify the approach in the review when you ask him/her. *But*, since you intimate
that a "new language feature" is non-standard (according to...?), good luck trying to get
them to change "back". :o) And by that I mean a valid answer to your question in the code
review could be:
"I find the new construct to be more X"
where X could be any of
a)intuitive
b)easily understood
c)maintainable
d)extensible
e)
Or any combination thereof.
Who are we to deprive someone of, for e.g. SELECT CASE, because we prefer IF..THEN, when
they can justify the use of the former?
cheers,
paulv
--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|