At 11:04 8/10/2004 -0500, you wrote:
>Wow. Three responses. Three different opinions. No wonder the other
>developer and I don't agree. ;)

Look at it worst case scenario.  You have a function that formats phone
numbers.  Think of how many function calls you will make.

         output = MyFormater.formatPhoneNumber(myVar);
         System.out.println(output);

*Checks to make sure the return string is proper.
------------------------
format phone number
return output
check output, if it returns a 0 then you have to do this outside the
function too.
reinput myvar.
format phone number
return output
check output
display output

*Returns a blank string
-----
format phone number
if input is not as expected return blank
display output

*Return a blank with error checking before
----
check myVar
format phone
return output
display output

****
What are you going to do if myVar is incorrect?  Abort the whole instance
of the object?  If not, then can you ask the user to reinput?
If not, what can you return?  Then might as well be an empty string which
means this call is extraneous too.

My personal opinion is no data is better then bad data.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to