[fdo-dev] Naming convention for RDBMS UnitTest

Mateusz Loskot mateusz at loskot.net
Mon Aug 28 14:13:11 EDT 2006


Dan Stoica wrote:
> I (along with other people) will stick with my preference that 3) is 
> better because it is adding valuable information. e.g. in Ptr.h:
> 
> bool CopyTo(T** ppT) throw()
> 
> Same rationale apply to local function variables.

...continuing this thread as a loose opinions hyde park...

IMHO, generally, the hungarian notation and its variations is useless.
But if it's used, then IMHO it should be used consequently.
My version of the prototype mentioned above would be:

bool CopyTo(T** p);

or

bool CopyTo(T** pp);

Here, I'd avoid using T, because it decreases readability.
IMO: in dense code, T looks pretty similar to pT -> less readable.
IMO 2: T -> pT suggests that MyClass -> pMyClass, what in turn suggests
consequent and consistent naming convention in the code.
IMO 3: if one day I'll decide to use reference to pointer, instead of
double-pointer, then I'll have to do mass grep & replace, to keep things
consistent.

Finally, may be I'm too pedantic (I'm sure I am :-)) but I prefer
short, compact and clear coding guidelines (max one page) than
thick document describing all rules + human readable code is a must.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net




More information about the Fdo-internals mailing list