Disappointed by "Accelerated C++"

M

Michael Bell

I did an the Open University course MT262. I got 3/4 the way through
it and only really came unstuck at classes.

Following the advice of many, on this list and elsewhere, and
impressed by their statement that students were writing substantial
programs within a day, I bought "Accelerated C++" by Koenig and Moo.

I find I just can't get on with it. I have started at the beginning,
and I just can't follow it. The first few chapters do stuff that I
easily did with the Open University, and I just can't follow it.

Why is this?


Maybe it is because they teach their classes using the spoken word,
and their writing style is the problem. Nobody could be writing
substantial programs within a day from this book. Writing and speaking
are different skills. I've seen such things before. I once had a boss
whose writing was AWFUL, just AWFUL, truly the laughing-stock of the
firm.

Or maybe they are TOO well qualified. The senior maths teachers at my
school were genuine mathematicians, who had turned to teaching. They
simply couldn't understand what we boys found difficult. The best
maths teacher as my school was the woodwork master;, he saw what we
boys found hard, he found it hard himself. So he explained it well.

Koenig and Moo are certainly well qualified, I wonder if that has
stopped people from judging what they have actually written?

For myself, it is going to be "C++ for Dummies" by Stephen Randy
Davis. There is no point in beating my head against a brick wall.

Michael Bell

--
 
L

LR

Michael said:
Following the advice of many, on this list and elsewhere, and
impressed by their statement that students were writing substantial
programs within a day, I bought "Accelerated C++" by Koenig and Moo.

I find I just can't get on with it. I have started at the beginning,
and I just can't follow it. The first few chapters do stuff that I
easily did with the Open University, and I just can't follow it.

Why is this?

Perhaps you'd be willing to share a particular problem that you had
understanding something in the book?

TIA

LR
 
E

Erik Wikström

I did an the Open University course MT262. I got 3/4 the way through
it and only really came unstuck at classes.

Following the advice of many, on this list and elsewhere, and
impressed by their statement that students were writing substantial
programs within a day, I bought "Accelerated C++" by Koenig and Moo.

I find I just can't get on with it. I have started at the beginning,
and I just can't follow it. The first few chapters do stuff that I
easily did with the Open University, and I just can't follow it.

Why is this?

I do not know, I have not read the book but I have looked in it and it
looked quite OK to me. If you have any specific grievances perhaps
someone here can help you.
Maybe it is because they teach their classes using the spoken word,
and their writing style is the problem. Nobody could be writing
substantial programs within a day from this book.

None that I know of would be able to write substantial programs in
(good) C++ after reading just reading a book. C++ is a very complex
language and after reading a book or two you will have a foundation to
stand on, but it to be a truly good C++ programmer you need a few years
of experience in addition to reading books and articles.
 
M

ma740988

I did an the Open University course MT262. I got 3/4 the way through
it and only really came unstuck at classes.

Following the advice of many, on this list and elsewhere, and
impressed by their statement that students were writing substantial
programs within a day, I bought "Accelerated C++" by Koenig and Moo.

I find I just can't get on with it. I have started at the beginning,
and I just can't follow it. The first few chapters do stuff that I
easily did with the Open University, and I just can't follow it.

Why is this?
It would be beneficial if you offered more specifics about the
chapters you alluded to. Could you elaborate on what you 'just can't
follow'. The loop invariant property or ...?
Be advised that the text places emphasis on solving problems rather
than exploring language linguistics.
 
J

Jim Langston

Michael Bell said:
I did an the Open University course MT262. I got 3/4 the way through
it and only really came unstuck at classes.

Following the advice of many, on this list and elsewhere, and
impressed by their statement that students were writing substantial
programs within a day, I bought "Accelerated C++" by Koenig and Moo.

I find I just can't get on with it. I have started at the beginning,
and I just can't follow it. The first few chapters do stuff that I
easily did with the Open University, and I just can't follow it.

Why is this?

Different people learn in differnt ways.When I first started C++ I also
picked up a book and read through it, not understanding 3/4 of what I was
reading. But I worked with what I did understand, and kept reading the book
and eventually I understood everything the book was telling me (whether I
remembered it or not the next day).

I had not come from an OOP background, however, and so classes and objects
were totally new to me. Perhaps that's where you are? Have you done any
programming before with classesses and instances? If not, it will just take
a bit longer for you to understand their concepts, as it took for me.

Don't give up though.
 
M

Michael Bell

In message <[email protected]>
I do not know, I have not read the book but I have looked in it and it
looked quite OK to me. If you have any specific grievances perhaps
someone here can help you.
None that I know of would be able to write substantial programs in
(good) C++ after reading just reading a book. C++ is a very complex
language and after reading a book or two you will have a foundation to
stand on, but it to be a truly good C++ programmer you need a few years
of experience in addition to reading books and articles.

It says on the cover "The authors proved this approach in their
professional-education course in Stanford University, where students
learned how to write substantial programs on the first day in the
classroom".

If you think this is absurd exaggeration, then write to the
publishers, in America unfortunately, from you in Sweden and me in
Britain.

As I point out, they achieve this in a CLASSROOM, and this is very
different environment to a book.

They say "professional-education". Were these students completely
fresh or did they already know something?

Anyway, it seems to be an obviously false claim, and therefore to be
condemned.

Michael Bell

--
 
M

Michael Bell

In message <[email protected]>
LR said:
Michael Bell wrote:
Perhaps you'd be willing to share a particular problem that you had
understanding something in the book?

LR

There is no PARTICULAR PROBLEM to be sorted out. I came to a stop at
Chapter 2 of Koenig and Moo. This chapter is called "Looping and
counting" and it deals with if, do-while, for and suchlike. This is
something that I learned without too much difficulty from the Open
University ("OU") course MT262, but I was going over it again to make
sure I understood it and their way of doing things. And even though I
understood what I was trying to learn, I couldn't follow their
teaching.

Only when I look back on it do I realise that there was something in
common with the point where I lost the track of the OU course. In both
cases the teaching went through a pile of stuff saying "you'll see how
it all fits together at the end" and I just couldn't handle it. Maybe
that is a teaching format that suits some, but it loses me.

Michael Bell


--
 
A

Andrew Koenig

It says on the cover "The authors proved this approach in their
professional-education course in Stanford University, where students
learned how to write substantial programs on the first day in the
classroom".
If you think this is absurd exaggeration, then write to the
publishers, in America unfortunately, from you in Sweden and me in
Britain.

It is not an exaggeration. Barbara and I taught a week-long summer course
every year for a number of years for an organization called the Western
Institute in Computer Science, which was an organization that sponsored
continuing-education courses in conjunction with the Stanford CS department.
In other words, the courses, although not part of the Stanford curriculum,
were given on Stanford campus in collaboration with the university. A
number of the people teaching these courses were Stanford faculty members.
As I point out, they achieve this in a CLASSROOM, and this is very
different environment to a book.
They say "professional-education". Were these students completely
fresh or did they already know something?

Everyone knows *something*. These students' backgrounds varied
dramatically, though most had some kind of scientific or engineering
background. Some of them already knew C; a few knew C++ (or thought they
did). There were some pure mathematicians, some Fortran programmers, and,
if I remember right, one Lisp programmer. Between 15 and 25 students each
summer for 8 or 9 years.
Anyway, it seems to be an obviously false claim, and therefore to be
condemned.

The claim is true. Specifically, for a number of years we used a
traditional course outline: First talk about how to build classes, then
about how to use them. We found that they students would go through the
same process each time: On Monday, they'd follow things pretty well; on
Tuesday, they'd think they followed them but when they got to the lab,
they'd be confused. We would have to answer a lot of questions to clear up
that confusion. On Wednesday, the clouds would start to lift, and after
that, they'd be fine.

The last couple of years we taught the course, we reorganized the material
along the lines of Accelerated C++. The difference in the classroom was
dramatic: Now there were no major confusions, and people learned lots
faster. Not only that, but they were able to write more ambitious programs
more successfully, especially on the first day. The difference was that with
the new approach, they could use strings, vectors, and maps immediately,
which means that they didn't have to worry about getting their copy
constructors right or stuff like that.

So if you think that our claims about the book are obvoiusly false, all I
can do is recommend that you revise your judgment of what is obvious.
 
A

Andrew Koenig

There is no PARTICULAR PROBLEM to be sorted out. I came to a stop at
Chapter 2 of Koenig and Moo. This chapter is called "Looping and
counting" and it deals with if, do-while, for and suchlike. This is
something that I learned without too much difficulty from the Open
University ("OU") course MT262, but I was going over it again to make
sure I understood it and their way of doing things. And even though I
understood what I was trying to learn, I couldn't follow their
teaching.

Did you try running the programs that we give as examples in the book? If
not, I'd like to suggest that you do so.

If you did try running the programs and got stuck anyway, would you mind
posting the first program that you couldn't understand, and explaining what
your problems were with it?
 
A

Alf P. Steinbach

* Andrew Koenig:
Did you try running the programs that we give as examples in the book? If
not, I'd like to suggest that you do so.

If you did try running the programs and got stuck anyway, would you mind
posting the first program that you couldn't understand, and explaining what
your problems were with it?

I think that most probably you hit the nail squarely on ze head here.

It would be interesting if the OP could answer these questions.

Cheers,

- Alf
 
P

pauldepstein

* Andrew Koenig:








I think that most probably you hit the nail squarely on ze head here.

It would be interesting if the OP could answer these questions.

Cheers,

- Alf

--
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?- Hide quoted text -

- Show quoted text -

Perhaps the disagreement between the OP and the author is largely
based on the vague word -- "substantial". If a "substantial" program
is an elegantly designed user-friendly program to present all
solutions when a user inputs a quartic equation, then I'm sure Andrew
Koenig would agree that under _that_ definition of "substantial", his
book would not magically enable someone to write a "substantial"
program on their first day. However, if "substantial" means to solve
a problem that would be practically unsolvable using an average hand
calculator, then I'm sure the OP would agree that's not an
unreasonable claim.

Paul Epstein
 
M

Michael Bell

In message <[email protected]>
It is not an exaggeration. Barbara and I taught a week-long summer course
every year for a number of years for an organization called the Western
Institute in Computer Science, which was an organization that sponsored
continuing-education courses in conjunction with the Stanford CS department.
In other words, the courses, although not part of the Stanford curriculum,
were given on Stanford campus in collaboration with the university. A
number of the people teaching these courses were Stanford faculty members.
Everyone knows *something*. These students' backgrounds varied
dramatically, though most had some kind of scientific or engineering
background. Some of them already knew C; a few knew C++ (or thought they
did). There were some pure mathematicians, some Fortran programmers, and,
if I remember right, one Lisp programmer. Between 15 and 25 students each
summer for 8 or 9 years.
The claim is true. Specifically, for a number of years we used a
traditional course outline: First talk about how to build classes, then
about how to use them. We found that they students would go through the
same process each time: On Monday, they'd follow things pretty well; on
Tuesday, they'd think they followed them but when they got to the lab,
they'd be confused. We would have to answer a lot of questions to clear up
that confusion. On Wednesday, the clouds would start to lift, and after
that, they'd be fine.
The last couple of years we taught the course, we reorganized the material
along the lines of Accelerated C++. The difference in the classroom was
dramatic: Now there were no major confusions, and people learned lots
faster. Not only that, but they were able to write more ambitious programs
more successfully, especially on the first day. The difference was that with
the new approach, they could use strings, vectors, and maps immediately,
which means that they didn't have to worry about getting their copy
constructors right or stuff like that.

I wasn't there, so I have to believe you. It does depend on what you
mean by "substantial" A program of 5 lines, 20 lines, 100 lines?

The need to get the small stuff correct is certainly is a big drag on
learning. But I don't see how you can avoid it, or that you have tried
to do so in the book. This classroom teaching method has succeeded.
How far does the book reflect it?


And to answer other poster's questions in one reply (so much tidier!)

I got through chapter 1 fine, I worked through the exercises at the
end of it without problem. It was stuff I had already done in the Open
University course MT262. So I went into chapter 2 feeling confident.
It was also stuff I had done before and mastered. I just couldn't
follow the discussion. What is the overall plan? The objective is to
write "Hello Estragon!" in a box of asterisks, how is that going to be
achieved? I just couldn't follow it. That may be your writing style or
my reading weakness, but I'm sure I'm not alone, many seem to treat
your book as a reference work rather than a teaching work for
beginners.

Michael Bell
--
 
K

Kai-Uwe Bux

Andrew said:
It is not an exaggeration. Barbara and I taught a week-long summer course
every year for a number of years for an organization called the Western
Institute in Computer Science, which was an organization that sponsored
continuing-education courses in conjunction with the Stanford CS
department. In other words, the courses, although not part of the Stanford
curriculum,
were given on Stanford campus in collaboration with the university. A
number of the people teaching these courses were Stanford faculty members.

I don't think the poster wanted to say that the claim about the course being
held at Stanford University is exaggerated :)

The claim that is hard to believe is that the students learned "how to write
substantial programs on the first day in the classroom". That claim also is
very hard to evaluate unless the students actually did write substantial
programs (e.g., as an exercise) before the second day of class (which in a
one-week course would presumably be the next day). As "substantial" is a
little vague, I would be very interested to learn what program(s) you had
the students write before the second day of class that you consider
substantial. That would help to put the publishers blurb in perspective.


[snip]


Best

Kai-Uwe Bux
 
A

Andrew Koenig

Perhaps the disagreement between the OP and the author is largely
based on the vague word -- "substantial". If a "substantial" program
is an elegantly designed user-friendly program to present all
solutions when a user inputs a quartic equation, then I'm sure Andrew
Koenig would agree that under _that_ definition of "substantial", his
book would not magically enable someone to write a "substantial"
program on their first day. However, if "substantial" means to solve
a problem that would be practically unsolvable using an average hand
calculator, then I'm sure the OP would agree that's not an
unreasonable claim.

How about a program to produce a concordance of a text file? In other
words: Read a file and produce a table of every distinct word in the file,
along with how many times it appears. That's a program that would be far
too hard to write after one day in a C course, or even a C++ course that
wasn't based on the library; but it becomes well within an average student's
grasp after one classroom day using Accelerated C++'s approach.
 
A

Andrew Koenig

The claim that is hard to believe is that the students learned "how to
write
substantial programs on the first day in the classroom". That claim also
is
very hard to evaluate unless the students actually did write substantial
programs (e.g., as an exercise) before the second day of class (which in a
one-week course would presumably be the next day). As "substantial" is a
little vague, I would be very interested to learn what program(s) you had
the students write before the second day of class that you consider
substantial. That would help to put the publishers blurb in perspective.

Here is the first day's homework assignment for the Stanford course. Note
that we did not expect every student to answer every question, but we were
always pleased with how far they got.

-----------------------------------------------------------------------------------------------

1. Write a program to count the number of words in an input file.

2. Extend that program to count the number of occurrences of each word.

3. Ensure that the output to problem #2 is sorted by the number of
occurrences. That is, print all words that occur once, followed by those
that occur twice etc.

4. Write a program to read a collection of numbers from the standard input
and the compute and print their median.

5. Given a file of student names and exam scores (formatted as described
below), compute the student's final grade. The input will be records such
as:

Smith 87 92 93 60 0 98 75 90
Carpenter 47 90 92 73 100 87 93 91
...

(Name, grades on six homework assignments, midterm, final)

The program should calculate the final grade as a weighted sum: The median
homework grade counts 40%, the final 40% and the midterm 20%.

So, for the input above, the output would be

Smith 86.8
Carpenter 90.4
...

NOTE: the decimal points should all line up.

6. Extend the previous assignment to print a histogram of grades by ranges:

A 90- 100
B 80- 89.99...
C 70- 79.99...
F <70

The output should list how many students fall into each category.

7. Design and implement a program to produce a permuted index. A permuted
index is one in which each phrase is indexed by every word in the phrase:
So, given the following input

The quick brown fox
jumped over the fence

the output would be

The quick brown fox
jumped over the fence
The quick brown fox
jumped over the fence
jumped over the fence
The quick brown fox
jumped over the fence
The quick brown fox

(Note to Usenet readers: You need to use a constant-width font to read the
table above properly.)

A good algorithm is suggested in The AWK Programming Language by Aho,
Kernighan and Weinberger. That solution divides the problem into three
steps:

1. Read each line of the input and generate a set of rotations of that line.
Each rotation puts the next word of the input in the first position and
rotates the previous first word to the end of the phrase. So the output of
this phase for the first line of our input above would be:

The quick brown fox
quick brown fox The
brown fox The quick
fox The quick brown

Of course, it will be important to know where the original phrase ends and
where the rotated beginning begins.

2. Sort the rotations.

3. Unrotate and print the permuted index, which involves finding the
separator, putting the phrase back together and printing it properly
formatted.
 
A

Alf P. Steinbach

* Andrew Koenig:
7. Design and implement a program to produce a permuted index. A permuted
index is one in which each phrase is indexed by every word in the phrase:
So, given the following input

The quick brown fox
jumped over the fence

Hm, this is obviously incorrect: it must always be "the lazy dog", not
"the fence", if you're going to hit all letters on an English keyboard.

That would make a nice addition to the exercise, by the way: a letter in
context table.

Which could be done first (easier to do) just to understand what it's
all about -- for I wouldn't have understood the assignment as stated
if I hadn't done this in COBOL in my student days. Of course, students
should show some initiative and check out e.g. Wikipedia. But still I
think it would help with the letter-in-context as preparation for the
word-in-context.

Cheers,

- Alf
 
M

Michael Bell

In message <[email protected]>
Here is the first day's homework assignment for the Stanford course. Note
that we did not expect every student to answer every question, but we were
always pleased with how far they got.
1. Write a program to count the number of words in an input file.
2. Extend that program to count the number of occurrences of each word.
3. Ensure that the output to problem #2 is sorted by the number of
occurrences. That is, print all words that occur once, followed by those
that occur twice etc.
4. Write a program to read a collection of numbers from the standard input
and the compute and print their median.
5. Given a file of student names and exam scores (formatted as described
below), compute the student's final grade. The input will be records such
as:
Smith 87 92 93 60 0 98 75 90
Carpenter 47 90 92 73 100 87 93 91
...
(Name, grades on six homework assignments, midterm, final)
The program should calculate the final grade as a weighted sum: The median
homework grade counts 40%, the final 40% and the midterm 20%.
So, for the input above, the output would be
Smith 86.8
Carpenter 90.4
...
NOTE: the decimal points should all line up.
6. Extend the previous assignment to print a histogram of grades by ranges:
A 90- 100
B 80- 89.99...
C 70- 79.99...
F <70
The output should list how many students fall into each category.
7. Design and implement a program to produce a permuted index. A permuted
index is one in which each phrase is indexed by every word in the phrase:
So, given the following input
The quick brown fox
jumped over the fence
the output would be
The quick brown fox
jumped over the fence
The quick brown fox
jumped over the fence
jumped over the fence
The quick brown fox
jumped over the fence
The quick brown fox
(Note to Usenet readers: You need to use a constant-width font to read the
table above properly.)
A good algorithm is suggested in The AWK Programming Language by Aho,
Kernighan and Weinberger. That solution divides the problem into three
steps:
1. Read each line of the input and generate a set of rotations of that line.
Each rotation puts the next word of the input in the first position and
rotates the previous first word to the end of the phrase. So the output of
this phase for the first line of our input above would be:
The quick brown fox
quick brown fox The
brown fox The quick
fox The quick brown
Of course, it will be important to know where the original phrase ends and
where the rotated beginning begins.
2. Sort the rotations.
3. Unrotate and print the permuted index, which involves finding the
separator, putting the phrase back together and printing it properly
formatted.

I've got admit that the answers these questions are "substantial
programs". I've done a lot more than one day and it would take me some
effort to do these, but you must have given them quite an idea of how
to go about it. That's teaching. There is nothing like this in the
book. And I suppose Stanford students are usually quite bright.

Michael Bell


--
 
A

Andrew Koenig

Hm, this is obviously incorrect: it must always be "the lazy dog", not
"the fence", if you're going to hit all letters on an English keyboard.

Of course -- but that wasn't the purpose.
 
A

Andrew Koenig

I've got admit that the answers these questions are "substantial
programs". I've done a lot more than one day and it would take me some
effort to do these, but you must have given them quite an idea of how
to go about it. That's teaching. There is nothing like this in the
book. And I suppose Stanford students are usually quite bright.

Actually, several of these exercises *are* in the book. See, for example,
exercise 5-1.

Also note that a "day" here was four hours of classroom time, not the
typical hour or hour and a half that you find in courses that stretch out
over a whole semester. After all, we covered almost all of the material in
the book in a single week.

Also, we were in the lab to help when students had questions.

On the other hand, although I will say that the students were quite bright
on average, most of them were not Stanford students. They came from all
over.
 
P

pauldepstein

How about a program to produce a concordance of a text file? In other
words: Read a file and produce a table of every distinct word in the file,
along with how many times it appears. That's a program that would be far
too hard to write after one day in a C course, or even a C++ course that
wasn't based on the library; but it becomes well within an average student's
grasp after one classroom day using Accelerated C++'s approach.

Well that example exactly proves my point. This program is
"substantial" in some contexts, but not in others.

Paul Epstein
 

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,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top