Python Productivity over C++ (Encapsulation)
Hung Jung Lu
hungjunglu at hotmail.com
Thu Jun 15 16:59:22 EDT 2000
>Then why does Python support encapsulation that is just as strict as C++?
>Guido
>van Rossum - exposed as a traitor to the people's revolution all along!
Ha. Then why does Guido explicitly say in the manual that these variables
are still accessible? Just to be nice, I guess? :)
>I can easily subvert encapsulation in many C++ classes simply with the line
>"#define private public" before I include any header files. Perhaps this
>means
>that C++ will in fact lead to the overthrow of evil and oppression in the
>world?
Sure. What do you think I did when it was 3:00 AM I needed to ship a product
the next day and the engine programmers weren't available to change and
recompile the libraries? (Well, it was not 3:00 AM nor the next day, but you
get the idea.) Subversion, of course. I'll let you figure out how to do
things without using "#define private public" yet still be able to access
private data members. In my world there are no variables that can't be made
public, ha! The thing is, if you have to constantly recurr to subversion to
add functionalities, there is a problem with the language.
Yeah yeah, of course people later were shocked (and one actually screamed)
at how I operated. But sorry, do you guys want the product shipped, or miss
the season and lose millions of dollars?
There have been just way too many times when I needed extra functionality
and the engine team just couldn't respond in time. Why? Because some of the
codes were written a long time ago, and it takes them (engine programers) a
long time to warm up and remember all the details. If I have to wait a few
weeks for the changes to come, we'd've missed the deadlines. By nature you
don't want to release a new version of the engine per each tiny
change/request, right? But then, how do I add functionalities when I need
them urgently? This kind of situations would've NEVER happened with Python,
where your hands are free to add more functionalities.
Then again, I guess you've never been handcuffed. :) Have you ever worked in
a corporate world? (Or am I again talking to a newbie without real-world
experience?)
>Also, remember that Java's encapsulation isn't exactly inviolable. It can't
>be.
>Think about it.
Done that thinking. :)
regards,
Hung Jung
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
More information about the Python-list
mailing list