[tuhopuu-devel] Re: [tuhopuu-cvs] CVS commit: tuhopuu3/source/blender/hemesh/intern HE_ErrorState.c HE_EulerOperations.c HE_Event.c HE_Lib.c tuhopuu3/source/blender/hemesh/tools tool_average.c tool_bridge.c tool_del.c tool_drag.c tool_edgesharpen.c tool_extrude.c tool_hide.c tool_joinface.c ...

Chris Want cwant at ualberta.ca
Fri Apr 22 17:20:42 CEST 2005


Hi Jonathan,

This is a violation (for the most part) of Blender coding
standards -- it *is* perfectly valid C. In fact, I don't
always follow this practice in my personal projects.

Four reasons that I can think of why it good to enforce
this standard in tuhopuu:

* Each C file only sees symbols that it actually needs
to compile.

* With this standard, it becomes clear to see what components
a C file needs by quickly scanning the include statements.

* Think of how much longer each C file would take to compile
if we had one mega header called, say, Blender.h that
included everything.

* This is (with a few exceptions) the standard adopted by
the bf tree. Staying compatible makes life easier for those
who wish to patch their code over to that tree, and for
those that merge the trees.

Chris

Jonathan Merritt wrote:
> Hi Guys,
> 
> Just for clarification, is this a violation of the C standard, or are we
> talking about a Blender coding standard?  I'm curious because this
> caught me by surprise; I've been quite ignorant of this as a limitation.
> 
> If it's a violation of the C standard then it must surely be a violation
> that is frequently ignored.  Take a look at "Python.h" - it's a giant
> meta-include file that makes dozens of self-righteous statements about
> the C standard while including other header files on every second line! :-)
> 
> Jonathan Merritt.
> 
> joeedh wrote:
> 
> 
>>Chris Want wrote:
>>
>>
>>>Joseph Eagar wrote:
>>>
>>>
>>>>  BTW, I think I may make a global, hiarchial include for all
>>>>  tool_***.c files, to help with code cleanliness and just general
>>>>  problems with keeping tracks of lots of headers in the many tool_*
>>>>  files, especially since their are a lot of headers they all use
>>>>due to
>>>>  the unified design.
>>>>    I'm aware of the standards violation, and I won't do it if
>>>>anyone objects.
>>>
>>>
>>>
>>>If you mean that you intend to include headers from
>>>within other headers, then I object... is this what
>>>you are intending to do?
>>>
>>>Chris
>>
>>
>>for a specific case.  tool_*** files really should have a master
>>include, to maintain the unified tool design.  but it's not a real
>>priority at the moment.
>>
>>joeedh
> 
> 
> _______________________________________________
> tuhopuu-devel mailing list
> tuhopuu-devel at projects.blender.org
> http://projects.blender.org/mailman/listinfo/tuhopuu-devel
> 


-- 
Chris Want
Research Computing Support
Computing & Network Services
University of Alberta
Tel: 1-780-492-9418


More information about the tuhopuu-devel mailing list