Re: question about struct??
- From: "Rob" <iouswuoibev@xxxxxxxxxxx>
- Date: 16 Feb 2006 17:39:35 -0800
Keith Thompson wrote:
Only if you follow as strict convention of using typedefs for pointers
but not for structs. I've never heard of anyone using such a
convention.
Seeing the "*" in the prototype would tell you much more clearly that
the argument is being passed by reference (actually that a pointer is
being passed by value, with the effect of the pointed-to object being
passed by reference).
How does the name "cobject" tell you that it's a pointer type?
The name doesn't tell it: the fact that it's a non-reserved identifier,
does.
Using the name "cobject" rather than "struct v_cobject*" saves you
some typing, but it makes your code more difficult to read.
Reading code isn't reading English. and I find that reading both
requires a different manner of thinking. When reading code, I want to
read code, not a document. So even if I use conventions that make it
not instantly apparent as to what my code does, I think that in the
long run, if someone takes the time to learn said conventions, they'll
have an easier time grasping the code. My coding philosophy is to
condense things into compact units and use contractions and
abreviations as much as I can get away with, as this makes the code
easier to retain conceptually when thinking about it It's harder to
read at first glance, but easier to recall later.
Anyway, I think I almost drifted off-topic there.
.
- References:
- question about struct??
- From: ma0001yu
- Re: question about struct??
- From: Rob
- Re: question about struct??
- From: Keith Thompson
- Re: question about struct??
- From: Rob
- Re: question about struct??
- From: Keith Thompson
- Re: question about struct??
- From: Rob
- Re: question about struct??
- From: Keith Thompson
- question about struct??
- Prev by Date: Re: How to tokenize string without using strtok
- Next by Date: Re: Waring about pointers
- Previous by thread: Re: question about struct??
- Next by thread: Re: question about struct??
- Index(es):
Relevant Pages
|