What kind of prefix do you use for member variables?

No doubt, it’s essential for understanding code to give member variables a prefix so that they can easily be distinguished from “normal” variables. I dispute this claim. It’s not the least bit necessary if you have half-decent syntax highlighting. A good IDE can let you write your code in readable English, and can show you … Read more

class variables is shared across all instances in python? [duplicate]

var should definitely not be shared as long as you access it by instance.var or self.var. With the list however, what your statement does is when the class gets evaluated, one list instance is created and bound to the class dict, hence all instances will have the same list. Whenever you set instance.list = somethingelse … Read more

Pointer to class member as template parameter

From the standard: A non-type template-parameter shall have one of the following (optionally cv-qualified) types: integral or enumeration type, pointer to object or pointer to function, reference to object or reference to function, pointer to member. So it is allowed, and seems to work on g++ like this: template <Dog Person::*ptr> struct Strange { … … Read more

what is a member vs. a property

A property is one kind of member. Others might be constructors, methods, fields, nested types, conversions, indexers etc – depending on the language/platform, of course. A lot of the time the exact meaning of terminology depends on the context. To give a C#-specific definition, from the C# 3.0 spec, section 1.6.1: The following table provides … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)