Rockbox mail archiveSubject: Re: Read errors
Re: Read errors
From: Robert Hak <rhak_at_ramapo.edu>
Date: Thu, 13 Mar 2003 17:05:53 -0500 (EST)
Just my two bits..
If you are going to use a function, you should understand what it accepts
as arguements and returns as a result. In the end, it is your
responsibility to make the code readable/usable.
I don't feel putting unneeded restrictions helps where one could read the
code itself to understand what is happening.
On Thu, 13 Mar 2003, Mike Holden wrote:
The other option, where the function does not return a boolean, is to make
this more obvious in the if statement, so the above becomes "if (0 !=
somefunction())", which makes the whole thing readable without hidden
macros, and also makes it obvious to the reader of the code that
somefunction() doesn't return a boolean, but an integer instead. That way
it helps the reader who is not intimately familiar with the code, who may
not know (without checking the source for it) that somefunction() returns
0 for success.
> A simple comment may be in place, however.
Indeed. A well placed comment can make a world of difference, especially
when unfamiliar with the code.
+-- --- --- --- --- --- --- --- --- --- --- --- --- --+
| Robert E. Hak < http://phobos.ramapo.edu/~rhak > |
"We live together, we act on and react to, one another; but always and in all
circumstances we are by ourselves."
- Aldous Huxley
Received on 2003-03-13