Why does python not have a mechanism for data hiding?
Russ.Paielli at gmail.com
Tue Jun 3 20:09:51 CEST 2008
On Jun 3, 4:21 am, George Sakkis <george.sak... at gmail.com> wrote:
> On Jun 3, 1:42 am, "Russ P." <Russ.Paie... at gmail.com> wrote:
> > On Jun 2, 10:23 pm, alex23 <wuwe... at gmail.com> wrote:
> > > Then again, I have no issue with the current convention and personally
> > > find the idea of adding a "private" keyword makes as much sense as
> > > being able to syntactically define "model", "view" and "controller"
> > > methods.
> > Well, the designers of C++, Java, and Ada, to name just three very
> > popular languages (well, two) seem to think it makes sense. But maybe
> > you know more than they know.
> And even more (well, almost all) languages use explicit delimiters for
> defining blocks instead of indentation, so what's your point ?
You are comparing a syntactic convention with a more fundmaental
aspect of the language. But beyond that, I dislike braces as
delimiters for the same reason I dislike leading underscores: both are
unnecessary syntactic noise. And the whole idea of encoding properties
of an object in its name just seems tacky to me.
What is it about leading underscores that bothers me? To me, they are
like a small pebble in your shoe while you are on a hike. Yes, you can
live with it, and it does no harm, but you still want to get rid of it.
More information about the Python-list