Which base?!

I inherit projects from other developers, and I love finding bad code and laughing at it.

- "0" in binary?  or decimal?  or is that 0 in hex?

Work always provides opportunity for memorable conversations.

Because of this code -  

if( ImplementationID == "0" )
parameters[0] = BuildParameter("@ImplementationID", DbType.Int32, 4, 0, ParameterDirection.Input);
else
parameters[0] = BuildParameter("@ImplementationID", DbType.Int32, 4, Convert.ToInt32(ImplementationID), ParameterDirection.Input);

hahahahah
if implementationID == "0"  -> pass hard coded 0
else pass Convert.ToInt(implementationID)

"0" doesn't parse correctly
apparently

blog comments powered by Disqus