Best Multi-Platform Way to Define Standard Types Such as UINT32

M

Malcolm McLean

santosh said:
One common complaint I hear from my colleagues, (who're Java bigots),
in defense of their reluctance to use C, is that it's types are too
few and primitive. I suppose it's a common argument on the bullet
lists of advocates of 4GLs.
Virtually all data consists of either numbers or letters. The exception is
bitstream data which is usually either numbers or letters in some compressed
format.
So you need numbers, characters and bytes. And the ability to build up
higher lever structures from these atoms. Anything else is needed for
machine efficiency, which is often a real concern, but increasingly less so.
 
F

Flash Gordon

Malcolm McLean wrote, On 30/01/07 07:44:
Virtually all data consists of either numbers or letters. The exception is
bitstream data which is usually either numbers or letters in some compressed
format.

I disagree. I still do a lot of work with data which is logically one of
a discrete number of values where the numeric representation used has no
meaning. In fact, I can't think of any tables in the over 300 tables in
a large application that do *not* have something which is an enumerated
type. Yes, they are stored as numbers, but that is just because we can't
store them as anything else.
So you need numbers, characters and bytes. And the ability to build up
higher lever structures from these atoms. Anything else is needed for
machine efficiency, which is often a real concern, but increasingly less so.

No, other types are "needed"[1] for things other than efficiency.
Sometimes they map better to the real world problem that numbers,
characters or higher level structures build on these.

Personally I would have found the addition of a real enumeration type
and Pascal like sub-range types to have been more useful than a lot of
the things such as complex numbers that were added with C99. However, if
I want Pascal (or a derivative of similar language) I know where to find it.

[1] Obviously one can do without them but they are useful.
 
M

Malcolm McLean

Flash Gordon said:
Malcolm McLean wrote, On 30/01/07 07:44:

I disagree. I still do a lot of work with data which is logically one of a
discrete number of values where the numeric representation used has no
meaning. In fact, I can't think of any tables in the over 300 tables in a
large application that do *not* have something which is an enumerated
type. Yes, they are stored as numbers, but that is just because we can't
store them as anything else.
You are right. It is not adequate to treat enums as integers.
Actually, if you think about it, a char is just a special case of an enum.
Personally I would have found the addition of a real enumeration type and
Pascal like sub-range types to have been more useful than a lot of the
things such as complex numbers that were added with C99. However, if I
want Pascal (or a derivative of similar language) I know where to find it.

[1] Obviously one can do without them but they are useful.
There is strong case for a standard defined complex structure, also 3d
vectors / points. However they don't really qualify as atomic types because
you also want to treat the components as scalars for some purposes.

enums are a different kettle of fish. For instance a lot of my data is DNA
or amino acid sequences. I think of it as character data because that is the
conventional representation. However a DNA base is not really a character.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top