Most annoying aspects of C++

M

Michael Hopkins

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'

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
A

al pacino

Michael said:
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 .
 
V

Vaclav Haisman

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.
 
D

Daniel T.

Michael Hopkins said:
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.
 
N

nutty

Daniel said:
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.

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
 
M

Michael Hopkins

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'

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
P

Phlip

Michael said:
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...
 
V

Victor Bazarov

Michael said:
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
 
C

Christopher Benson-Manica

Michael Hopkins said:
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.
 
M

Michael Hopkins

Bullshit!
Looks like someone _does_ want a flame war - maybe to obscure the original
intention of uncovering and discussing the issues themselves?
Doesn't seem to be worth much...


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++.
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.
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.
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.
Example, kindly please.


To do what, for instance?


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'

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
S

Scott McPhillips [MVP]

Michael said:
- 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.
 
M

Markus Schoder

Phlip said:
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.
 
?

=?ISO-8859-15?Q?Juli=E1n?= Albo

Michael said:
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".
 
P

Phlip

Markus said:
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...
 
P

Phlip

Julián Albo said:
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".
 
S

Steve Pope

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
 
?

=?ISO-8859-15?Q?Juli=E1n?= Albo

Phlip said:
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.
 
M

Markus Schoder

Phlip said:
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.
 
?

=?iso-8859-1?q?Kirit_S=E6lensminde?=

Michael said:
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
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top