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

Discussion in 'C++' started by DaveB, Apr 17, 2010.

  1. DaveB

    DaveB Guest

    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.
    DaveB, Apr 17, 2010
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Colin Basterfield

    XSLT + XML - design thoughts

    Colin Basterfield, Dec 16, 2003, in forum: ASP .Net
    Colin Basterfield
    Dec 16, 2003
  2. Johanna
    Oct 13, 2004
  3. =?Utf-8?B?RGFuIE5hc2g=?=

    dictionary concept - thoughts on how to do plz!

    =?Utf-8?B?RGFuIE5hc2g=?=, Nov 8, 2004, in forum: ASP .Net
    Nov 8, 2004
  4. =?Utf-8?B?Q3JhaWc=?=

    any thoughts?

    =?Utf-8?B?Q3JhaWc=?=, Dec 20, 2005, in forum: ASP .Net
    Dec 20, 2005
  5. thomas
    Keith H Duggar
    Apr 22, 2010