Re: How can I tell if F is a string or if it is a number?



Pioneer1 wrote:
In computer languages the separation of commentary and code is
absolute. The computer never sees the comments, they are clearly
marked as comments. ...

I very strongly disagree with this, though I am glad to see something
computer-related in this thread, even if it is more a matter of practice
than theory.

Every scrap of code should be written with two audiences in mind, the
compiler and all programmers who will ever read it. The whole program is
commentary on what the program does and how it does it. That does not
just require meaningful identifiers. The structure of the code should
show as clearly as possible what is really going on. Recently designed
programming languages tend to give a lot of weight to aiding human to
human communication in the code.

Explicit comments should only be needed in a few situations, such as
stating preconditions and postconditions for functions. Too many
comments suggest that either the code is not well designed, or that the
comments are junk comments, merely repeating what the code already says.

There are also programs, such as Javadoc, that read and use special
comments.
[http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html]

Most of the commentary on my Java programs is in the code, and a high
proportion of the comments in them are intended for Javadoc, not direct
human reading.

Patricia
.