Rik's Ramblings

Thursday, July 13, 2006

typedef int MyFooingType

typedef int MyFooingType;
#define MyFooingFirst 0x0001
#define MyFooingSecond 0x0002

Why oh why oh why do people do that!?

If you're going to go to the trouble of defining a type for your function parameters you might as well go that little step farther and make it a frigging enum, so those of us who need to use your code have a cat in hells chance of knowing what values are allowed in the damned parameter.

Oh, it's OK you say, because the #defines are right there next to the typedef but to you I have to say NO!. Type telling that to my IDE when it's trying to autocomplete variable values and it can't.

Just for the record:

typedef enum
MyFooingFirst = 0x0001,
MyFooingSecond = 0x0002
} MyFooingType;


Post a Comment

<< Home