Skip to content

BestPractices

djewsbury edited this page Jan 30, 2015 · 7 revisions

#Best Practices

This sections contains best practices and style rules used within XLE.

#Contents

Page Description
Naming Conventions Guidelines for naming identifiers
Order Of Interest Rule Writing good class definitions
Writing Effective Comments Writing comments in XLE
Meaningful Naming Guidelines for inventing meaningful names
Virtual Destructors Class with virtual methods should have a virtual destructor
Move Constructors Never Throw Move operators and constructors should be marked never_throw
Exceptions And Constructors Rules for exceptions thrown from constructors
Explicit Literal Types Be explicit about types of literals
Insulation in C++ Insulation of implementation details

#Outline

It's recommended that all code in XLE follows these practices as much as possible.

However, that said, all rules are made to be broken. Many practices have their exceptions, and there are always situations where the only practical solution is a special-case solution.

But. This is important -- if you choose not to follow the best practices outlined here, then you should have a good reason for it, and you should know what you're doing. If you have some doubt about your decisions, then just following the practices is best.

Every practice is provided with details and rationale detailing the intentions behind it.