473,473 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Disappointed by "Accelerated C++"

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

--
Nov 18 '07 #1
16 2604
LR
Michael Bell wrote:
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
Nov 18 '07 #2
On 2007-11-18 19:26, Michael Bell wrote:
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.

--
Erik Wikström
Nov 18 '07 #3
On Nov 18, 1:26 pm, Michael Bell <mich...@beaverbell.co.ukwrote:
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.
Nov 18 '07 #4
"Michael Bell" <mi*****@beaverbell.co.ukwrote in message
news:b3********************@michael.beaverbell.co. uk...
>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.
Nov 19 '07 #5
In message <_I***************@newsb.telia.net>
Erik Wikström <Er***********@telia.comwrote:
On 2007-11-18 19:26, Michael Bell wrote:
>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.
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

--
Nov 19 '07 #6
In message <47***********************@news.uslec.net>
LR <lr***@superlink.netwrote:
Michael Bell wrote:
>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
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
--
Nov 19 '07 #7
"Michael Bell" <mi*****@beaverbell.co.ukwrote in message
news:60********************@michael.beaverbell.co. uk...
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?
Nov 19 '07 #8
<pa**********@att.netwrote in message
news:8e**********************************@s36g2000 prg.googlegroups.com...
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.
Nov 20 '07 #9
"Kai-Uwe Bux" <jk********@gmx.netwrote in message
news:fh**********@murdoch.acc.Virginia.EDU...
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.
Nov 20 '07 #10
In message <9m*******************@bgtnsc04-news.ops.worldnet.att.net>
"Andrew Koenig" <ar*@acm.orgwrote:
"Kai-Uwe Bux" <jk********@gmx.netwrote in message
news:fh**********@murdoch.acc.Virginia.EDU...
>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.
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
--
Nov 20 '07 #11
"Alf P. Steinbach" <al***@start.nowrote in message
news:13*************@corp.supernews.com...
>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.
Of course -- but that wasn't the purpose.
Nov 20 '07 #12
"Michael Bell" <mi*****@beaverbell.co.ukwrote in message
news:f7********************@michael.beaverbell.co. uk...
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.
Nov 20 '07 #13
On Nov 20, 11:37 pm, "Andrew Koenig" <a...@acm.orgwrote:
<pauldepst...@att.netwrote in message

news:8e**********************************@s36g2000 prg.googlegroups.com...
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.
Well that example exactly proves my point. This program is
"substantial" in some contexts, but not in others.

Paul Epstein
Nov 21 '07 #14
In message <HD********************@bgtnsc04-news.ops.worldnet.att.net>
"Andrew Koenig" <ar*@acm.orgwrote:
"Michael Bell" <mi*****@beaverbell.co.ukwrote in message
news:f7********************@michael.beaverbell.co. uk...
>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.

The cover of the book says that the most useful features of the
language are taught first, rather than the most primitive, and says
that this method is very successful, but this is not how the book goes
about it. Why?

Michael Bell

--
Nov 21 '07 #15
"Michael Bell" <mi*****@beaverbell.co.ukwrote in message
news:14********************@michael.beaverbell.co. uk...
The cover of the book says that the most useful features of the
language are taught first, rather than the most primitive, and says
that this method is very successful, but this is not how the book goes
about it. Why?
Why do you say that's not how the book goes about it?

Accelerated C++ covers the standard-library string class on page 10, the
vector class on page 41, and iterators on page 79. I have seen lots of
books that don't cover any of these topics until hundreds of pages of
low-level stuff have gone by.

Of course the book has to talk aboutsome low-level concepts early, such as
if and while statements, because it's almost impossible to write useful
programs without them. What it doesn't do--which is the point of the text
on the cover--is waste lots of time on stuff such as bit fields, or switch
statements, or all the arcane details of pointer declarations, or even C
arrays and pointers, for that matter. Instead, it starts right in with the
essential library data structures, which make it much easier for programmers
to get useful work done quickly.
Nov 21 '07 #16
In message <a6*********************@bgtnsc04-news.ops.worldnet.att.net
>
"Andrew Koenig" <ar*@acm.orgwrote:
"Michael Bell" <mi*****@beaverbell.co.ukwrote in message
news:14********************@michael.beaverbell.co. uk...
>The cover of the book says that the most useful features of the
language are taught first, rather than the most primitive, and says
that this method is very successful, but this is not how the book goes
about it. Why?
Why do you say that's not how the book goes about it?
Accelerated C++ covers the standard-library string class on page 10, the
vector class on page 41, and iterators on page 79. I have seen lots of
books that don't cover any of these topics until hundreds of pages of
low-level stuff have gone by.
Of course the book has to talk aboutsome low-level concepts early, such as
if and while statements, because it's almost impossible to write useful
programs without them. What it doesn't do--which is the point of the text
on the cover--is waste lots of time on stuff such as bit fields, or switch
statements, or all the arcane details of pointer declarations, or even C
arrays and pointers, for that matter. Instead, it starts right in with the
essential library data structures, which make it much easier for programmers
to get useful work done quickly.
None of the beginners' text books I have seen go into "bit fields, or
switch statements, or all the arcane details of pointer declarations,
or even C arrays and pointers" at an early stage. The rest of the
world has caught up with you there. Well, some of them do cover
"switch", because "if" can handle a two-way choice, but you need
"switch" to handle more-way choices.

So your class consists of showing your students how to handle strings
using if, while and do-while. They must get into all sorts of trouble
trying to do it, presumably you lean over their shoulders and say,
"no, do it like this". But that sort of spoken help can't be put into
chapter 5, so you have put it into the first 4 chapters. It is no
longer the book of the course.

It seems to me that your courses, and many of the other books I have
read, have used teaching simplifications. They may be necessary, but
they can lead to trouble. For example, I was taken aback when some
language teachers told me that if you teach a child that French "S'il
vous plait" (literally "if it pleases you") means simply English
"Please", then some of them become unable to vary it, to see that it
is sometimes right to say "S'il TE plait" and that "plaire" is an
important verb with many uses outside this phrase. (This was never my
problem)

How far do you go? I have seen a textbook where "Hello world" is
written as a program with classes. There are no easy answers.

Sadly I have to say that your textbook didn't work for ME. MY loss. I
wish it had.

Michael Bell

--
Nov 23 '07 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Joe Laughlin | last post by:
On 6.2.3/115 of "Accelerated C++", there's this function: double average(const vector<double>& v) { return accumulate(v.begin(), v.end(), 0.0) / v.size(); } The author notes that it's...
39
by: TonyJeffs | last post by:
Great book - I like the way that unlike other books, AC++ explains as much as possible about every piece of code discussed, so I'm not left thinking, "well...OK... I get line 12, but I wonder what...
1
by: blangela | last post by:
I am currently teaching 2 part-time (one evening per week) C++ courses using the Deitel & Deitel "C++ How To Program" text. Each course is 13 weeks in length, including time for labs and exams. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.