Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Thoughts after reading the thread: "How to elegantly get the enum code"

Thread Tools

Thoughts after reading the thread: "How to elegantly get the enum code"

Posts: n/a
Alf P. Steinbach wrote in thread "Are unsigned integers necessary?":

> Anyway, that said, for a quick summary & explanation of C++
> signed/unsigned issues, with some concrete program examples, see my
> ~last post in the aforementioned "How to elegantly get the enum code
> from its string type" thread; in a threaded view it's nearly the last
> article article in that thread.

I like your summary. I think it generated some, not all, of my thoughts
that follow.

I remember a similar thread from 3 to 5 years ago. Some "Le Champagne"
guy was arguing for doing what seems natural: use unsigned when negative
numbers don't make sense for the usage in the context of the application.
Having had always done that, I questioned back then if I was doing
something wrong by adhering to that principle also since other were
saying that was "wrong". After reading all of the thread you directed to
above, I have reached the same conclusion as I did back in time: go on
doing what I have always done. No offense to all of you who like to use
signed ints as much as possible or if you were trying to convince someone
that your way is "better".

Some people take it way too far though and categorize the whole issue as
"a newbie problem" when in reality it's a language problem. You may
choose to view C++ as the only reality for the forseeable future and
thereby "build your world around it". That's fine. I, OTOH, look forward
to the day when my code moves to a language more or less devoid of such
weak foundation and then all the litter in the code can be thrown out and
look nice. Until then, it will just have to be a bit messy and deal with
the idiosynchracies of C++. If C++ has to be "beaten into submission" to
get it to work, so be it. If using it means source code is ugly, so be
it. If it's a pig, it's a pig. Why put lipstick on it. Not that using
signed, IMO, is prettying anything up though!

Was the thread comprehensive enough for me? No, I'll have to actually
implement it to and then reassess what Java, Ada and C++ are doing, but
my short answer on that now seems to be that C++ and Java both got it
wrong, though I know C++ inherited most of it's problems, and I'm not
sure what Ada has implemented so Ada is what I need to research next. So
while the thread touches on some ancillary issues, it doesn't identify
the problem(s) or give solutions to it(them), though at least I have a
few things to tackle that were IMPLIED in the thread, if not danced

Overall, I think threads like that show what a hodgepodge assemblage of
parts C++ really is. Sure, you can keep that old car going forever. Do
you want to though and is it prudent, are the questions to ask. I guess
if you're making the big bucks based on all that complexity, the answer
is a no-brainer.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to elegantly get the enum code from its string type thomas C++ 73 04-22-2010 05:13 PM
reading hex values elegantly from a datagram Dave Python 2 08-26-2003 05:10 PM
Re: properties + types, implementing meta-class desciptors elegantly? Michele Simionato Python 15 07-25-2003 11:48 PM
Re: properties + types, implementing meta-class desciptors elegantly? Michael Hudson Python 3 07-22-2003 02:06 AM
Active menus: how can I do this elegantly? Ken Fine ASP .Net 0 07-19-2003 04:30 PM