Talk:Writer/Code Conventions

From Apache OpenOffice Wiki
Revision as of 09:42, 9 October 2008 by B michaelsen (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

is/has-convention

bjm: Using the is/has convention for booleans allows writing code that reads like natural english:

if(m_isFileOpen && m_aSource.hasData() && their_isLoggingEnabled) lcl_writeLogEntry();

"If my file is open and my source has data and the logging for all SomeClass is enabled then write a log entry." an alternative would be our_ as prefix for static members.

if(m_isFileOpen && m_aSource.hasData() && our_isLoggingEnabled) lcl_writeLogEntry();

"If my file is open and my source has data and our logging is enabled then write a log entry."

hungarian prefixes

tl: Use the "a" prefix for class/struct values (not primitives like int, float, char, bool, ...) only.

bjm: Why not for primitives? Keep in mind there are still the optional prefixes.

anonymnous namespace

mst: imho anonymous namespaces in c++ are completely useless; just use static linkage instead

bjm: why not both? That might at least help code analysis tools like lxr, autodoc, doxygen etc.

Personal tools