[vtk-developers] style : Holiday greetings and a present of V TK4.0

Volpe, Christopher R (CRD) volpecr at crd.ge.com
Fri May 25 10:18:18 EDT 2001



|> Well, I don't mind tabs as longs as they are every 4 chars, 
|> which is my 
|> settings in Emacs.

Doesn't everybody indent 2 chars per indentation level?

|>          + you *have* to use that style for Tcl scripts, 
|> because it's part 
|> of the syntax.

As long as we're griping, incorporating an indentation style into the syntax is an abomination. 

|> And you are perfectly right, because any experienced C 
|> programmer how bad 
|> this :
|>          if (condition)
|>           do something;
|> is. This is a common pitfall and you will definitely fall 
|> into it if you 
|> use VTK, because most VTK macros are not capitalized (as 
|> they sometimes are 
|> in other toolkits) and look as if they were regular functions, thus :
|>          if (condition)
|>           use a function which is indeed a macro that is 
|> more than one 
|> statement;
|> will kill you.

... which is why any experienced C programmer writes her macros like this:

#define FOOBAR(x) \
do \
  { \
  do_something(); \
  do_something_else(); \
  etc(); \
  } \
while (0)


> Chris
> 
============================================
Christopher R. Volpe
Computer Scientist
Visualization and Computer Vision Program 
Electronic Systems Laboratory
Bldg KW, Room C215
General Electric Corporate Research & Development
P.O. Box 8, Schenectady, NY 12301

(518) 387-7766, Dial Comm: 8*833-7766, Fax: (518) 387-6981
e-mail: volpecr at crd.ge.com    web: http://www.crd.ge.com/~volpecr



 




More information about the vtk-developers mailing list