View Single Post
Old Jun 15th, 2006, 7:27 PM   #20
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Quote:
Originally Posted by Sane
However... I understand that void is generally bad practice. I've learned to return (0); instead of voiding a function. Is there any information I am missing, or different sides to that rule of thumb?
Having void functions is fine, but note that almost everything in the C standard library returns whether it failed or succeeded. In languages such as C# this is not the case, that's because if something failed an exception would be raised. Of course if the power went out, the computer is off, and it's likely you'd be able to tell in some kind of manner.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline