Subject: Re: good guide to programming style
To: None <netbsd-help@NetBSD.org>
From: George Georgalis <george@galis.org>
List: netbsd-help
Date: 01/24/2007 01:44:47
On Tue, Jan 23, 2007 at 12:20:02PM +0000, Simon Truss wrote:
>George Georgalis wrote:
>
>>Unfortunately "good" programming is not something I can just define
>>in a short training session. And, it's too easy (and painful) to
>>just identify poor programming techniques or mistakes.  So, I'd
>>like to put some kind of training together and was wondering if
>>anyone here could provide some interesting websites to help the
>>process?
>
>Good list of links, not seen all of them before.

Thanks. not sure what was in my current list vs new
items, and the ones you shared, but the updated wiki
section is below.

>They are experts in their field so they really need an overview of 
>techniques and strategies. Introduce the main concepts explaining when 
>and why they are useful, leave them to work through the detail of copy 
>constructors and finite precision of float and doubles. All this needs 
>to be backed up with copious detail such as standards documents and 
>reference material.

finite precision and other (64 vs 32 bit) math
limitations are central, and we take care to note
the system used for our modeling simulations.

BTW - we use uname in perl, so we can get the most
critical system information on 'any' OS; though
"uname -p" seems most appropriate the "uname -m" is
the part we mostly look at since, as far as we can
tell "uname -p" is not available in perl, or is it?

It's interesting that so much of the programming
technique sites are OO oriented, not just the ones
you recommended. :) We have one perl OO programmer,
but mostly nobody understands what he does. It was
also interesting how quickly I came across this:

        Based on this analysis this is the strategy
        that I use and recommend for exception
        handling in Java: declare every method with
        "throws Exception" as the default.

I think I can make good use of the OO guides though.
BTW are "copy constructors" used or important in
shell programming?

The reason I started looking for doc was a bit of code
where an if statement over reached a loop termination
( while x; do if y; then z ; done ; fi ) and nothing
wrong with that was recognized... the fact that z was
a fork bomb was the central show stopper.  (BTW -
maybe because of thread handling (?), but 1000 forks
worked fine in Linux...)


>Might be worth checking out computer science departments web sites, they 
>often have course material online.

That's a great idea, but haven't started looking
there yet.

>Knuth: The Art of Computer Programming

...interesting author and book, will need to figure
out which volume I need and get a copy.

Thanks,
// George



== Near Term Programming and Unix Operating Systems ==
Overview of techniques and strategies -- when and why they are useful

 * [http://cm.bell-labs.com/cm/cs/who/dmr/cacm.html The UNIX Time-Sharing System] -- D. M. Ritchie and K. Thompson
 * [http://www.dwheeler.com/secure-programs/ Secure Programming for Linux and Unix HOWTO -- Creating Secure Software]
 * [http://www.faqs.org/docs/artu/ch01s06.html Basics of the Unix Philosophy] from [http://www.faqs.org/docs/artu/ The Art of Unix Programming]
 * [http://www.shelldorado.com/ good coding practices for Bourne Shell and Korn Shell script programmers.]
 * [http://www-128.ibm.com/developerworks/aix/library/au-hook_duttaC.html Best practices for programming in C]
 * [http://www.hacknot.info/hacknot/action/showEntry?eid=85 Debugging 101]

== What not to do ==
 * [http://www.soberit.hut.fi/mmantyla/BadCodeSmellsTaxonomy.htm A Taxonomy for "Bad Code Smells"]
 * [http://mindprod.com/jgloss/unmain.html unmaintainable code]

== Alternate Technique ==
 * [http://www.methodsandtools.com/archive/archive.php?id=10 Will Pair Programming Really Improve Your Project?]
 * [http://c2.com/doc/oopsla89/paper.html A Laboratory For Teaching Object-Oriented Thinking]
 * [http://www.extremeprogramming.org/ Extreme Programming] -- a deliberate and disciplined approach

== Reference ==
 * [http://www.nrbook.com/a/bookfpdf.html Numerical Recipes in Fortran 77]
 * [http://www.nrbook.com/a/bookf90pdf.html Numerical Recipes in Fortran 90]
 * [http://www.nrbook.com/abramowitz_and_stegun/ Abramowitz and Stegun: Handbook of Mathematical Functions]

== Abstract ==
 * [http://www.ibiblio.org/obp/thinkCS/cpp/english/index.htm How To Think Like A Computer Scientist]
 * [http://www.theserverside.com/tt/articles/content/BuildManagement/article.html Best Practices for Risk-Free Deployment]
 * [http://en.wikipedia.org/wiki/Design_Patterns Design Patterns: Elements of Reusable Object-Oriented Software] (also the [http://www.tml.tkk.fi/~pnr/GoF-models/html/ GoF Patterns])
   * [http://www.cs.wustl.edu/~schmidt/tutorials-patterns.html Design Pattern Tutorials] (see [http://www.cs.wustl.edu/~schmidt/PDF/patterns-intro4.pdf Introduction to Design Patterns]
   * [http://www.datingdesignpatterns.com/intro.html Dating Design Patterns] -- a tangible implementation
 * [http://www.maplefish.com/todd/papers/Experiences.html Experiences] -- A Pattern Language for User Interface Design

== The Lighter Side ==
 * [http://www.cryptonomicon.com/beginning.html In the Beginning was the Command Line] by Neal Stephenson
 * [http://research.microsoft.com/~daniel/unix-haters.html The UNIX-HATERS Handbook]
 * [http://kuoi.asui.uidaho.edu/~kamikaze/doc/kvik.html The Kvikkalkul Programming Language]
   * a [http://www.cadenhead.org/book/homepage24/kvikkalkul/kvik2c.html Kvikkalkul to C Translator]
   * a Kvikkalkul version of [http://www.99-bottles-of-beer.net/k.html#Kvikkalkul 99 bottles of beer]

== Meta Resource ==
 * [http://www.softdevarticles.com/ Software Development Articles Directory]
 * [http://stommel.tamu.edu/~baum/programming.html Programming Texts and Tutorials]

== Books ==
 * [http://www-cs-faculty.stanford.edu/~knuth/taocp.html The Art of Computer Programming (TAOCP)]


-- 
George Georgalis, systems architect, administrator <IXOYE><