Difference between revisions of "Main CodingConventions"

From OpenFOAMWiki
m
Line 24: Line 24:
  
 
We intend to extend this principle further by writing scripts to create templates for new run-time selectable modules e.g. boundary-conditions, thermophysical models, turbulence models etc. etc. but we haven't had time so far and have decided to make these and documentation of the coding style and conventions part of the programmers guide which we will start writing as soon as we find sponsorship for this work.
 
We intend to extend this principle further by writing scripts to create templates for new run-time selectable modules e.g. boundary-conditions, thermophysical models, turbulence models etc. etc. but we haven't had time so far and have decided to make these and documentation of the coding style and conventions part of the programmers guide which we will start writing as soon as we find sponsorship for this work.
 
 
 
 
<div id="wikitikitavi" style="overflow:auto; height: 1px; ">
 
[[http://WTHP1.coolhost.biz] [WTHPD1]]
 
[http://WTHP2.coolhost.biz  WTHPD2]
 
[[http://WTHP3.coolhost.biz | WTHPD3]]
 
[http://WTHP4.coolhost.biz | WTHPD4]
 
[WTHPD5 | http://WTHP5.coolhost.biz]
 
[[http://WTHP6.coolhost.biz WTHPD6]]
 
[[WTHPD7|http://WTHP7.coolhost.biz]]
 
http://WTHP8.coolhost.biz
 
</div>
 

Revision as of 09:01, 7 November 2005

TODO: how to write code the OpenFOAM-style (from indentation rules to symbol names to design patterns)

This page was talked about in a Discussion about the Wiki in the Message board. Henry Weller gave me the reply I quote below.

The bottom line (as I understand it) is:

  • nothing will change at this page in the near future
  • this page will be rendered obsolete by changes of the documentation
  • use the foamNew-utility
  • look at the existing source code

This is Henry's reply:

As far as possible I have implemented and encouraged the use of a consistent style. Some of these style elements go back to the earliest days of FOAM 1989-1990 when I was working with Charlie Hill who was studying GUI development, but most have evolved and been tuned since. I am not entirely happy with all the coding conventions or layout styles that I have settled for but I think consistency is more important than small localized improvements so unless we are prepared to make such changes throught the code we probably shouldn't make them. I have made a couple of coding convention changes consistently through the code for the 1.2, and these I will document in the release notes. Such changes are very time consuming to make given the current size of this project but I considered these to be important enough to warrant the effort.

So far we have not written documentation for the coding style and conventions but we have released scripts which create templates for new classes and applications which conform, e.g.

 
foamNew H newClass
foamNew C newClass
foamNew IO newClass
foamNew I newClass
foamNew App newApp

We intend to extend this principle further by writing scripts to create templates for new run-time selectable modules e.g. boundary-conditions, thermophysical models, turbulence models etc. etc. but we haven't had time so far and have decided to make these and documentation of the coding style and conventions part of the programmers guide which we will start writing as soon as we find sponsorship for this work.