S
Stefan Ram
Is it acceptable to use uppercase typedef names, like
typedef struct alpha { int beta; } * ALPHA;
? After all, there is preceding practice in the standard,
where we have the uppercase name »FILE«, which - as I
understand it - might have been typedef'd (doesn't have
to be a macro). This also hides the implementation detail,
whether the type name is a macro or a typdef name.
I believe »_t« is more recent, so would this be better:
typedef struct alpha { int beta; } * alpha_t;
? What I actually did, was to use this in a class:
typedef struct alpha { int beta; } * alpha;
And later even:
void example( alpha const alpha )
{ /* Here, "alpha" always is the parameter name, not the type name. */ }
. I just wanted to show that this is /possible/, not that it
always is the best style, but the students seem to be (mildly)
confused by this, so I consider using other names than three
times »alpha« with three different meanings.
typedef struct alpha { int beta; } * ALPHA;
? After all, there is preceding practice in the standard,
where we have the uppercase name »FILE«, which - as I
understand it - might have been typedef'd (doesn't have
to be a macro). This also hides the implementation detail,
whether the type name is a macro or a typdef name.
I believe »_t« is more recent, so would this be better:
typedef struct alpha { int beta; } * alpha_t;
? What I actually did, was to use this in a class:
typedef struct alpha { int beta; } * alpha;
And later even:
void example( alpha const alpha )
{ /* Here, "alpha" always is the parameter name, not the type name. */ }
. I just wanted to show that this is /possible/, not that it
always is the best style, but the students seem to be (mildly)
confused by this, so I consider using other names than three
times »alpha« with three different meanings.