[Tutor] Public, private and protected member variables.

Alan Gauld alan.gauld at blueyonder.co.uk
Tue Oct 21 17:51:15 EDT 2003


> I guess my reasoning for most of my statements comes from all of
those Java
> design principles that I have become so accustomed too.

I had similar problems when I moved to Delphi from C++ because
the original Delphi had no protected and only a loose form of
Private. Then when I moved to Smalltalk(much like Python,
except all variables are private) I was forced to rethink
my approach to objects and access etc.

> Alan, thanks for the comments. I come from the background of
> Java, which is very strict and it has made Python feel
> somewhat unnatural to me.

Yep, it's part of learning a new language. The good news is the
more languages you learn you become more pliable in your
approach. I'm currently learning Objective C (using Cocoa
on Mac OS X) and it takes a really strange (to me!)
approach to memory management. I'm slowly getting there
but my initial reaction was to feel very uncomfortable.

Its all part of the fun of learning a new language. And each
lessonlearnt will be useful in the other languages too!

Alan G.




More information about the Tutor mailing list