Good Programming Techniques?

J

JoeC

I have seen many books that teack coding for C++. What are ways to
improve my techniques for writing larger programs. I have written many
demo programs learning some aspects of code wether it be dynamic
binding or creating function and I understand most of that but how can
I learn and employ techniques to make my programs better. I try to
employ the lessons I learn in the programs that I write. Acclerated
C++ is the best book I have found to actually write better programs.
 
V

Victor Bazarov

JoeC said:
I have seen many books that teack coding for C++. What are ways to
improve my techniques for writing larger programs.

If this is a question (which usually should end with a question mark),
then you can find some answers in "Large-Scale C++ Software Design" by
John Lakos. Also, check out "Code Complete" by Steve McConnell.
> I have written many
demo programs learning some aspects of code wether it be dynamic
binding or creating function and I understand most of that but how can
I learn and employ techniques to make my programs better. I try to
employ the lessons I learn in the programs that I write. Acclerated
C++ is the best book I have found to actually write better programs.

It is difficult (and in some cases impossible) to teach to write "better
programs". It often comes with experience (however frustrating that might
sound). The simple recipe I know has three ingredients: practice,
practice, and practice. Some like to spice it up with peer code reviews,
but that's up to you.

V
 
N

Neil Cerutti

I have seen many books that teack coding for C++. What are ways to
improve my techniques for writing larger programs. I have written
many demo programs learning some aspects of code wether it be
dynamic binding or creating function and I understand most of that
but how can I learn and employ techniques to make my programs
better. I try to employ the lessons I learn in the programs that I
write. Acclerated C++ is the best book I have found to actually
write better programs.

_The Practice of Programming_ by Kernighan and Pike is filled with
practical wisdom. Most of their advice is not specifically for
large-scale software design, but it's definitely applicable.
 
D

Daniel T.

"JoeC said:
I have seen many books that teack coding for C++. What are ways to
improve my techniques for writing larger programs. I have written many
demo programs learning some aspects of code wether it be dynamic
binding or creating function and I understand most of that but how can
I learn and employ techniques to make my programs better. I try to
employ the lessons I learn in the programs that I write. Acclerated
C++ is the best book I have found to actually write better programs.

I suggest you read the following books in order:

"Large-Scale C++ Software Design" by John Lakos.

"Object-Oriented Design Heuristics" by Arthur J. Riel

"Design Patterns: Elements of Reusable Object-Oriented Software" by
Erich Gamma, et al.

"Refactoring: Improving the Design of Existing Code" by Martin Fowler,
et al. (Examples in Java but still great stuff.)
 
J

JoeC

I posted some of what I am working on for some advice. The stuff
dosn't work as I would like but it is still a work in progress. I also
know that unerstanding syntax is paramount but many of the programming
books are massive tomes that don;t lend themselvs to sequential study
but are good refrences if you know what you want to look up. A good
example was that I missed the extern command and how it works and some
advice dramatically improved my program and some of the debugging is
was doing. I still have a ways to go.

I have written several programs in Perl and C++ and they are posted at
www.planetsourcecode.com. I always read the advice I get very carfully
because appreciate the time it takes to respond to what I post. I also
would like to help those who I can.
 
P

Puppet_Sock

Daniel T. wrote:
[snip]
I suggest you read the following books in order:

"Large-Scale C++ Software Design" by John Lakos.
[other books snipped]

I liked this book. But I would very much like to see it updated
to include the more modern aspects of C++. (Unless it has
been so updated, in which case somebody please grab the
clue bat and en-clue me abruptly.) For example, it didn't
have much to do with templates and the STL and such
like considerations.
Socks
 
P

Phlip

I liked this book. But I would very much like to see it updated
to include the more modern aspects of C++. (Unless it has
been so updated, in which case somebody please grab the
clue bat and en-clue me abruptly.) For example, it didn't
have much to do with templates and the STL and such
like considerations.

The core of that book - inside all the ultimately irrelevant guidelines - is
the methodology that produced the guidelines.

Read between the guidelines.

And read /C++ Coding Standards/ by Sutter & Alexandrescu a modern checklist.
 
A

Art Stamness

I was privileged enough to see John Lakos present at the C++ Developers
Conference in Vegas this last october, and was given a teaser chapter
from : "Large Scale C++ Software Development".

Notice the last work is Development, not Design. There is a focus on
Test Driven Development, and other larger scale issues when working
with C++ code in larger projects, than just the practical inheritance,
dependencies, and linkage issues he focused on in the first book.

-Art
 
A

Axter

JoeC said:
I have seen many books that teack coding for C++. What are ways to
improve my techniques for writing larger programs. I have written many
demo programs learning some aspects of code wether it be dynamic
binding or creating function and I understand most of that but how can
I learn and employ techniques to make my programs better. I try to
employ the lessons I learn in the programs that I write. Acclerated
C++ is the best book I have found to actually write better programs.

The following book is a good place to start:
C++ Coding Standards : 101 Rules, Guidelines, and Best Practices {Herb

Sutter, Andrei Alexandrescu}

I also recommend the following books:

Effective C++ by Scott Meyers
More Effective C++ by Scott Meyers
Exceptional C++ by Herb Sutter
More Exceptional C++ by Herb Sutter
Effective STL by Scott Meyers
Programming languages - C++ STANDARD ISO/IEC 14882:1998(E)
C++ Programming Language Special Edition, The by Bjarne Stroustrup
Efficient C++ by Dov Bulka & David Mayhew
Modern C++ Design by Andrei Alexandrescu
 
B

Bob Hairgrove

I have seen many books that teack coding for C++. What are ways to
improve my techniques for writing larger programs. I have written many
demo programs learning some aspects of code wether it be dynamic
binding or creating function and I understand most of that but how can
I learn and employ techniques to make my programs better. I try to
employ the lessons I learn in the programs that I write. Acclerated
C++ is the best book I have found to actually write better programs.

For more basic C++ things, definitely read everything you can find
written by Scott Meyers: especially "EFfective C++", "More Effective
C++" and "Effective STL". Also, all the other books mentioned in this
thread are important to read...especially the "Design Patterns" book
as well as just about anything written by Martin Fowler.

Finally, google for "Rational Unified Process" or "RUP". Lots of
software companies use this methodology in their projects. Doesn't
hurt to know what it's all about, even if you don't end up doing
something exactly that way. Of course, RUP isn't specifically about
writing programs in C++, but consists of guidelines of general
principles which can be applied to every programming language. There
are links on the IBM web site to papers (PDF and HTML) with extensive
documentation which can be viewed for free.
 
M

Marcelo Pinto

Bob Hairgrove escreveu:
For more basic C++ things, definitely read everything you can find
written by Scott Meyers: especially "EFfective C++", "More Effective
C++" and "Effective STL". Also, all the other books mentioned in this
thread are important to read...especially the "Design Patterns" book
as well as just about anything written by Martin Fowler.

Also anything by Herb Sutter, Nicolai Josuttis and Andrei Alexandrescu.
Finally, google for "Rational Unified Process" or "RUP". Lots of
software companies use this methodology in their projects. Doesn't
hurt to know what it's all about, even if you don't end up doing
something exactly that way. Of course, RUP isn't specifically about
writing programs in C++, but consists of guidelines of general
principles which can be applied to every programming language. There
are links on the IBM web site to papers (PDF and HTML) with extensive
documentation which can be viewed for free.

In this line of indications I would also suggest:

- Agile Software Development: PPP by Robert Martin
- Applying UML and Patterns by Craig Larman


HTH,

Marcelo Pinto.
 
J

JoeC

I guess there is quite a bit out there. I realy havn't had any formal
programming training only what I learn out of books. I wonder how
useful class would be but I think would be more helpful would be
knowing other people who know somthing about programming and the
exchange of ideas. I is very challenging trying to learn all of this
on my own. I think I will take a break for a while untile I get some
ideas for programs. I am going to have to come up with a better way of
writing my current project or come up with an idea for a new project.

I always like to ask what are some tips and tricks to learning
programming? Reading through those large tomes or are there some
resources better than others?
 
D

Daniel T.

"JoeC said:
I guess there is quite a bit out there. I realy havn't had any formal
programming training only what I learn out of books. I wonder how
useful class would be but I think would be more helpful would be
knowing other people who know somthing about programming and the
exchange of ideas. I is very challenging trying to learn all of this
on my own. I think I will take a break for a while untile I get some
ideas for programs. I am going to have to come up with a better way of
writing my current project or come up with an idea for a new project.

I always like to ask what are some tips and tricks to learning
programming? Reading through those large tomes or are there some
resources better than others?

I haven't had any formal training either. Actually, that isn't true, but
my formal training came *after* I learned how to program.

Write lots of programs, even trivial stuff. If you see someone else's
program and you think you could write something like it, do it. Also,
help all the college students in this group (and comp.lang.learn.c-c++)
with their homework. Do the homework yourself, and then give them hints
that you think will lead them to the answer.
 
D

davidrubin

JoeC said:
I have seen many books that teack coding for C++. What are ways to
improve my techniques for writing larger programs. I have written many
demo programs learning some aspects of code wether it be dynamic
binding or creating function and I understand most of that but how can
I learn and employ techniques to make my programs better. I try to
employ the lessons I learn in the programs that I write. Acclerated
C++ is the best book I have found to actually write better programs.

One of the most important aspects of building large systems is physical
design. Physical design focuses on building software from a
fine-grained hierarchy of reusable components, packaged into a
hierarchy of libraries. There is no better book (perhaps no other book)
explaining physical design than Lakos' Large-Scale C++ Software Design.
Some of the more interesting chapters describe techniques for
re-factoring software to break dependencies between comonents caused by
common misimplementations such as improper encapsulation and
long-distance friendships.
 
J

JoeC

I always appreciate the help and advice I get. I do read books and
keep trying to expand my programming knowlege. The best and most
practicle resource I have found is Acclerated C++ and I like their
other book as well. That book has some very intersting and powerful
ways of doing things but I have trouble translating that material into
any of my projects. Once I wrote a color mixing program that did
somthing like color(int, int, int) color(color, color). I often do
little demos but don't use that stuff much in any larger projects that
I do.
 
D

Daniel T.

"Daniel T. said:
I suggest you read the following books in order:

"Large-Scale C++ Software Design" by John Lakos.

"Object-Oriented Design Heuristics" by Arthur J. Riel

"Design Patterns: Elements of Reusable Object-Oriented Software" by
Erich Gamma, et al.

"Refactoring: Improving the Design of Existing Code" by Martin Fowler,
et al. (Examples in Java but still great stuff.)

Another great book I forgot to mention the first time around. "The
Pragmatic Programmer" by Andrew Hunt, and David Thomas.
 
M

Marcelo Pinto

JoeC said:
I guess there is quite a bit out there. I realy havn't had any formal
programming training only what I learn out of books. I wonder how
useful class would be but I think would be more helpful would be
knowing other people who know somthing about programming and the
exchange of ideas. I is very challenging trying to learn all of this
on my own. I think I will take a break for a while untile I get some
ideas for programs. I am going to have to come up with a better way of
writing my current project or come up with an idea for a new project.

I always like to ask what are some tips and tricks to learning
programming? Reading through those large tomes or are there some
resources better than others?

[Please, cote the post you are replying to in order to give some
context (if you are using google, chose "show options" and then
"Reply", and the original post will appear in your reply like it did in
this post)]

I believe the greater value you may get from a course is direction. You
probably will not 'learn' the subject until you practice it, and in a
course you usually don't have the chance to really practice. I didn't
get formal training in programming, I just read and practiced thru it.
I believe you learn a lot reading others' code, and reading a newsgroup
like this one.

If you have a mentor avaiable to give you the best advices and
directions, then you are in the best place to learn and improve.

HTH,

Marcelo Pinto
 
A

Axter

I recommend reading..
C++ Coding Standards : 101 Rules, Guidelines, and Best Practices
by Herb Sutter and Andrei Alexandresc

The following is my top 10 C++ programming books I recommend to al
professional programmers
Effective C++ by Scott Meyers
More Effective C++ by Scott Meyers
Exceptional C++ by Herb Sutter
More Exceptional C++ by Herb Sutter
Effective STL by Scott Meyers
C++ Coding Standards : 101 Rules, Guidelines, and Best Practices
{Herb
Sutter, Andrei Alexandrescu}
Programming languages - C++ STANDARD ISO/IEC 14882:1998(E)
C++ Programming Language Special Edition, The by Bjarne Stroustrup
Efficient C++ by Dov Bulka & David Mayhew
Modern C++ Design by Andrei Alexandrescu

They're listed in the order of my personal preference. 8
http://www.devplug.com
 
J

JoeC

It took a bit but I got my program to do basically what I want. Still
I am always looking for better ways of doing thing and having my
programs run smoother.
 

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,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top