by bkul · 9y ago · 0 comments
Python36 gradual typing also helps here though, and am definitely interested to see if that changes the game a bit
Not true; C++ classes have zero performance overhead over C/C++ structs (because they're just another word for the same thing).
Of course Python classes have a lot of costly features that C++ classes don't have, but the notion of a "class" (with methods, constructors etc) is not one of them.
In C++ ease of use is given up for the sake of performance. In python it is the other way.
class A {
int a; // private
}
struct A {
int a; // public
}