Technology Defenestration

An Oracle Apps DBA's discoveries

Posts Tagged ‘developers’

Is this good coding practice?

Monday, June 28th, 2010

A consultant developer just handed me code with the following exception clause.

EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN 0;
WHEN OTHERS
THEN
RETURN 0;
END XXXXXXXXXXX;

Now, I’m no developer, but what the heck is that point of that mess? Regardless of what exception comes up, always return the same exception code. And if that’s not bad enough, always return 0, meaning everything is OK.

Sigh.

Related Posts Plugin for WordPress, Blogger...