Bjarne Stroustrup (The Creator of C++): The C++ Programming Language - Third Edition

C

CoreyWhite

I bought this book years ago, when I was just learning C++. Since
then I've gone through every math course offered at my college, taken
courses on coding C & thinking in terms how how to make the smallest
tightest algorithms to preform specific functions. I've also grown
and matured a lot, and am wiser and older. I'm reading through the C+
+ Programming Language, Third Edition now, and I can actually
understand it. I can understand it because I'm already familiar with
the language. I know how to use pointers, and know what stacks,
templates, classes, and vectors are. I know how to use them. The
trouble is I don't have a lot of experience using high level object
oriented language, and haven't built any projects of my own using the
techniques. I can see why it is a good idea to think in terms of the
best algorithm you could use to write a program with C++. Because
with another language like PHP you might be able to write the same
code with just a few lines. So without all of the object oriented
tools that seperate C++ from its predecessor, C is a dead language.
It would take pages and pages of C to write some very simple code, and
you would still have to understand low level binary manipulations.

So what I am going to do is come up with a short notebook on what I
get from reading through the C++ Programming Language, -Third
Edition-, and explain to people why object oriented programming is the
shit, and teach them how to use it with clear examples that illustrate
why using vectors, templates, & classes, allow us to do so much more.
Most of the programs will probably be basic string manipulations or
simple algorithms that C++ has a hard time doing without object
oriented programming. But I will try to go over some of the basics of
C, step-by-step, and cover the useful tools that are hard to
understand like pointers and binary operators. Some of the subtleties
of the language, are the most useful parts of it.

I would be interested in learning if anyone else wants to pick up the
higher levels of C++ and work with me in this project? I know some
people posting to comp.lang.c++ already know the language by heart,
but I mostly work with reference books by my side. I guess there is
an old saying: Those who can't do, TEACH!.
 
D

dave_mikesell

[removed alt.magick, alt.religion.wicca, alt.magick.virtual-adepts,
comp.lang.c from the reply list]
So what I am going to do is come up with a short notebook on what I
get from reading through the C++ Programming Language, -Third
Edition-, and explain to people why object oriented programming is the
shit, and teach them how to use it with clear examples that illustrate
why using vectors, templates, & classes, allow us to do so much more.

I would be interested in learning if anyone else wants to pick up the
higher levels of C++ and work with me in this project?

Not trying to let the air out of your balloon, but do you know how
many C++ books already exist?

http://accu.org/index.php/book_reviews?url=search.xqy?field=subject&term=C++

http://accu.org/index.php/book_reviews?url=search.xqy?field=subject&term=advanced+c++

http://accu.org/index.php/book_reviews?url=search.xqy?field=subject&term=beginner's+c++
 
R

red floyd

CoreyWhite said:
[blather redacted]

And the fact that you saw fit to spam this to alt.magic,
alt.religion.wicca, alt.magick.virtal-adepts, and comp.lang.c makes it
clear that this is no better than any of your other blathering.
 
N

Nick Keighley

this was posted to the following ngs
alt.magick,comp.lang.c++,alt.religion.wicca,alt.magick.virtual-
adepts,comp.lang.c

this seems an odd collection


CoreyWhite wrote:

So without all of the object oriented
tools that seperate C++ from its predecessor, C is a dead language.
It would take pages and pages of C to write some very simple code, and
you would still have to understand low level binary manipulations.

that's fighting talk in comp.lang.c!

So what I am going to do is come up with a short notebook on what I
get from reading through the C++ Programming Language, -Third
Edition-, and explain to people why object oriented programming is the
shit, and teach them how to use it with clear examples that illustrate
why using vectors, templates, & classes, allow us to do so much more.

<snip>

you should probably confine this to comp.lang.c++
 
R

Richard Heathfield

Nick Keighley said:
this was posted to the following ngs
alt.magick,comp.lang.c++,alt.religion.wicca,alt.magick.virtual-
adepts,comp.lang.c

this seems an odd collection

Yes, it smells to me like some kind of bridge.
CoreyWhite wrote:



that's fighting talk in comp.lang.c!

So now it's our turn.
<snip>

you should probably confine this to comp.lang.c++

Either that, or remove one particular instance of "the" from the quoted
paragraph. C programmers will have no difficulty identifying which one
I mean.
 
B

Bill Pursell

Either that, or remove one particular instance of "the" from the quoted
paragraph. C programmers will have no difficulty identifying which one
I mean.

I find it interesting that you would write that. In the
past, you've stated that C++ is your 2nd favorite lanuage.
While I have not had much joy with C++ (And in fact have
at times used much fowl language when referring to it,
although I'm starting to warm up to it again and have
taken my Stroustrup down from the bookshelf), I think
the general idea of object-oriented program is
fantastic. It takes many of the ideas that make
up good practices and (tries to) make them more
accessible. Many of the practices that are encouraged
in this newsgroup are object-oriented ideas. I find
it annoying that the OO group have attempted (and
largely succeeded) in claiming to own such practices, but
the whole term "OO" is so nebulous that one never
really knows what it refers to, anyway, but I don't
understand the motive behind your implication.
 
R

Richard Heathfield

Bill Pursell said:
I find it interesting that you would write that. In the
past, you've stated that C++ is your 2nd favorite lanuage.

Aye, and so it is. So what? :)
 
M

Mike Wahler

Bill Pursell said:
I find it interesting that you would write that. In the
past, you've stated that C++ is your 2nd favorite lanuage.
While I have not had much joy with C++ (And in fact have
at times used much fowl language when referring to it,

I've never heard anyone quack at C++ before. :)

-Mike
 
D

Default User

Nick said:
this was posted to the following ngs
alt.magick,comp.lang.c++,alt.religion.wicca,alt.magick.virtual-
adepts,comp.lang.c

this seems an odd collection

Right, which is why I have filters that ignore posts to at least some
of those. Such cross-posts are the work of trolls.
that's fighting talk in comp.lang.c!

Hence trolling.
you should probably confine this to comp.lang.c++

Why, what did they ever do to you?




Brian
 
D

Default User

red said:
CoreyWhite said:
[blather redacted]

And the fact that you saw fit to spam this to alt.magic,
alt.religion.wicca, alt.magick.virtal-adepts, and comp.lang.c makes
it clear that this is no better than any of your other blathering.


Which is why I added filters to remove crossposts to some of those
groups. Naturally, you feeding the troll AND removing defeated that.

Thanks (for nothing).





Brian
 
K

Kenneth Brody

Richard said:
Nick Keighley said:
this was posted to the following ngs
alt.magick,comp.lang.c++,alt.religion.wicca,alt.magick.virtual-
adepts,comp.lang.c

this seems an odd collection

Yes, it smells to me like some kind of bridge. [...]
that's fighting talk in comp.lang.c!

So now it's our turn.
[...]
<snip>

you should probably confine this to comp.lang.c++

Either that, or remove one particular instance of "the" from the quoted
paragraph. C programmers will have no difficulty identifying which one
I mean.

I'm guessing:

s/^the //

Here's hoping further readers don't rewrap quoted text. :)

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:[email protected]>
 
B

Bill Pursell

Richard said:
Bill Pursell said:


Aye, and so it is. So what? :)

You imply that you think "OOP is shit". Given that
and your past statment about C++, I conclude that you
think C++ is not an object-oriented language. Overall,
I'm trying to understand why it is that people seem
to have the attitude of "OOP is great, C is dead" but
don't seem to realize that OOP is often nothing more
than taking all the good programming practices that
were being used by C programmers through the 80's
and making them (arguably) easier to use. I
respect you as a contributer to c.l.c., so I was
hoping to get you to elaborate on your position.
My position seems to be: "OOP is good, although the
definition is ambiguous, but C++ is heinous, (but
slightly less heinous than I thought 6 months ago.)"
 
R

Richard Heathfield

Bill Pursell said:
[...] I conclude that you
think C++ is not an object-oriented language.

"I invented the term Object-Oriented, and I can tell you I did not have
C++ in mind." - attr Alan Kay

Nevertheless, C++ does provide a certain amount of support for OOP.
Overall,
I'm trying to understand why it is that people seem
to have the attitude of "OOP is great, C is dead" but
don't seem to realize that OOP is often nothing more
than taking all the good programming practices that
were being used by C programmers through the 80's
and making them (arguably) easier to use. I
respect you as a contributer to c.l.c., so I was
hoping to get you to elaborate on your position.

Gladly. Here's a quote from my Web site:

*** begin quote ***

Ada. APL. Assembly language. B. Basic. BCPL. C. C+. C++. C#. COBOL. D.
Forth. Fortran. Haskell. Java. Lisp. Logo. Pascal. Perl. Prolog.
Python. Scheme. SNOBOL.

Is your favourite language mentioned in that list? If so, are you
feeling smug? Or if not, are you outraged?

There are, quite literally, thousands of computer programming languages,
and it seems that every single one has more than its fair share of
passionate advocates. Whichever language you are using, you will
generally find far more people telling you that your choice was wrong,
than people who will agree that you made a reasonable decision to use
that language.

C diehards (er, like me!) will give you several excellent reasons why C
should be your language of choice. C++ aficionados will be just as
persuasive about C++, and often disparaging about C (they call it "a
better C"; I'd be happier if they called it "a different C", but of
course they don't). Ada lovers will typically look down their noses on
both the C and the C++ camp. Visual Basic programmers don't understand
what the fuss is about, since it's quite obvious to them that you can
do anything you need to do in straight VB code. And there's always some
smart alec who'll point out that using such high level languages can
only lead to code bloat and runtime inefficiency; assembly language is
the only way to go. COBOL programmers will then point out that the
whole point of COBOL is that you don't have to use assembly language.
And then the Pascal programmers will retort that the whole idea of
Pascal is that you don't have to use COBOL. Fans of functional
languages such as Lisp will then say that, if you haven't programmed
functionally, you haven't really understood programming at all!

Why are we so passionate about our choice of computer programming
language? Do other professions suffer from the same damaging
phenomenon? Can we imagine builders arguing about hammers? Or plumbers
arguing about wrenches?

The answer probably lies in the close relationship between language and
thought. Language doesn't just enable us to express ourselves. It also,
to a very large extent, controls and limits the ways in which we can
think. It is almost impossible to think like a Spaniard, for example,
unless you happen to be Spanish (or, at the very least, to speak
Spanish very fluently indeed). And because Spaniards cannot, on the
whole, imagine with any accuracy what it is like to be non-Spanish,
they are likely to conclude that being Spanish is the best way to be.
(There is nothing special about Spaniards in this regard, of course --
I could have chosen any nation on the planet for the purposes of the
example.)

And so it is with computer programming languages. For a start, a
programmer who "speaks" only one programming language is likely, in the
medium term, to have his thought processes so moulded, so shaped, by
that language that he finds it hard to imagine that there are other
ways to program; and, if there are other ways, well, they must surely
be inferior, mustn't they?

But this is a very limiting way to look at programming languages. A
programmer who has taken the very sensible course of learning several
programming languages is in a much better position to judge between
them. And yet, curiously, such programmers tend to be dispassionate
and, dare I say, rational about language choice. For them, the sensible
thing to do is to choose the language that best fits the problem
domain.

For example, consider a programmer who is fluent in C, has adequate C++,
and can boast a smattering of COBOL, assembly language, and Visual
Basic. He is asked to write a program to check documents, presented as
text files, for heavily-used phrases (perhaps he works in a publishing
house, and the program is intended to help authors to identify clichés
in their books; as we all know, clichés are a Bad Thing, and good
writers avoid them like the plague).

Since no platform was mentioned, the programmer may reject Visual Basic
out of hand (since he can't guarantee that his program will be run
under the Windows operating system). Similar considerations, and the
sheer amount of work it would involve, lead him to reject assembly
language too. COBOL isn't terribly well-designed for such a task, so he
is left with C or C++. His fluency in C might lead him to favour that
option at first, but on reflection he will realise that C++'s STL will
literally turn this task into a one-hour job at the most, and possibly
a much shorter time need be spent. That doesn't mean C++ is the right
choice for all tasks. But he may well conclude that it's the right
language for this task.

He will also be wise enough to recognise that there may well be
languages which are better suited to the task, but he will rightly
decide that, at least for the time being, it'd be quicker to use a
slightly less suitable language that one knows than to spend the time
learning a completely new language, and then still have to invest yet
more time in writing the program itself in that language (and writing
programs in a language you don't know very well is almost bound to take
longer than writing the same programs in a language that you do know).

If he is very wise indeed, he will make a point of learning that other
language anyway (perhaps once he's finished his current task), so that
the next time such a task is presented to him, he'll be ready.

There are so many different languages because there are so many
different ways to think about programming. The language that is most
right for me may not be the language that is most right for you. So
what right have I to tell you what language to use? And what right do
you have to tell me what language to use? None whatsoever, right?

So please, let's have a little sanity when it comes to language wars.
Just remember that one man's meat is another man's poison. Cultural
diversity is just as important and rewarding in programming as it is in
other aspects of our existence here on Earth. Our time here is not so
protracted that we can afford to waste any of it insisting that other
people should change their way of thinking just because we are too lazy
to change ours.

Use C. There's no better language. :)

*** end quote ***
My position seems to be: "OOP is good, although the
definition is ambiguous, but C++ is heinous, (but
slightly less heinous than I thought 6 months ago.)"

C++ is a reasonable language, albeit very complicated. The mistake many
people make is in thinking you have to program it the way the C++ fans
do. You don't. It's much more flexible than that. You can program it
any way you please (within the bounds of syntax, semantics, and a
smattering of common sense). And that's one thing I admire about C++.
 
?

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

Richard said:
Why are we so passionate about our choice of computer programming
language?

People that writes messages in language flame wars and in cross-posted
threads between several language groups usually are. People that are not so
passionate just ignore those discussions.
 
J

Jack Klein

this was posted to the following ngs
alt.magick,comp.lang.c++,alt.religion.wicca,alt.magick.virtual-
adepts,comp.lang.c

this seems an odd collection

**** PLEASE DON'T FEED TROLLS *****

Many of us kill-filtered this troll long ago, and would not see him at
all if people like you and Walter Roberson did not rise to the bait
and reply.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
 
J

Jorgen Grahn

["Followup-To:" header set to comp.lang.c++.]
On 30 Mar 2007 09:43:41 -0700 said:
While I have not had much joy with C++ (And in fact have
at times used much fowl language when referring to it,
although I'm starting to warm up to it again and have
taken my Stroustrup down from the bookshelf), I think
the general idea of object-oriented program is
fantastic.

Yes, but note that C++ isn't just about object-oriented programming.
You can hack C++ all day long without implementing a single class, and
still benefit from things like the type system, the standard library,
namespaces, templates and so on.

One of the last chapters of your copy of Stroustrup's book discusses
this well -- in a way that IMHO shouldn't offend seasoned C
programmers.

/Jorgen
 
V

verdverm

I bought this book years ago, when I was just learning C++. Since
then I've gone through every math course offered at my college, taken
courses on coding C & thinking in terms how how to make the smallest
tightest algorithms to preform specific functions. I've also grown
and matured a lot, and am wiser and older. I'm reading through the C+
+ Programming Language, Third Edition now, and I can actually
understand it. I can understand it because I'm already familiar with
the language. I know how to use pointers, and know what stacks,
templates, classes, and vectors are. I know how to use them. The
trouble is I don't have a lot of experience using high level object
oriented language, and haven't built any projects of my own using the
techniques. I can see why it is a good idea to think in terms of the
best algorithm you could use to write a program with C++. Because
with another language like PHP you might be able to write the same
code with just a few lines. So without all of the object oriented
tools that seperate C++ from its predecessor, C is a dead language.
It would take pages and pages of C to write some very simple code, and
you would still have to understand low level binary manipulations.

So what I am going to do is come up with a short notebook on what I
get from reading through the C++ Programming Language, -Third
Edition-, and explain to people why object oriented programming is the
shit, and teach them how to use it with clear examples that illustrate
why using vectors, templates, & classes, allow us to do so much more.
Most of the programs will probably be basic string manipulations or
simple algorithms that C++ has a hard time doing without object
oriented programming. But I will try to go over some of the basics of
C, step-by-step, and cover the useful tools that are hard to
understand like pointers and binary operators. Some of the subtleties
of the language, are the most useful parts of it.

I would be interested in learning if anyone else wants to pick up the
higher levels of C++ and work with me in this project? I know some
people posting to comp.lang.c++ already know the language by heart,
but I mostly work with reference books by my side. I guess there is
an old saying: Those who can't do, TEACH!.

if you really want to learn about the abilities of C++ and OOP I would
recomend "C++ Templates the complete guide", the Gang of Four Book
"Design Patterns" and "Modern C++ Design Patters"

I those first as a beginner, then "The C++ Lang", then the
formentioned once again.
I found that as I gained experience, I was able to get more out of the
books.

I have not done any straight C programming and wonder myself if i
should learn it to augment my C++ knowledge. I am thinking in terms
of learning the lower level control of the subsystems or foundational
blocks for ths STL, or more so in writing more efficent code without
the overhead of STL calls( or are they all that expensive ), but more
so the dynamic calls.

You might find combinding Templates and Virtualism can do some very
interesting things, but if you need a codebase that runs within a
certain amount of time perhaps by request of a customer, that you have
to go back to the basics...

So should I learn C, and is there a book/reference that is more geared
towards the C++ programmer trying to learn C. On the opposite side...
Thinking in C++ Vol1&2 are geared towards C to C++, and a great
companion reading for the "C++ Lang" did a better job of explaining
why C++ was designed the way it was from C
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top