Quote Originally Posted by JohnW@Wessex View Post
I can never remember all of the member/non-member, return reference/value etc rules.
I have them all written down on a sheet of paper pinned above my desk.
Personally I don't think its that hard to rmember, simply never give more access/functionality then is needed. If you don't need a pointer use a reference, if its a small data type simply pass by value. For const my rule is that you only need to give the most minimal access rights.

For me its mainly hard to remain consitent because you have to keep thinking about what you're doing, at least until it becomes second nature. I tend to get carried away in what I'm doing and simply ignore all the rules to get a certain functionality working. Then I have to go back and check all the stuff and enforce the rules :P.