Oct. 5th, 2007

By using constants, you'd expect to see something like this:

private int error; // The current error code.
// Error masks
...
private static final int ERROR_INVALID_FILENAME = 1024;
private static final int ERROR_INVALID_USERNAME = 2048;
private static final int ERROR_INVALID_PASSWORD = 4096;
...

But no. The original developer wasn't content 'hard coding' the name of the constants and instead decided to use the following.

private static final int ONETHOUSANDANDTWENTYFOUR = 1024;
private static final int TWOTHOUSANDANDFOURTYEIGHT = 2048;

Needless to say, these constants were not commented so to determine what error they actually indicated one had to dig through all of the code.

Profile

viklequick

February 2017

S M T W T F S
   1234
567891011
12 131415161718
19202122232425
262728    

Style Credit

  • Style: (No Theme) for Abstractia by [personal profile] chiming

Expand Cut Tags

No cut tags
Page generated Aug. 16th, 2025 03:33 am
Powered by Dreamwidth Studios