2010-07-23 18:24:30 +02:00
|
|
|
Design Process : Coding Style
|
|
|
|
|
=============================
|
|
|
|
|
|
|
|
|
|
[grid="all"]
|
|
|
|
|
`------------`-----------------------
|
|
|
|
|
*State* _Final_
|
|
|
|
|
*Date* _2007-06-27_
|
|
|
|
|
*Proposed by* link:ct[]
|
|
|
|
|
-------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CodingStyle
|
|
|
|
|
-----------
|
|
|
|
|
Define coding style standard which we will use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
~~~~~~~~~~~
|
2014-10-15 23:08:53 +02:00
|
|
|
We need to agree on some coding style, IMHO consistency is the most important
|
2010-07-24 16:48:32 +02:00
|
|
|
part with this, no matter which style we use.
|
2010-07-23 18:24:30 +02:00
|
|
|
|
|
|
|
|
See http://en.wikipedia.org/wiki/Indent_style[]
|
|
|
|
|
|
|
|
|
|
.Notes:
|
|
|
|
|
* no tabs, use spaces!
|
|
|
|
|
|
|
|
|
|
.Proposed:
|
2014-10-15 23:08:53 +02:00
|
|
|
* K&R by _ichthyo_
|
2010-07-23 18:24:30 +02:00
|
|
|
* compact and well known
|
2014-10-15 23:08:53 +02:00
|
|
|
* GNU by _cehteh_
|
2010-07-23 18:24:30 +02:00
|
|
|
* imo the best readability (albeit little strange)
|
2014-10-15 23:08:53 +02:00
|
|
|
* Lumiera might apply as official GNU project someday
|
2010-07-23 18:24:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
Another question: __how to write identifiers?__
|
|
|
|
|
|
|
|
|
|
.Proposed:
|
2014-10-15 23:08:53 +02:00
|
|
|
* ichthyo: use CamelCase, start ClassNames upper case and variableNames
|
|
|
|
|
in lower case. Make all namespaces and package (dir) names completely lowercase
|
2010-07-23 18:24:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tasks
|
|
|
|
|
^^^^^
|
|
|
|
|
* Bouml config to generate this style
|
|
|
|
|
* footers (or headers) to configure common editors to use this style by default
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Conclusion
|
|
|
|
|
----------
|
|
|
|
|
we agreed on GNU style
|
2011-04-16 02:47:42 +02:00
|
|
|
|
|
|
|
|
CT:: '2007-07-03 04:04'
|
2010-07-23 18:24:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Comments
|
|
|
|
|
--------
|
2010-07-24 16:48:32 +02:00
|
|
|
Since link:ct[] called spaces instead of tabs first, we should stick to that. I
|
|
|
|
|
think all other reasons will lead us to nowhere!
|
2010-07-23 18:24:30 +02:00
|
|
|
|
2010-07-24 16:48:32 +02:00
|
|
|
Although I'm used to a BSD/KNF-like coding style I will try the GNU one. After
|
|
|
|
|
all, the wikipedia page mentions no disadvantages of that style :)
|
2010-07-23 18:24:30 +02:00
|
|
|
|
2011-04-16 02:47:42 +02:00
|
|
|
MichaelPloujnikov:: '2007-06-27 17:17'
|
|
|
|
|
|
2010-07-23 18:24:30 +02:00
|
|
|
|
2010-07-24 16:48:32 +02:00
|
|
|
I just proposed K&R because it is widely accepted. Personally, I was never very
|
2014-10-15 23:08:53 +02:00
|
|
|
fond of K&R style, I always preferred putting opening braces to the left. I
|
|
|
|
|
never used GNU style until now, but it looks somewhat appealing to me. (btw,
|
2010-07-26 02:54:14 +02:00
|
|
|
ECLIPSE comes with presets for all this styles :-P ). Anyhow, I can adapt to
|
|
|
|
|
most any style. The only thing I really dislike is using tabs (with the
|
2014-10-15 23:08:53 +02:00
|
|
|
exception of database DDLs and CSound files, where tab are actually helpful) :)
|
2010-07-23 18:24:30 +02:00
|
|
|
|
2011-04-16 02:47:42 +02:00
|
|
|
Ichthyo:: '2007-06-27 20:55'
|
|
|
|
|
|
|
|
|
|
|
2010-07-23 18:24:30 +02:00
|
|
|
''''
|
2011-02-27 23:13:09 +01:00
|
|
|
Back to link:/documentation/devel/rfc.html[Lumiera Design Process overview]
|