Most annoying aspects of C++

Discussion in 'C++' started by Michael Hopkins, Jun 15, 2006.

  1. Hi all

    We all know that C++ is a cleverly conceived multi-paradigm language that
    sacrifices very little in efficiency for what it delivers in terms of
    type-safety, encapsulation and generic behaviour.

    What I want to ask here is - what are the features that people most dislike
    about it i.e. that:

    - make it more difficult than necessary to implement designs

    - introduce subtle bugs

    - force the developer to think in counter-intuitive ways

    - make managing a software project more troublesome

    - make using or producing libraries inconvenient

    There may be others. I am not talking about subjective things like syntax,
    more concerned with tangible design & software engineering issues.

    Michael


    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

    _/ _/ _/_/_/ Hopkins Research Ltd
    _/ _/ _/ _/
    _/_/_/_/ _/_/_/ http://www.hopkins-research.com/
    _/ _/ _/ _/
    _/ _/ _/ _/ 'touch the future'

    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    Michael Hopkins, Jun 15, 2006
    #1
    1. Advertising

  2. Michael Hopkins

    al pacino Guest

    Michael Hopkins wrote:
    > Hi all
    >
    > We all know that C++ is a cleverly conceived multi-paradigm language that
    > sacrifices very little in efficiency for what it delivers in terms of
    > type-safety, encapsulation and generic behaviour.
    >
    > What I want to ask here is - what are the features that people most dislike
    > about it i.e. that:
    >
    > - make it more difficult than necessary to implement designs
    >
    > - introduce subtle bugs
    >
    > - force the developer to think in counter-intuitive ways
    >
    > - make managing a software project more troublesome
    >
    > - make using or producing libraries inconvenient
    >
    > There may be others. I am not talking about subjective things like syntax,
    > more concerned with tangible design & software engineering issues.
    >
    > Michael
    >
    >
    > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    >
    > _/ _/ _/_/_/ Hopkins Research Ltd
    > _/ _/ _/ _/
    > _/_/_/_/ _/_/_/ http://www.hopkins-research.com/
    > _/ _/ _/ _/
    > _/ _/ _/ _/ 'touch the future'
    >
    > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


    one could be the 'long time' it takes to learn/master .
    al pacino, Jun 15, 2006
    #2
    1. Advertising

  3. Michael Hopkins wrote, On 15.6.2006 8:43:
    >
    > Hi all
    >
    > We all know that C++ is a cleverly conceived multi-paradigm language that
    > sacrifices very little in efficiency for what it delivers in terms of
    > type-safety, encapsulation and generic behaviour.
    >
    > What I want to ask here is - what are the features that people most dislike
    > about it i.e. that:
    >
    > - make it more difficult than necessary to implement designs
    >
    > - introduce subtle bugs
    >
    > - force the developer to think in counter-intuitive ways
    >
    > - make managing a software project more troublesome

    I don't think that either of these is true.

    >
    > - make using or producing libraries inconvenient

    This one is arguable.

    >
    > There may be others. I am not talking about subjective things like syntax,
    > more concerned with tangible design & software engineering issues.
    >
    > Michael


    --
    VH
    Vaclav Haisman, Jun 15, 2006
    #3
  4. Michael Hopkins

    Daniel T. Guest

    In article <C0B6C008.1A409%>,
    Michael Hopkins <> wrote:

    > Hi all
    >
    > We all know that C++ is a cleverly conceived multi-paradigm language that
    > sacrifices very little in efficiency for what it delivers in terms of
    > type-safety, encapsulation and generic behaviour.
    >
    > What I want to ask here is - what are the features that people most dislike
    > about it i.e. that:
    >
    > - make it more difficult than necessary to implement designs
    >
    > - introduce subtle bugs
    >
    > - force the developer to think in counter-intuitive ways
    >
    > - make managing a software project more troublesome
    >
    > - make using or producing libraries inconvenient
    >
    > There may be others. I am not talking about subjective things like syntax,
    > more concerned with tangible design & software engineering issues.


    This has the makings of a flame war. You are asking the people who love
    the language most to dis it... :)

    The "feature" I most dislike is wild pointers. The fact that they can be
    created, and the fact that there is no language facility to track them
    down.
    Daniel T., Jun 15, 2006
    #4
  5. Michael Hopkins

    nutty Guest

    Daniel T. schrieb:

    > In article <C0B6C008.1A409%>,
    > Michael Hopkins <> wrote:
    >
    > > Hi all
    > >
    > > We all know that C++ is a cleverly conceived multi-paradigm language that
    > > sacrifices very little in efficiency for what it delivers in terms of
    > > type-safety, encapsulation and generic behaviour.
    > >
    > > What I want to ask here is - what are the features that people most dislike
    > > about it i.e. that:
    > >
    > > - make it more difficult than necessary to implement designs
    > >
    > > - introduce subtle bugs
    > >
    > > - force the developer to think in counter-intuitive ways
    > >
    > > - make managing a software project more troublesome
    > >
    > > - make using or producing libraries inconvenient
    > >
    > > There may be others. I am not talking about subjective things like syntax,
    > > more concerned with tangible design & software engineering issues.

    >
    > This has the makings of a flame war. You are asking the people who love
    > the language most to dis it... :)
    >


    I think this *is* the right place for this question. The question is
    not to say the language is bad. But how it could made better.

    > > - make it more difficult than necessary to implement designs


    Especially the 'than necessary' part. You need to know the language
    well to know what is actually 'necessary'.


    > The "feature" I most dislike is wild pointers. The fact that they can be
    > created, and the fact that there is no language facility to track them
    > down.


    What is a wild pointer? A raw pointer? Then I say: It is necessary.

    It is not the language, but the programmer who uses the pointer. You
    are free to define any kind of intelligent pointer, even a garbage
    collection. And in fact other have done so for you already.

    Actually I just realized that it is indeed difficult to answer this
    question.
    I have written some points, but then realized, that I proposed new
    features instead of talking about disliked features. So I removed them
    again.

    The things I dislike are indeed syntax issues. But they are explicitly
    excluded here.

    So, which feature could be disliked? If I don't like a feature, who
    forces me to use it???

    Ingo
    nutty, Jun 15, 2006
    #5
  6. On 15/6/06 12:24, in article
    , "Daniel T."
    <> wrote:

    >
    > This has the makings of a flame war. You are asking the people who love
    > the language most to dis it... :)
    >
    > The "feature" I most dislike is wild pointers. The fact that they can be
    > created, and the fact that there is no language facility to track them
    > down.


    Not looking for flame war here but genuine & open debate from people who
    already use it.

    My current list, for what it's worth:

    - slicing & schizophrenic polymorphism

    - what compiler does 'behind the scenes' with no documentation in code

    - the need for virtual destructors

    - error messages from template (i.e. STL) code


    These are more subjective but, I believe, valid and agreed with by others:

    - arcane (sometimes dangerous) semantics in some cases that seem simple

    - when static-typing makes you 'jump thru hoops' to do something simple

    - the need to keep so many concepts & types in mind all at once creates
    unecessary complexity relative to the problem & reduces productivity


    M


    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

    _/ _/ _/_/_/ Hopkins Research Ltd
    _/ _/ _/ _/
    _/_/_/_/ _/_/_/ http://www.hopkins-research.com/
    _/ _/ _/ _/
    _/ _/ _/ _/ 'touch the future'

    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    Michael Hopkins, Jun 15, 2006
    #6
  7. Michael Hopkins

    Phlip Guest

    Michael Hopkins wrote:

    > We all know that C++ is a cleverly conceived multi-paradigm language that
    > sacrifices very little in efficiency for what it delivers in terms of
    > type-safety, encapsulation and generic behaviour.
    >
    > What I want to ask here is - what are the features that people most
    > dislike
    > about it i.e. that:
    >
    > - make it more difficult than necessary to implement designs


    Read my seminal paper on the topic, called "Where in memory do you want to
    accidentally jump today?"

    http://groups.google.com/group/comp.lang.java.programmer/msg/603877533bd360d2
    aka
    http://tinyurl.com/k2kmy

    The replies are also valid, but none of them defeat the main points. C++
    sacrifices much programmer efficiency in exchange for a thin margin of CPU
    efficiency...

    --
    Phlip
    http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
    Phlip, Jun 15, 2006
    #7
  8. Michael Hopkins wrote:
    > On 15/6/06 12:24, in article
    > , "Daniel T."
    > <> wrote:
    >
    >>
    >> This has the makings of a flame war. You are asking the people who
    >> love the language most to dis it... :)
    >>
    >> The "feature" I most dislike is wild pointers. The fact that they
    >> can be created, and the fact that there is no language facility to
    >> track them down.

    >
    > Not looking for flame war here but genuine & open debate from people
    > who already use it.


    Bullshit!

    > My current list, for what it's worth:


    Doesn't seem to be worth much...

    > - slicing & schizophrenic polymorphism


    What's that mean? I am vaguely familiar with the term schizophrenia,
    but how does it apply to polymorphism?

    > - what compiler does 'behind the scenes' with no documentation in code


    Why do you care? And if you do care, couldn't you ask your compiler
    vendor for that? You know, every compiler does different things there.

    > - the need for virtual destructors


    Huh? What's the alternative? Virtual d-tors for every class? Or some
    other RTTI mechanism to slow everything down?

    > - error messages from template (i.e. STL) code


    What error messages? Are you confusing the language design with the
    quality of the iplementation you're using?

    > These are more subjective but, I believe, valid and agreed with by
    > others:
    >
    > - arcane (sometimes dangerous) semantics in some cases that seem
    > simple


    Example, kindly please.

    > - when static-typing makes you 'jump thru hoops' to do something
    > simple


    To do what, for instance?

    > - the need to keep so many concepts & types in mind all at once
    > creates unecessary complexity relative to the problem & reduces
    > productivity


    As opposed to what?

    Here is what I think of your current list
    [
    These are the most annoying aspects of cars, for what it's worth:
    - need gas to run
    - not enough room to carry all my belongings
    - uncomfortable seats
    - short warranty leading to expensive repairs later
    - going too fast often leads to a speeding ticket
    - not enough protection against crashes
    - the need to keep many things in mind at once when driving
    ]

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Jun 15, 2006
    #8
  9. * Phlip:
    > Michael Hopkins wrote:
    >
    >> We all know that C++ is a cleverly conceived multi-paradigm language that
    >> sacrifices very little in efficiency for what it delivers in terms of
    >> type-safety, encapsulation and generic behaviour.
    >>
    >> What I want to ask here is - what are the features that people most
    >> dislike
    >> about it i.e. that:
    >>
    >> - make it more difficult than necessary to implement designs

    >
    > Read my seminal paper on the topic, called "Where in memory do you want to
    > accidentally jump today?"
    >
    > http://groups.google.com/group/comp.lang.java.programmer/msg/603877533bd360d2
    > aka
    > http://tinyurl.com/k2kmy


    You write about C++, "This newsgroup gets a dozen questions per month
    asking how to do something that a scripting language can do".

    Is it really true that they ask C++ questions in cljp?

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, Jun 15, 2006
    #9
  10. Michael Hopkins <> wrote:

    > What I want to ask here is - what are the features that people most dislike
    > about it i.e. that:


    The fact that exception specifications exist, but are essentially
    worthless for the purposes that a reasonable programmer might attempt
    to use them, is not a particularly endearing quality of the language.

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
    Christopher Benson-Manica, Jun 15, 2006
    #10
  11. On 15/6/06 15:15, in article e6rq1m$r8o$, "Victor Bazarov"
    <> wrote:

    >>>
    >>> This has the makings of a flame war. You are asking the people who
    >>> love the language most to dis it... :)
    >>>
    >>> The "feature" I most dislike is wild pointers. The fact that they
    >>> can be created, and the fact that there is no language facility to
    >>> track them down.

    >>
    >> Not looking for flame war here but genuine & open debate from people
    >> who already use it.

    >
    > Bullshit!
    >

    Looks like someone _does_ want a flame war - maybe to obscure the original
    intention of uncovering and discussing the issues themselves?

    >> My current list, for what it's worth:

    >
    > Doesn't seem to be worth much...
    >
    >> - slicing & schizophrenic polymorphism

    >
    > What's that mean? I am vaguely familiar with the term schizophrenia,
    > but how does it apply to polymorphism?
    >

    I'm not certain but I believe the term was coined by one Scott Meyers who
    has some background in C++.

    >> - what compiler does 'behind the scenes' with no documentation in code

    >
    > Why do you care?


    Because all other widely-used languages are self-documenting in this sense.

    > And if you do care, couldn't you ask your compiler
    > vendor for that? You know, every compiler does different things there.
    >

    That is missing the point, I think.

    >> - the need for virtual destructors

    >
    > Huh? What's the alternative? Virtual d-tors for every class? Or some
    > other RTTI mechanism to slow everything down?
    >

    Something like that, yes - to ensure no nasty surprises and allow general
    derivation with an infinitessimal effect on runtime performance.

    >> - error messages from template (i.e. STL) code

    >
    > What error messages? Are you confusing the language design with the
    > quality of the iplementation you're using?
    >

    Possibly, but templates make it difficult to see how the situation can
    improve e.g. the apparent impossibility of implementing template definitions
    in .cpp files and exporting them as defined in the standard many years ago.

    >> These are more subjective but, I believe, valid and agreed with by
    >> others:
    >>
    >> - arcane (sometimes dangerous) semantics in some cases that seem
    >> simple

    >
    > Example, kindly please.
    >
    >> - when static-typing makes you 'jump thru hoops' to do something
    >> simple

    >
    > To do what, for instance?
    >
    >> - the need to keep so many concepts & types in mind all at once
    >> creates unecessary complexity relative to the problem & reduces
    >> productivity

    >
    > As opposed to what?
    >

    If you don't already know what I mean with these then I suspect my thoughts
    are falling on deaf ears.

    M


    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

    _/ _/ _/_/_/ Hopkins Research Ltd
    _/ _/ _/ _/
    _/_/_/_/ _/_/_/ http://www.hopkins-research.com/
    _/ _/ _/ _/
    _/ _/ _/ _/ 'touch the future'

    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    Michael Hopkins, Jun 15, 2006
    #11
  12. Michael Hopkins wrote:
    > - make it more difficult than necessary to implement designs
    > - force the developer to think in counter-intuitive ways
    > - make managing a software project more troublesome


    Manual management of header file includes is a fine example of all three
    of these weaknesses. I would like an option to have the compiler
    analyze the header file and include as necessary, in the necessary order.

    --
    Scott McPhillips [VC++ MVP]
    Scott McPhillips [MVP], Jun 15, 2006
    #12
  13. Phlip wrote:
    > Michael Hopkins wrote:
    >
    > > We all know that C++ is a cleverly conceived multi-paradigm language that
    > > sacrifices very little in efficiency for what it delivers in terms of
    > > type-safety, encapsulation and generic behaviour.
    > >
    > > What I want to ask here is - what are the features that people most
    > > dislike
    > > about it i.e. that:
    > >
    > > - make it more difficult than necessary to implement designs

    >
    > Read my seminal paper on the topic, called "Where in memory do you want to
    > accidentally jump today?"
    >
    > http://groups.google.com/group/comp.lang.java.programmer/msg/603877533bd360d2
    > aka
    > http://tinyurl.com/k2kmy
    >
    > The replies are also valid, but none of them defeat the main points. C++
    > sacrifices much programmer efficiency in exchange for a thin margin of CPU
    > efficiency...


    Care to explain why the TopCoder algorithm competitions are then
    completely dominated by C++ (3 of the top 20 coders use something else
    than C++)?

    These contests focus solely on programmer efficiency i.e. who
    implements a working algorithm for a given problem in the shortest
    time. Run-time performance is mostly irrelevant.
    Markus Schoder, Jun 15, 2006
    #13
  14. Michael Hopkins wrote:

    > What I want to ask here is - what are the features that people most
    > dislike about it i.e. that:

    (snip)
    > - force the developer to think in counter-intuitive ways


    I think that for a bunch of people the worse part is just "force the
    developer to think".

    --
    Salu2

    Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
    =?ISO-8859-15?Q?Juli=E1n?= Albo, Jun 15, 2006
    #14
  15. Michael Hopkins

    Phlip Guest

    Markus Schoder wrote:

    > Care to explain why the TopCoder algorithm competitions are then
    > completely dominated by C++ (3 of the top 20 coders use something else
    > than C++)?


    That represents small unscaled programs, written using fire-and-forget
    techniques, right?

    In general this is a Stockholm Syndrome situation. If you have been abused
    enough, you reliably blame yourself and not the abuser...

    --
    Phlip
    http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
    Phlip, Jun 15, 2006
    #15
  16. Michael Hopkins

    Phlip Guest

    Julián Albo wrote:

    > I think that for a bunch of people the worse part is just "force the
    > developer to think".


    Right - force them to think about things unrelated to the current task.

    The best accolade a programming language could get here would be "stays out
    of your way".

    --
    Phlip
    http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
    Phlip, Jun 15, 2006
    #16
  17. Michael Hopkins

    Steve Pope Guest

    Daniel T. <> wrote:

    > Michael Hopkins <> wrote:


    >> What I want to ask here is - what are the features that people
    >> most dislike about it


    > This has the makings of a flame war. You are asking the people
    > who love the language most to dis it... :)


    > The "feature" I most dislike is wild pointers. The fact that
    > they can be created, and the fact that there is no language
    > facility to track them down.


    Well, relative to C, C++ is featureful enough that you can
    get by without a lot of pointer usage. The standard containers,
    and all the features involving references help alot.

    To answer the original question, my observation -- I can't really
    call it a complaint -- is that C++ really depends on a
    certain specific model of how things link, but this is abstracted
    into a set of superficially unrelated language features.
    It's not a bad thing however.

    Steve
    Steve Pope, Jun 15, 2006
    #17
  18. Phlip wrote:

    > The best accolade a programming language could get here would be "stays
    > out of your way".


    The best will be want a programming language that have just an instruction:
    do_want_i_want_now_fast

    In the meantime, you can hire a programmer.

    --
    Salu2

    Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
    =?ISO-8859-15?Q?Juli=E1n?= Albo, Jun 15, 2006
    #18
  19. Phlip wrote:
    > Markus Schoder wrote:
    >
    > > Care to explain why the TopCoder algorithm competitions are then
    > > completely dominated by C++ (3 of the top 20 coders use something else
    > > than C++)?

    >
    > That represents small unscaled programs, written using fire-and-forget
    > techniques, right?


    Pretty much yes. It often requires modelling of fairly complex data
    structures though.

    There is also a category called marathon matches that focuses on larger
    scale problems and gives participants several days for implementation.
    Also completely C++ dominated.

    > In general this is a Stockholm Syndrome situation. If you have been abused
    > enough, you reliably blame yourself and not the abuser...


    Given that according to the TIOBE index Java is the single most active
    programming language and gaining quickly and most TopCoder participants
    are students you might want to rethink your line of argumentation.
    Markus Schoder, Jun 15, 2006
    #19
  20. Michael Hopkins wrote:

    > What I want to ask here is - what are the features that people most dislike
    > about it


    To me the single biggest problem is also what allowed it to get adopted
    so quickly and that is C libraries.

    To me, when I'm writing C++ a 'new' is just about acceptable but a
    'delete' really isn't. I've had to work with too many APIs and
    libraries that are designed for C and they're always a nightmare.

    There are some other things I would like to see, a stronger version of
    'typedef' which isn't just a synonym. And I'd like some better template
    features so that I can do even more with them, but those are tiny
    problems compared to interoperating with C libraries/APIs.


    K
    =?iso-8859-1?q?Kirit_S=E6lensminde?=, Jun 15, 2006
    #20
    1. Advertising

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. Jeroen Budts

    Aspects for a businessSession

    Jeroen Budts, Apr 18, 2005, in forum: Java
    Replies:
    0
    Views:
    362
    Jeroen Budts
    Apr 18, 2005
  2. Dr. Peer Griebel

    Partial Classes - Aspects

    Dr. Peer Griebel, Jul 29, 2006, in forum: Python
    Replies:
    0
    Views:
    264
    Dr. Peer Griebel
    Jul 29, 2006
  3. Charles Xavier
    Replies:
    11
    Views:
    830
    Arash Partow
    Jun 18, 2008
  4. dave
    Replies:
    2
    Views:
    86
    Gene Tani
    Jun 2, 2006
  5. Mario T. Lanza
    Replies:
    1
    Views:
    76
    Mario T. Lanza
    Aug 26, 2007
Loading...

Share This Page