Stephen E. Baker
unread,Aug 6, 2015, 9:29:28 AM8/6/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to corsix...@googlegroups.com
I've removed the requirement for Hungarian notation (type prefixes) from
our C++ coding convention guide. The practice is rarely used anymore in
the wild, causes difficulties in refactoring, and is counter to the
notion of templates, generics, and even inheritance. Beyond the extra
work in implementing and maintaining them, the benefits are dubious as
every IDE is able to provide type information and access to a variable's
definition.
I think it may be worthwhile extending the C++ coding convention to cover:
Using namespace prefixes (std::) on C library functions and types.
Avoiding macros in favor of inline functions, templates, and cost variables.
Using explicitly sized primitives (cstdint types.)
Using nullptr instead of 0 or NULL for null pointers.
Preferring stack allocation to heap allocation unless impractical (large
memory requirement, out of stack references, etc.)
Using smart pointers when heap allocation is used.
Using bracket construction (uniform initialization.)
Using initialization lists or default member values over setting member
values in the constructor body.
(more?)