Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

×
User Journal

Chacham's Journal: Mini rant: Stupid constants

Journal by Chacham

I am looking at a stored PROCEDURE as it takes too long to run. Besides the CURSORs, DECODE()s where NVL() should be used, and a UNION, there exists this stupidity up front:

csSpace CONSTANT CHAR(1) :='';
cnZero CONSTANT NUMBER(1) :=0;

How many things can you spot that is just plain wrong with that?

  1. It uses the misunderstanding of Hungarian notation.
  2. It uses Hungarian notation for a constant
  3. The constant is not an uppercase
  4. The contant says what its value is, as opposed to it itself is
  5. It uses CHAR(1) (In Oracle VARCHAR2 there is no benefit to CHAR over VARHAR2)

Why is it that good programmers exist only in forums and newgroups, but not in the real world?

This discussion has been archived. No new comments can be posted.

Mini rant: Stupid constants

Comments Filter:

"Mach was the greatest intellectual fraud in the last ten years." "What about X?" "I said `intellectual'." ;login, 9/1990

Working...