Re: detect Inf or NaN



Craig Dedo wrote:
"James Giles" <jamesgiles@xxxxxxxxxxxxxxxx> wrote in message
news:CoPUi.286689$ax1.162980@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
....
Of course, the names shouldn't have been so verbose in the first
place. You know they're IEEE functions because of the MODULE
you got them from. You don't need them to carry around that
information in their names.

I strongly disagree. The names of the IEEE procedures and other
named thingos are excellent examples of proper naming practices. They
follow all of the criteria of recommended best practices for
good names. One software development standard, the _OpenVMS
Programming Concepts_ manual, specifically recommends that procedures
that conceptually belong together should share a common prefix. In
OpenVMS terminology, this conceptual grouping is called a "facility".
Each facility in a particular organization should have a unique
prefix and all procedure names should start with the facility prefix.

Excellent advice for languages like C where there are no module
facilities. Indeed, things in Fortran - like external procedures,
COMMON block names, and MODULE names should do so as
well. I can well remember the trouble of designing proper
naming conventions for programs given that procedures and
common blocks were limited to 6 character names. The advice
that things filling up the global namespace need to be carefully
named is hardly a newsflash.

But the contents of a MODULE don't reside in the global namespace.
The issues important for the selection of their names are different.

I mentioned Steve McConnell's _Code Complete: A Practical Handbook
of Software Construction_ yesterday in a different thread. Both
editions of this book have extensive discussions of recommended
practices for choosing good names. They are in 1st ed., ch. 9, "The
Power of Data Names" and 2nd ed., ch. 11, "The Power of Variable
Names". For procedure names, see also 1st ed., sec. 5.2 and 2nd ed., sec.
7.3.

And this was a book written specifically with *Fortran* in mind? Or
is it advice more relevant to writers of languages like C (where it's
valid advice indeed). To be sure, names should be mnemonic for the
thing they name. In a modular language that usually shouldn't need to
include where they came from. It is certainly the case that how you
write a code for legibility depends a lot on the features and syntax
of the target language. There's no "one size fits all" advice for most
programming issues - including variable naming conventions.

You are also assuming that the source code that references the procedure
names is close to the USE statement for one of the IEEE modules.

Actually I wasn't assuming that. I was assuming that, once ISNAN
is available within the standard I'll not be using any other one.
So, I won't have any difficulty telling what ISNAN is in use no matter
how far from the declarations I get. Ad-hoc tests for ISNAN will
have long been consigned to /dev/null.

Like all forms of communication what you should be concerned with
is what you are trying to tell your reader (listener), and what you can
assume that person already knows. If you keep telling your audience
things already known they tend to tune you out. It's a good idea to
avoid that. This also explains why this very thread is discussing
ways to give these things more manageable names.

[...] Properly written
procedures can run to several pages. [...] Add in data
declarations and proper use of comments and a properly written
procedure could run to 6 - 8 pages.

I wonder how long they'd be if proper length names were used?
:-)

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare


.



Relevant Pages

  • Re: What do I need to use Terminal Server?
    ... It's taken as offered and all good advice. ... I'm starting to see some major modifications to the overall network setup ... Then, based on what I found in #1, I would order the proper hardware ... and software for you - server, workstations, SQL Server if required, ...
    (microsoft.public.windowsxp.general)
  • Dynamic Data binding
    ... I am looking for some quick advice on the methods I'm ... column heads so I can concatenate them into the proper column. ... that is in the proper format, ... it.(sorry I'm a novice...my first job) ...
    (microsoft.public.dotnet.framework)
  • Re: New member
    ... you will have a proper world crusier. ... Joe has some very good advice. ...
    (rec.boats.cruising)
  • Re: Brit facing deportation
    ... though he has broken immigration rules then he needs to pay money out ... I have always found in general if you ask a proper question you get ... proper answers and advice it not sure which direction to go but legal ...
    (misc.immigration.usa)
  • Re: Plagiarism
    ... advice, especially from Rick Lyons, I was able to expedite ... IEEE Xplore. ... Plagiarism, passing off someone else's ideas and ...
    (comp.dsp)