Индусы рулят!
Oct. 5th, 2007 05:53 pmBy 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.
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.