Does C++ "dumb-down" programmers?

D

dragan

The question stems from the features of C++ that were developed by others
rather than the users of those features and the users not understanding the
underlying concepts. Case in point: C++ exceptions. The "rich"
implementation of that is not only a bit much for novices/wannabes, but also
concealer. Again, I don't know what they teach in a C++ programming course,
but USAGE is HARDLY the problem, IMO. UNDERSTANDING the underlying
principles and HISTORY of the mechanisms (D&E should be requisite reading
within the course, amongst other RESEARCH) is MUCH more important. I think
that the concept of "entry-level C++ programmer" is ill-fated at best and an
oxymoron at worst. All comments welcome.
 
W

werasm

IMO. UNDERSTANDING the underlying
principles and HISTORY of the mechanisms (D&E should be requisite reading
within the course, amongst other RESEARCH) is MUCH more important.

It depends whether ones domain of expertise is programming itself or
whether one just intends to use programming as a tool. One can
certainly get quite far without knowing all the underlying concepts.
Is that not the whole point of encapsulation - providing an easy
interface with concise responsibilities for the part in order to
reduce complexity of the whole?

Regards,

Werner
 
R

Rui Maciel

dragan wrote:

Again, I don't know what they teach in a C++ programming course,
but USAGE is HARDLY the problem

The C++ programming language is vast and it takes a lot of time and practice to
wrap any novice's head around it. As a natural consequence, it isn't possible to
touch every aspect of the core language, let alone the STL, in a regular, one
semester course.

Adding to that, some programming courses are even more limited than that. Some
engineering courses (non-IT/CS) include an "introduction to programming" class
where they have adopted C++ as their programming language but also try to wedge in
some other tool, such as matlab, into their curriculum. So, if you get less than
half the time span to introduce a complex and vast programming language such as C++
to complete newbies who just found themselves para-dropped right in the middle
programming world then it's perfectly natural that you get a lot of people who are
writing C++ programs but don't quite get some of it's fundamental aspects, such as
exception handling.

And of course, don't forget autodidacts. You always miss a thing or two when you
are self-taught.


Rui Maciel
 
V

Vladimir Jovic

dragan said:
The question stems from the features of C++ that were developed by others
rather than the users of those features and the users not understanding the
underlying concepts. Case in point: C++ exceptions. The "rich"
implementation of that is not only a bit much for novices/wannabes, but also

That is for compiler writers. A programmer can choose to use them or not.
concealer. Again, I don't know what they teach in a C++ programming course,

So, you are a "wannebe"?

within the course, amongst other RESEARCH) is MUCH more important. I think
that the concept of "entry-level C++ programmer" is ill-fated at best and an
oxymoron at worst. All comments welcome.

Why? It would be good if people were born as experts and all-knowing,
but unfortunately it doesn't happen.
 
S

Stefan Ram

werasm said:
It depends whether ones domain of expertise is programming itself or
whether one just intends to use programming as a tool. One can
certainly get quite far without knowing all the underlying concepts.

Professional programming involves /reading/ source code
more often than /writing/ source code. And when reading source
code others have written, it is not possible to restrict
oneself to only a »beginner's subset of C++«.

I deem it to be wrong to use C++ as a language for teaching
programming to those pupils/students who only about 300
hours or less to learn programming. (While the language
might be the right one for some professional programmers.)

Teaching C++ to pupils/students with only about 300 hours or
less to learn programming is a wast of time and indeed
creates "dumbed-down" "programmers".

»C++ is a horrible language. It's made more horrible by
the fact that a lot of substandard programmers use it (...)

I've come to the conclusion that any programmer that would
prefer the project to be in C++ over C is likely a
programmer that I really *would* prefer to [move on], so
that he doesn't come and [disturb] any project I'm involved
with. (...)«

Linus Torvalds

But the C++ »hype« might be over.

1 = Java 18 %
2 = C 17 %
3 ^^ PHP 10 %
4 v C++ 10 %
5 v VB 8 %

Tiobe Community index for November 2009
 
B

Balog Pal

Stefan Ram said:
But the C++ »hype« might be over.

1 = Java 18 %
2 = C 17 %
3 ^^ PHP 10 %
4 v C++ 10 %
5 v VB 8 %

Tiobe Community index for November 2009

Heh. Anyone has a clue how Tiobe count the "number of skilled engineers
world-wide" this index is supposedly based on?
"The popular search engines Google, MSN, Yahoo!, Wikipedia and YouTube are
used to calculate the ratings."

And how those help here? Even if they actually work -- as we know Google
usenet search is broken for like a year now.
 
W

werasm

  Professional programming involves /reading/ source code
  more often than /writing/ source code. And when reading source
  code others have written, it is not possible to restrict
  oneself to only a »beginner's subset of C++«.

In my opinion people that eventually end up programming in C++ don't
[necessarily] begin programming in C++. Also, I would imagine that
people that program professionally in C++ and have to maintain code
would have reached a certain level of expertise (by writing their own
code). If this is the case, then reading of (more advanced) code
should interest them - perhaps even excite (and not scare them off).
This is certainly so in my own case.
  I deem it to be wrong to use C++ as a language for teaching
  programming to those pupils/students who only about 300
  hours or less to learn programming. (While the language
  might be the right one for some professional programmers.)

I don't necessarily disagree, but it being a multi paradigm language,
has more to offer in terms of skills than other languages. One can
certainly teach the same concepts without requiring that the student
needs to read obscure code. You might end up with a more complete
programmer...
  Teaching C++ to pupils/students with only about 300 hours or
  less to learn programming is a wast of time and indeed
  creates "dumbed-down" "programmers".

It depends what the students are studying. If they want to become
programmers, give them C++ (and you have to start somewhere). If they
want to use programming in their domain (secondary), give them
something else (Python, Java etc).
      »C++ is a horrible language. It's made more horrible by
      the fact that a lot of substandard programmers use it (...)

      I've come to the conclusion that any programmer that would
      prefer the project to be in C++ over C is likely a
      programmer that I really *would* prefer to [move on], so
      that he doesn't come and [disturb] any project I'm involved
      with. (...)«

Ha hah... I've found the contrary to be true. In all the projects I've
worked on (and maintained), if there is a problem - I usually do a
search for all memcpy, strncpy, strcpy and sprintfs (and all other C
functions, for than matter) and I replace these with C++ counterparts.
I search for arrays and replace them with vectors and I wrap pointers
with smart pointers - and wholla, problem solved (most often). The
problem is rather that many engineers think they know "C", and then
use a C++ compiler (and call themselves C++ programmers). I would say
"C" is your culprit... Mr Linus. Admittedly it is possible to write
good code in both C and C++ (but the latter (certainly concerning OOP)
naturally supports more paradigms).
  But the C++ »hype« might be over.

        1 =  Java 18 %
        2 =  C    17 %
        3 ^^ PHP  10 %
        4 v  C++  10 %
        5 v  VB    8 %

I'm amazed to not find Perl, Python and C# there...

Regards,

Werner
 
R

rabbits77

Stefan said:
Professional programming involves /reading/ source code
more often than /writing/ source code. And when reading source
code others have written, it is not possible to restrict
oneself to only a »beginner's subset of C++«.

I deem it to be wrong to use C++ as a language for teaching
programming to those pupils/students who only about 300
hours or less to learn programming. (While the language
might be the right one for some professional programmers.)

Teaching C++ to pupils/students with only about 300 hours or
less to learn programming is a wast of time and indeed
creates "dumbed-down" "programmers".
In order to be a good or great C++ programmer you
need to be a bad
C++ programmer first. Probably it is better that the
"bad" phase happen in school and not the job, right? :)
Programming in any language takes years to become
truly proficient. Don't believe any language hypers
that say otherwise.
I was reading an Ada book the other day. While
I am sure I could write a working Ada program
right now only a crazy person would say that
it would be as good as if I had been using Ada for
years.
This whole idea that if you know one programming
language well you can pick another up and be good at
it in a short amount of time has always bothered me.
Then again, perhaps I have used more
languages than the people that popularize this idea.
:)
 
P

peter koch

dragan wrote:



The C++ programming language is vast and it takes a lot of time and practice to
wrap any novice's head around it. As a natural consequence, it isn't possible to
touch every aspect of the core language, let alone the STL, in a regular, one
semester course.

I do not believee that to be true. If you are a programmer, what
corresponds to a one semester course is more than enough time to
become familiar with C++. If you know C (which is my own background),
you can be productive in C++ in about a week and you will become
selfsupporting in less than one month.
[snip]
And of course, don't forget autodidacts. You always miss a thing or two when you
are self-taught.

Why? There are many of us here who never learnt C++ in the University.
Remember that C++ is a rather new language with an ISO standard as
recent as 1998. My guess is that many universities did not start
teaching C++ before around that time.

/Peter
 
E

Elinor Spears

It is not so much how popular a language is, rather how productive one gets
out of a programming language matters. Good places to look for statistics
would be Baylor Online (acm.uva.es) or TopCoder (topcoder.com). BTW, a good
number of industry strength software are written in C/C++. That includes
industry revolutionizing file sharing program that hogs a huge portion of
internet bandwidth!
 
R

Rui Maciel

peter said:
I do not believee that to be true. If you are a programmer
<snip/>

The C++ programming language, when it's adopted by a course, is usually taught to
1st or 2nd year students. Your typical 1st and 2nd year student is not a
programmer, let alone in courses other than CS/IT.

Moreover, languages tend to be included in university courses not for the sake of
teaching the language but to teach programming concepts. So, for example, if you
aim to teach object-oriented programming then, if you use C++ to achieve that,
details such as exception-handling and the STL are naturally left off.

Why? There are many of us here who never learnt C++ in the University.
Remember that C++ is a rather new language with an ISO standard as
recent as 1998. My guess is that many universities did not start
teaching C++ before around that time.

And some code out there clearly shows that.


Rui Maciel
 
P

peter koch

<snip/>

The C++ programming language, when it's adopted by a course, is usually taught to
1st or 2nd year students. Your typical 1st and 2nd year student is not a
programmer, let alone in courses other than CS/IT.

Moreover, languages tend to be included in university courses not for the sake of
teaching the language but to teach programming concepts. So, for example, if you
aim to teach object-oriented programming then, if you use C++ to achieve that,
details such as exception-handling and the STL are naturally left off.

I don't disagree with you here, but this is not what we are
discussing. We discuss how long time it takes to learn C++, not how
long time it takes to learn to program.
I believe my claim still stands: you can learn enough C++ to be
productive in less than one week, and you can be selfcontained in one
month.

/Peter
 
B

Balog Pal

peter koch said:
I don't disagree with you here, but this is not what we are
discussing. We discuss how long time it takes to learn C++, not how
long time it takes to learn to program.
I believe my claim still stands: you can learn enough C++ to be
productive in less than one week, and you can be selfcontained in one
month.

Guess by "productive" you mean that you can punch out lines that compile,
and will cause as many days for other people to clean up defects as minutes
you spend working?
 
P

peter koch

Guess by "productive" you mean that you can punch out lines that compile,
and will cause as many days for other people to clean up defects as minutes
you spend working?

Not at all. I don't believe I spent more than one week learning C++ to
a degree that I was productive. That week was spent reading D & E and
another book by Stroustrup, looking at some of the code my new company
was producing and toying a bit around with what would become working
code.
C++ was not my first language; I came from a C project and had read a
few papers on object oriented programming (but insofar as I remember
none about C++).
I was not 100% productive after week one, but I was close to 100%
after one month (not needing any more help on C++ than could be
discussed during lunch).

/Peter
 
J

James Kanze

Guess by "productive" you mean that you can punch out lines
that compile, and will cause as many days for other people to
clean up defects as minutes you spend working?

Not so much that, as "as productive as you would be in something
like C". You certainly won't be writing idiomatic C++ after
just a week, even with a lot of experience in other languages.
The fact that your C++ isn't idiomatic, however, and doesn't use
many features of the language, doesn't mean that it is not
maintainable---there's an old saw that "real programmers can
write Fortran in any language", but the reverse is true as well:
a good programmer will write clean code in any language,
including a very reduced subset of C++. (One of the cleanest,
best written programs I ever saw was in Fortran IV.)

Of course, this "productive" doesn't necessarily mean that you
will be productive in every environment. If you've not see
exceptions before, I don't think you'd be writing exception safe
code after just one week. And in no way would one be able to
successfully use other important new features.
 
B

Balog Pal

James Kanze said:
Not so much that, as "as productive as you would be in something
like C". You certainly won't be writing idiomatic C++ after
just a week, even with a lot of experience in other languages.
The fact that your C++ isn't idiomatic, however, and doesn't use
many features of the language, doesn't mean that it is not
maintainable

Of course it is not necessary. Just as there are winners on lottery too, you
can't rule out beforehand that buying a ticket is a poor investment...
---there's an old saw that "real programmers can
write Fortran in any language", but the reverse is true as well:

My RL experience is pretty sour, with long-time C users coming to C++. For
junoirs I'm the fan of tech that teaches C++ without C -- and on the average
level C exposition hurts more than helps.

For too many problems the C++ way differs drastically from the C way. And
in a properly shaped application the injected C-stlye code will introduce
problems.
a good programmer will write clean code in any language,
including a very reduced subset of C++.

Yes. Eventually. Not in 1 week. Just like with spoken language -- if
pressed one can learn basic interactive communication fast (where he can
manage everyday use cases). But if you have sophisticated thoughts and want
to express them precisely, that is far away. If ever happens. I'm using
English for what, 20 years? Read a ton of books, no problem, but still
struggle with stating what I want.

Certainly "productive" is not the same as "perfect" just to map back to the
original thread.
Of course, this "productive" doesn't necessarily mean that you
will be productive in every environment.

We didn;t yet see the answer to how "prodictive" is being measured. So
possibly speaking about different completely different things.

Peopleware and similar books write about the effect of adding manpower to a
late project -- that makes it even later. Getting productive in a new
project takes a plenty of time by itself. A realistic HR view is that the
*properly* selected new guy will gain 0-saldo in like half a year. Or one
year.

At my last workplace I had knowledge and experience that exceeded the sum of
all the other members put together. With weighted measure probably several
times. Yet I'm quite sure my net productivity was in the negatives for ~ 2
months.

So I keep my sceptical view on productivity when someone doesn't even know
the language -- and that is not a tuned one like python.

OTOH, for the same effect the effort of learning the language itself --
along with the other things in NOT necessarily a drain on the productivity,
if we measure it on the whole project, or picking a long time period.
Like Joel suggests in his HR articles, to go for bright people who can and
want to learn, instead of presence of stock knowledge of something.

So to sum it up, I do not doubt that someone just starting C++ can be net
productive in a project (having a proper environment), my problem is with
the statement that it happens early on, especially in a 1-week timeframe.
That doesn't have just the raw time to read the 6-7 essential books let
alone understand, distill and internalize.
If you've not see
exceptions before, I don't think you'd be writing exception safe
code after just one week.

My experience (and reading about others') suggest that changing methods is
damn hard. Even in case the "new way" has proven itself.
There was a good article somewhere describing from life, that someone showed
new approach to development, it was done by people, who appeared to love
them, and enjoy the well-visible benefits. Then later some more stressful
period came, and started to revert to the old way. Despite both knowing and
feeling that it is not good and not beneficial.

C++, being multi-paradigm allows one to continue use his paradigm. It all
looks good too, until the target project uses the same paradigm, or one
compatible. But that is just luck or accident. Especially if the
paradigm is "the C way" -- that differs massively from what is healthy using
the C++ toolbox.
And in no way would one be able to
successfully use other important new features.

Exceptions are a good example to what I said earlier -- one sits down and
can add compiling lines of C-style code ad nauseam, not ever realizing that
it is all broken for the case exceptions thrown from downstairs. And that
code will be either eventually rewritten by others or sit there like a time
bomb. If those costs are honestly calculated in the productivity what
figures we get?
 
F

fnegroni

My own experience is that C++, being so vast, and developed over a
(perhaps too?) long stretch of time, suffers from 'idiom dependency'.

By that I mean that idioms become nearly as important as getting the
job done.

Interestingly, what makes C++ programmers tick, that is the amount of
process-hiding (none knows for sure how the string class manages
memory during appending, but we trust it does it right) can become
confusing unless an idiom is used to ensure the maintainer can guess
what the author intended.

It is like Latin.

I studied Latin for 5 years. Latin is one of the most difficult
languages to master due to the fact that it is very idiomatic:
although the same sentence could 'technically' have two meanings, the
particular order in which words are arranged gives a clue to the
reader as to the actual 'intended' meaning.

From that point of view, I argue that a skilled C programmer who has
some breadth of knowledge and expertise in higher level languages
(such as Python/Ruby etc) can become a 'better' C++ programmer: s/he
can understand the idioms, but can also see past the idioms.

In fact, I usually find myself uncovering C++ bugs in code that I
would probably not be able to write myself, just because I am used to
look past the idioms.

Another problem for C++, IMHO, is that the language features were
mostly borrowed, and then matured over many iterations.

Take Exceptions: most C++ books from 10 years or so ago, when
exceptions were rarely available on mainstream implementations, had
strict guidelines about them. They were perceived as expensive and
exotic.

Nowadays, any Java or Python programmer can grasp their meaning or use
in the very first program they develop. The rules on their use have
also been relaxed a lot. So now exceptions, in most languages, are
used for error reporting rather than 'OMG the file descriptor is
invalid, the OS is cheating me!" kind of situations.

More modern C++ books take this into account and introduce the concept
earlier in the course. They also appreciate the influence from other
languages.
 
P

peter koch

Not so much that, as "as productive as you would be in something
like C".  You certainly won't be writing idiomatic C++ after
just a week, even with a lot of experience in other languages.

It is now so long ago that I don't really remember how long it took
before my code became idiomatic, and I do remember revisiting some of
my first classes.

Still, having an existing codebase to look at and a good mentor to
help you can bring you a very long way in a very short time. And I was
so lucky that my mentor was very good at C++, that he liked teaching
and that he had time for me and my silly questions.
The fact that your C++ isn't idiomatic, however, and doesn't use
many features of the language, doesn't mean that it is not
maintainable---there's an old saw that "real programmers can
write Fortran in any language", but the reverse is true as well:
a good programmer will write clean code in any language,
including a very reduced subset of C++.  (One of the cleanest,
best written programs I ever saw was in Fortran IV.)

Of course, this "productive" doesn't necessarily mean that you
will be productive in every environment.  If you've not see
exceptions before, I don't think you'd be writing exception safe
code after just one week.  And in no way would one be able to
successfully use other important new features.

I remember that first C++ as being quite clean and quite C++. So
encapsulation, exceptions and the standard library was used through
out. I also believe there was a little bit of template code floating
around although perhaps not so much.

C++ coded as C was found here and there but got cleaned-up. Mostly by
me as I inherited a project that began its life as C.

/Peter
 

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
474,156
Messages
2,570,878
Members
47,404
Latest member
PerryRutt

Latest Threads

Top