dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Read errors

Re: Read errors

From: Robert Hak <>
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 < > |

"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

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy