[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: gEDA programming




Maybe
  there's no book for that, it's just programming experience... am I
  right? (I hope not! xD)
  Thanks in advance,
  A student who is a bit confused about which is good modern C
  programming style... :-)

I don't think there is any such thing. These days coders type first and avoid thinking in order to create as much code as possible (thus the perceived importance of "code completion"). But *good* programming style hasn't changed.

Think. This is painful for us barely intelligent creatures, and costs time up front, but saves time down the road.

Factor. Write *very short* independent functions. My old friend and colleague Jon Sachs, the programmer who wrote the classic "Lotus 1-2-3", liked to point out that capability of well-factored code increases exponentially with the size of the code: there's a "combinatoric explosion". But we see in the modern "code first, avoid thought as much as possible" approach that the code size increases exponentially with capability. Not good.
While this may appear rough, John has a point here I think. If you want to see some real master C++ code, get the OpenGL based first person shooter "CUBE". The developer does not accept any patches and says so, while the game is open source. Sad to say, but he knows what he's doing.

Get the game, play a few rounds, then look at the code and count the lines - it's amazing.

Armin


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user