Re: [Flightgear-devel] Programming Style

2007-07-05 Thread Andy Ross
Thomas Förster wrote:
 which reminds me of:
 The Zen of Python (by Tim Peters)
 Probably a bunch of good ideas for every language.

Yup, great advice.  Pity python forgot about it:

 There should be one-- and preferably only one --obvious way to do it.
 If the implementation is hard to explain, it's a bad idea.

Read and internalize those, and then teach list comprehensions to a C
programmer.

The more curmudgeonly I get, the more I think everyone should just be
coding in Nasal...

Andy

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Programming Style (was: Today's CVS)

2007-07-05 Thread Thomas Förster
 Sane code
 would just use a set_element() function and be done with it instead of
 using a design element that even good, productive programmers don't
 always recognize.  The older I get, the more C++ looks like a
 terrible, terrible mistake.

which reminds me of:

The Zen of Python (by Tim Peters)

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!


Probably a bunch of good ideas for every language.

Thomas
-- 
PhD Student, Dept. Animal Physiology, HU Berlin
Tel +49 30 2093 6173, Fax +49 30 2093 6375

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel