Should I use public or private variables?

private data members are generally considered good because they provide encapsulation. Providing getters and setters for them breaks that encapsulation, but it’s still better than public data members because there’s only once access point to that data. You’ll notice this during debugging. If it’s private, you know you can only modify the variable inside the …

Read more

What are the differences amongst Python’s “__get*__” and “_del*__” methods?

The documentation for every method that you listed is easly reachable from the documentation index . Anyway this may be a little extended reference: __get__, __set__ and __del__ are descriptors “In a nutshell, a descriptor is a way to customize what happens when you reference an attribute on a model.” [official doc link] They are …

Read more

CoffeeScript: Getter/Setter in Object Initializers

No, not for now 🙁 From the CoffeeScript FAQ: Q: Will you add feature X where feature X depends on a platform? A: No, implementation-specific features are not allowed as a policy. Everything that you write in CoffeeScript should be supported and runnable on any current JavaScript implementation (in practice, this means the lowest common …

Read more