
09-29-2006, 07:08 PM
|
|
Ruler of the graalaxy
|
Join Date: Feb 2005
Location: Great Britain
Posts: 488
|
|
|
I use return on almost every function. I'm used to programming in OO languages and I learned OO in Eiffel where "deign by contract" is a major philosopy. Basically means making sure the function can go ahead with the data it's been given (preconditions) and then making sure it's completed successfully (postconditions) the only real way to implement this in GS is return codes on functions. (Check my associative array class for example)
In GS it's best to use numbers imho for the following reasons:
1) You can use if (function()) {} for functions that return 1 or 0.
2) You can use if (function() > 3) {} and make error checks in a sensible order. E.g. in this case the first 3 errors are acceptable.
3) Comparing strings is more CPU intensive than comparing integers. |
__________________

Coming soon (Hopefully:P)
|
|
|
|