[clug] July Programming SIG: the fourteen principles for new programmers

Alex Satrapa grail at goldweb.com.au
Wed Jul 16 02:26:08 GMT 2008

Remember one of the core principles of "The Unix Way":

1) Make it work.
2) Make it work right.
3) Make it work fast.

*all in the specified order, no short cuts.

For object-oriented design, there's also the Law of Demeter (or  
principle of least knowledge). If you find yourself doing something  
like car.engine.starter_motor.activate, you're violating the law of  
demeter. You should use car.start_engine (that's the least thing that  
can possibly work, and it documents the intention right there in the  
program), then when the underlying model changes you don't have to go  
finding all invocations of car.engine.starter_motor.activate and  
change them to car.engine.fuel_cell.valve.open.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 220 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/linux/attachments/20080716/b6a7520c/PGP.bin

More information about the linux mailing list