PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > Effective C++ 3/e or 2/e ?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Effective C++ 3/e or 2/e ?

Réponse
 
LinkBack Outils de la discussion
Vieux 27/12/2007, 12h37   #1
arnuld
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Effective C++ 3/e or 2/e ?

Hi all,
I have come to a point where I can comprehend C++ code much better.
I will finish C++ Primer 4/e within next few days. Right now I am
feeling the need to have have coding standards when I write programs and
I feel I must apply some better ways to design my code e.g. all of my
the programmers at my college use to write this code:


for( int i=0; i <= 10; ++i )
{
add elements to array;
}


while I used this code from C++ Primer (the book recommended by you
people)


for( std::vector<int>::const_iterator iter = ivec.begin();
iter != ivec.end(); ++iter )
{
ivec.push_back;
}


and comp.lang.c++ totally pushed the things to the practical-level. One
of the best examples I have is this:

std::copy( std::istream_iterator<int>( std::cin ),
std::istream_iterator<int>(),
back_inserter( ivec ) );


no use of while-loop here while all of Post-Graduates of my college use
while, arrays an pointers and have no idea about map & istream
iterators.

what I am trying to say that std::copy is a good coding-standard. Now as
I will start writing code for real-life projects I want have a larger
look at coding standards so except hanging around comp.lang.c++ I want to
have an offline source. I have 2 choices:

1.) Effective C++ 3/e

2.) Effective C++ 2/e , Coding Standards (Herb Sutter et al.)

Effective C++ 3/e is twice as much expansive as 2/e. With limited
bud what you people advise ?

or you think I need something else to do and you have some other plans
for me , after all you are my teachers. I will be writing real-life
code within next week.

  Réponse avec citation
Vieux 27/12/2007, 13h55   #2
Daniel T.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Effective C++ 3/e or 2/e ?

arnuld <NoSpam@NoPain.com> wrote:

> I have come to a point where I can comprehend C++ code much better.
> I will finish C++ Primer 4/e within next few days. Right now I am
> feeling the need to have have coding standards when I write programs and
> I feel I must apply some better ways to design my code e.g. all of my
> the programmers at my college use to write this code:
>
>
> for( int i=0; i <= 10; ++i )
> {
> add elements to array;
> }
>
>
> while I used this code from C++ Primer (the book recommended by you
> people)
>
>
> for( std::vector<int>::const_iterator iter = ivec.begin();
> iter != ivec.end(); ++iter )
> {
> ivec.push_back;
> }


Note: the above loop may not work. Modifying the size of a vector while
iterating through it is dangerious.

> and comp.lang.c++ totally pushed the things to the practical-level. One
> of the best examples I have is this:
>
> std::copy( std::istream_iterator<int>( std::cin ),
> std::istream_iterator<int>(),
> back_inserter( ivec ) );


The three loops above do completely different things. :-( But I think I
understand what you are getting at.

> no use of while-loop here while all of Post-Graduates of my college use
> while, arrays an pointers and have no idea about map & istream
> iterators.
>
> what I am trying to say that std::copy is a good coding-standard. Now as
> I will start writing code for real-life projects I want have a larger
> look at coding standards so except hanging around comp.lang.c++ I want to
> have an offline source. I have 2 choices:
>
> 1.) Effective C++ 3/e
>
> 2.) Effective C++ 2/e , Coding Standards (Herb Sutter et al.)
>
> Effective C++ 3/e is twice as much expansive as 2/e. With limited
> bud what you people advise ?


I thing the C++ Coding Standards book is an excellent all around
reference. I haven't read Effective C++ 3/e so I really can't you
here.

What does Stroustrup say?
http://www.research.att.com/~bs/bs_f...oding-standard
  Réponse avec citation
Vieux 28/12/2007, 13h06   #3
arnuld
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Effective C++ 3/e or 2/e ?

> On Thu, 27 Dec 2007 08:55:13 -0500, Daniel T. wrote:

> The three loops above do completely different things. :-( But I think I
> understand what you are getting at.





> I thing the C++ Coding Standards book is an excellent all around
> reference. I haven't read Effective C++ 3/e so I really can't you
> here.


thanks. I have searched the bookpool and found that 2/e was published in
SEP 1997, a year before ISO C++ standard was released and 3/e was
published in 2005.

> What does Stroustrup say?
> http://www.research.att.com/~bs/bs_f...oding-standard


THNKS A LOT for that link. Stroustrup says this:

-- C++ of 1990s
-- C++ as of ISO standard (1998)
-- C++ in 2005

he says these are 3 totally different approaches to C++ programming,
hence I will go with 3/e


  Réponse avec citation
Vieux 28/12/2007, 13h22   #4
arnuld
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Effective C++ 3/e or 2/e ?

> On Thu, 27 Dec 2007 08:55:13 -0500, Daniel T. wrote:

> I thing the C++ Coding Standards book is an excellent all around
> reference. I haven't read Effective C++ 3/e so I really can't you
> here.
>
> What does Stroustrup say?
> http://www.research.att.com/~bs/bs_f...oding-standard



thanks, now the only problem is of some OO book. I do not want any
theoretical foundations of OOA/M/D. I want a book where i can understand
OO ideas in terms of C++ where I can get down fast enough to do C++ coding
in an OO way.

any advise will be ful.
  Réponse avec citation
Vieux 28/12/2007, 13h24   #5
arnuld
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Learning OO in C++ way (was: Effective C++ 3/e or 2/e )

changed the title to reflect the discussion.
  Réponse avec citation
Vieux 28/12/2007, 13h33   #6
Erik Wikström
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Effective C++ 3/e or 2/e ?

On 2007-12-28 14:22, arnuld wrote:
>> On Thu, 27 Dec 2007 08:55:13 -0500, Daniel T. wrote:

>
>> I thing the C++ Coding Standards book is an excellent all around
>> reference. I haven't read Effective C++ 3/e so I really can't you
>> here.
>>
>> What does Stroustrup say?
>> http://www.research.att.com/~bs/bs_f...oding-standard

>
>
> thanks, now the only problem is of some OO book. I do not want any
> theoretical foundations of OOA/M/D. I want a book where i can understand
> OO ideas in terms of C++ where I can get down fast enough to do C++ coding
> in an OO way.
>
> any advise will be ful.


If you do not already have it Design Patterns by Gamma et al. is often
recommended, and there are many (all?) examples in C++, but if you
understand the concepts they will be applicable in most OO languages.

--
Erik Wikström
  Réponse avec citation
Vieux 28/12/2007, 13h36   #7
arnuld
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Learning OO in C++ way

> On Fri, 28 Dec 2007 13:33:02 +0000, Erik Wikström wrote:

> If you do not already have it Design Patterns by Gamma et al. is often
> recommended, and there are many (all?) examples in C++, but if you
> understand the concepts they will be applicable in most OO languages.


thanks and that book is also recommended by C++ FAQs. I think that will be
too dense for a beginner (like Booch is too confusing to me)


  Réponse avec citation
Vieux 28/12/2007, 14h36   #8
Daniel T.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Effective C++ 3/e or 2/e ?

arnuld <NoSpam@NoPain.com> wrote:
> > Daniel T. wrote:

>
> > I thing the C++ Coding Standards book is an excellent all around
> > reference. I haven't read Effective C++ 3/e so I really can't you
> > here.
> >
> > What does Stroustrup say?
> > http://www.research.att.com/~bs/bs_f...oding-standard

>
> thanks, now the only problem is of some OO book. I do not want any
> theoretical foundations of OOA/M/D. I want a book where i can understand
> OO ideas in terms of C++ where I can get down fast enough to do C++ coding
> in an OO way.
>
> any advise will be ful.


"Object-Oriented Design Heuristics" by Arthur J Riel.
"C++ FAQs" by Marshall P. Cline, & al.
  Réponse avec citation
Vieux 28/12/2007, 14h47   #9
Daniel T.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Learning OO in C++ way

arnuld <NoSpam@NoPain.com> wrote:
> > Erik Wikström wrote:
> >
> > If you do not already have it Design Patterns by Gamma et al. is often
> > recommended, and there are many (all?) examples in C++, but if you
> > understand the concepts they will be applicable in most OO languages.

>
> thanks and that book is also recommended by C++ FAQs. I think that will be
> too dense for a beginner (like Booch is too confusing to me)


Design Patterns is a great book. The problem with it (from a beginner's
perspective) is that it's a bunch of solutions looking for problems. A
beginner still needs to learn when to apply which solution and DP
doesn't go into much depth about that.

That's why I recommended "Object-Oriented Design Heuristics". It gives
motivation as to why a particular pattern is good so you can more easily
see when to use it. The book also covers some patterns, how to transform
code from one pattern to another and why you might want to.
  Réponse avec citation
Vieux 28/12/2007, 15h18   #10
Victor Bazarov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Learning OO in C++ way (was: Effective C++ 3/e or 2/e )

arnuld wrote:
> changed the title to reflect the discussion.


What discussion? I can only see the post (with the allegedly
changed title "Learning OO in C++ way (was: ...") and the only
line inside is your announcement about changing the title.

Please consider that not some newsreader software is quite
unsophisticated and only keeps the messages threaded by the
_exact_ title. Changing titles means introducing new thread
in such software.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  Réponse avec citation
Vieux 28/12/2007, 16h58   #11
arnuld
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Learning OO in C++ way (was: Effective C++ 3/e or 2/e )

> On Fri, 28 Dec 2007 10:18:03 -0500, Victor Bazarov wrote:

> What discussion? I can only see the post (with the allegedly
> changed title "Learning OO in C++ way (was: ...") and the only
> line inside is your announcement about changing the title.


yes. right. If you say it is bad way, then I will not do it again.


> Please consider that not some newsreader software is quite
> unsophisticated and only keeps the messages threaded by the
> _exact_ title. Changing titles means introducing new thread
> in such software.



I didn't know that. I use PAN and it is quite sophisticated. but that
is not my point. My point was I do not want OOA/M/D book. I want to
know some list of good books which do OOP in C++. I will try to figure
out OOA/M/D later because OOA -> D -> P doe snot work for me and
hence I am going the opposite way OOP > D -> A
  Réponse avec citation
Vieux 28/12/2007, 18h26   #12
Victor Bazarov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Learning OO in C++ way (was: Effective C++ 3/e or 2/e )

arnuld wrote:
> [..] My point was I do not want OOA/M/D book. I want to
> know some list of good books which do OOP in C++. I will try to figure
> out OOA/M/D later because OOA -> D -> P doe snot work for me and
> hence I am going the opposite way OOP > D -> A


You probably prefer to learn by example. You might want to see some
C++ code first, then explanation of what it models, and then what
principles that model implements. AFAICS it doe snot mean it's bad
or impossible to learn that way. It's just backwards. By seeing the
result and then the explanation of the principles that led to that
design you don't learn why the principles produce that result. What
is worse, you only learn that a certain principle produces a certain
result, IOW one-to-one relationship between them.

Here is an analogy: in middle ages alchemists didn't have a system.
They knew properties of some materials, they knew the results of
some combinations, but had no idea why it was so. The progress in
such case is very very very slow. Once the system was developed,
it was possible to predict how elements would respond to each other
and there was no need to use the "poke-and-see" method. What is
better that now people know that there is more than one way to get
what they want.

You need to learn the system, and that's why you need to start from
OOD and OOA. OOP is a mere derivative from that. You need to find
a good OOD book with plenty of good examples instead of trying to
understand what OOD is from the result it leads to. Trying to come
up with OOD principles from C++ code is akin to trying to come up
with C++ code from an watching the application [written in C++] do
its thing.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h20.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,22996 seconds with 20 queries