How important is it in my coding in all my function headings to add the "As Integer" or "As String" or whatever it's going to be?
So far I've NEVER used this in dozens and dozens of functions, and I've never had a problem (that I'm aware of).
- Is it just for my own benefit/clarity?
- Or is it more useful and important than that?
- Does it force type, such as boxing an intrinsic value? (Am I even saying that right?!)
- Is this something that would help eliminate Type mismatch errors, or could it lead to more of them?
... For example: returning invalid instead of a real Integer when method is "as Integer" will crash -- making it clear that the incorrect type was returned from that specific method. Otherwise you could end up seeing the crash in some other code that relies on the poorly behaving function and have to trace it back to the source yourself.
function celsius_to_fahrenheit(C as float) as floatSeems pretty clear, right - float enters, float exits - could not be anything else. And the executor will keep you honest - if something else tries to enter/exit, it will sound the alarm. Which is better than getting some weirdness happen (not even runtime error) five minutes later and thousands of lines away.
I've never had a problem (that I'm aware of).