9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Balwinder S Dheeman <bsd.SANSPAM@anu.homelinux.net>
To: 9fans@9fans.net
Subject: Re: [9fans] c++
Date: Mon, 19 Nov 2012 12:17:10 +0000	[thread overview]
Message-ID: <nhjpn9x171.ln2@news.homelinux.net> (raw)
In-Reply-To: <7a746291161fe83e1df0401af21f6ce4@quintile.net>

On 11/19/2012 03:29 PM, Steve Simon wrote:
> I need to learn c++ for work - people have strong opinions on
> languages I know, and not everyone likes c++ but its a requirment for me.
>
> I really want to develop a good sence of c++ style, I learnt C at the feet of
> K&R and then the plan9 sourcecode so I learnt how to write clean elegant code
> (I think :-). The problem I am finding is there are many c++ styles and I have
> yet to find a clean and elegant one.
>
> anyone sugest a project that I could look at that contains well written code?
> failing that is there a book that teaches good style?
>
> I am refering to things like adding a leading m_ to class member variables
> (which looks horrid to me but I am willing to learn), and smart locks (mutexs
> which unlock on destruct).

I think, one should use proper design regardless of program size; keep
in mind that the small programs tend to become large programs.

In my view this means adhering to the OO (object oriented) programming
paradigm making full use of established design patterns. In essence this
boils down to programming against interfaces (pure virtual classes in C++).

The best books in the best practice category I've come across are:

1. C++ Coding Standards by Sutter and Alexandrescu, and
2. API design for C++ by Reddy.

The best OO design pattern introductory book I come across unfortunately
uses Java as model language but it's still worth reading for the insight,

3. Head First Design Patterns by Freeman & Freeman.

and a few of the must read books:

1. C++ Annotations by Frank B. Brokken
    http://www.icce.rug.nl/documents/cplusplus/

See also:

1. http://www.cplusplus.com/

The best projects in the best/clean coding style I've come across are:

1. http://yate.null.ro/
2. http://qt.digia.com/

Hope that helps.

--
Balwinder S "bdheeman" Dheeman
(http://werc.homelinux.net/contact/)



  parent reply	other threads:[~2012-11-19 12:17 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19  9:59 Steve Simon
2012-11-19 10:10 ` Mathieu Lonjaret
2012-11-19 11:31   ` Aram Hăvărneanu
2012-11-19 10:45 ` iainws
2012-11-19 12:17 ` Balwinder S Dheeman [this message]
2012-11-19 12:46   ` Aram Hăvărneanu
2012-11-19 12:55     ` hiro
2012-11-19 13:22   ` cinap_lenrek
2012-11-19 14:58     ` tlaronde
2012-11-19 15:17       ` Bence Fábián
2012-11-19 14:25 ` Robert Raschke
2012-11-19 14:56 ` Calvin Morrison
2012-11-19 14:09   ` cinap_lenrek
2012-11-19 15:38     ` Bence Fábián
2012-11-19 16:45       ` Jeff Sickel
2012-11-19 15:10   ` Kurt H Maier
2012-11-22 14:10     ` David Leimbach
2012-11-22 14:13       ` David Leimbach
2012-11-19 16:21 ` Andrés Domínguez
2012-11-19 20:02 ` Aharon Robbins
2012-11-20  2:24 ` Taj Khattra
2012-11-20  3:47   ` Bruce Ellis
2012-11-19 22:48 steve
2012-11-20  1:37 ` Jeff Sickel
2012-11-20  2:08   ` Matthew Veety
2012-11-20 10:12     ` Steve Simon
2012-11-22  9:54       ` Balwinder S Dheeman
2012-11-22 10:07         ` lucio
2012-11-22 10:21           ` Nemo
2012-11-22 15:37             ` lucio
2012-11-22 16:19               ` Nemo
2012-11-22 16:31                 ` lucio
2012-11-25  6:09                   ` David Leimbach
2012-11-22 10:39           ` Charles Forsyth
2012-11-22 10:18         ` Lluís Batlle i Rossell
2012-11-22 11:34         ` hiro
2012-11-22 11:57           ` Charles Forsyth
2012-11-22 14:25             ` Dan Cross
2012-11-22 13:13           ` Hugo Rivera
2012-11-22 13:48             ` hiro
2012-11-22 14:22               ` erik quanstrom
2012-11-22 14:38                 ` Dan Cross
2012-11-22 14:47                   ` erik quanstrom
2012-11-22 14:54                     ` Hugo Rivera
2012-11-22 15:47                       ` tlaronde
2012-11-22 16:00                         ` erik quanstrom
2012-11-22 16:11                           ` Bakul Shah
2012-11-22 16:15                           ` lucio
2012-11-22 16:31                             ` erik quanstrom
2012-11-22 17:30                               ` lucio
2012-11-22 16:18                           ` tlaronde
2012-11-22 16:06                       ` lucio
2012-11-22 16:07                         ` erik quanstrom
2012-11-22 16:12                         ` Hugo Rivera
2012-11-22 16:25                           ` lucio
2012-11-22 16:51                         ` Bakul Shah
2012-11-22 17:16                           ` Charles Forsyth
2012-11-22 17:39                           ` lucio
2012-11-22 17:51                             ` Paul Lalonde
2012-11-22 17:53                               ` hiro
2012-11-22 18:13                                 ` lucio
2012-11-22 18:00                               ` lucio
2012-12-03 13:43                       ` Ethan Grammatikidis
2012-12-03 14:13                         ` Charles Forsyth
2012-12-03 14:58                           ` Kurt H Maier
2012-12-03 15:21                             ` Charles Forsyth
2012-12-03 15:29                               ` Kurt H Maier
2012-12-04 21:36                                 ` hiro
2012-11-22 16:58                     ` Dan Cross
2012-11-22 22:25                       ` erik quanstrom
2012-11-22 14:54                   ` dexen deVries
2012-11-22 17:04                     ` Dan Cross
2012-11-22 17:31                       ` hiro
2012-11-22 17:45                         ` Dan Cross
2012-11-22 17:46                         ` lucio
2012-11-22 20:17                           ` Matthew Veety
2012-11-22 17:42                       ` lucio
2012-11-22 17:44                         ` hiro
2012-11-22 17:47                           ` lucio
2012-11-22 19:55                             ` Kurt H Maier
2012-11-23  3:31                               ` lucio
2012-11-23  3:56                                 ` Kurt H Maier
2012-11-22 17:50                         ` Dan Cross
2012-11-22 17:59                           ` lucio
2012-11-22 18:02                             ` Charles Forsyth
2012-11-22 18:12                               ` lucio
2012-11-22 19:15                                 ` Richard Miller
2012-11-22 21:48                                 ` Bakul Shah
2012-11-22 21:34                               ` Bakul Shah
2012-11-22 16:15                   ` Christopher Nielsen
2012-11-22 17:10                   ` Kurt H Maier
2012-11-22 17:18                     ` Charles Forsyth
2012-11-22 17:22                       ` tlaronde
2012-11-22 17:27                         ` Bakul Shah
2012-11-22 17:45                     ` Dan Cross
2012-11-22 19:55                       ` Kurt H Maier
2012-11-23  9:42                     ` Balwinder S Dheeman
2012-11-22 17:58                   ` lucio
2012-11-22 16:32                 ` Richard Miller
2012-11-22 17:39                   ` hiro
2012-11-22 20:14                   ` Matthew Veety
2012-11-22 15:50           ` lucio
2012-11-22 14:54         ` Bakul Shah
2012-11-22 17:40       ` Pavel Klinkovsky
2012-11-22 18:11         ` tlaronde
2012-11-20 19:58     ` Wes Kussmaul
2012-11-20 20:07       ` tlaronde
2012-11-20 20:17         ` Wes Kussmaul
2012-11-22 12:58         ` Pedro Lamarão
2012-11-20 19:05 ` Bakul Shah
2012-11-20 20:31   ` Skip Tavakkolian
2012-11-20 20:09 ` dexen deVries
2012-11-22 22:32 [9fans] C++ Winston Kodogo
2012-11-23  3:04 ` Comeau At9Fans
2012-11-23  9:47 ` Gorka Guardiola
2012-11-23 10:21   ` dexen deVries
2012-11-23 13:28     ` Pedro Lamarão
2012-11-23 14:02       ` lucio
2012-11-25  6:03         ` David Leimbach
2012-11-27 17:09     ` Eugene Gorodinsky
2012-11-27 19:57       ` David Leimbach
2012-11-27 20:15         ` Kurt H Maier
2012-12-03 10:02 ` faif
2012-11-24  1:45 Winston Kodogo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nhjpn9x171.ln2@news.homelinux.net \
    --to=bsd.sanspam@anu.homelinux.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).