Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Whether to return String "True" or "False" instead of 1 or 0

Whether to return String "True" or "False" instead of 1 or 0

From: CrazyKarma <skalki_at_gmail.com>
Date: Thu, 16 Aug 2007 11:51:43 -0700
Message-ID: <1187290303.144651.126490@q3g2000prf.googlegroups.com>


One of the developers had written a function such that it returns a string value as either "True" or "False", which was again used in a sql context with a decode statement wrapped around it to do something else.

During code review, I called it out and said that its better to have that return a int as 1 or 0, so that its flexiable in future to return more values and also put to a comment to say what each value stands for.

Developer disagreed saying that his method is more readable and either way we will have to change the code if we have to make it return different values in future.

I agree that the code is more readable but extent of change presuming that the data fetched may be different in future is less with my change.

also believe string equality checks is exposed to case sensitivity issues.

what do you all think? Received on Thu Aug 16 2007 - 13:51:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US