M
Mark
Hello
reading the article
http://www.ibm.com/developerworks/power/library/pa-ctypes4/index.html?S_TACT=105AGX16&S_CMP=EDU
by Peter Seebach, I stuck with his disapproval of typedef'ing bytes or
words.
Quoting:
"...many programmers will come up with typedefs with names such as "byte" or
"word," then use those for everything, and change only the typedefs when
going to a new platform. This is an exceptionally bad idea.
It might not seem immediately obvious why this is such a bad idea. Part of
the problem is that why it's a bad idea depends on how you're using it. If
you're using "word" to refer to "an object that is exactly the native word
size of our first platform," then on other platforms, you have a typedef
"word" that represents something which isn't a native word..."
I don't quite understand his point, what's so wrong about defining bytes or
words in its native representation for *each* platform, except that the
names are quite lame IMHO?
reading the article
http://www.ibm.com/developerworks/power/library/pa-ctypes4/index.html?S_TACT=105AGX16&S_CMP=EDU
by Peter Seebach, I stuck with his disapproval of typedef'ing bytes or
words.
Quoting:
"...many programmers will come up with typedefs with names such as "byte" or
"word," then use those for everything, and change only the typedefs when
going to a new platform. This is an exceptionally bad idea.
It might not seem immediately obvious why this is such a bad idea. Part of
the problem is that why it's a bad idea depends on how you're using it. If
you're using "word" to refer to "an object that is exactly the native word
size of our first platform," then on other platforms, you have a typedef
"word" that represents something which isn't a native word..."
I don't quite understand his point, what's so wrong about defining bytes or
words in its native representation for *each* platform, except that the
names are quite lame IMHO?