Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search
 

Actually, the 'new' keyword is important in C++ to differentiate the different storage classes (heap vs. stack or static storage for the object). I agree that it isn't necessary in Java, but you need *something* in C++ to tell where to put the object. 'new' is as good as anything.

f  e  x


"Pyton's spar(s)e syntax ..."

f  e  x


Saying "the first method is special" can easily be misread as implying it's special because it's first - and then the entire sentence becomes confusing. Saying "the __init__ method is special" would be clearer.

f  e  x


http://diveintopython.org/object_oriented_framework/defining_classes.html

speaks about __init__ as not being a constructor. It might be useful to mention this disagreement in definitions.

f  e  x


Shouldn't "self" be implicit in the definition as well?

f  e  x


I believe there is a reason why one must put self (or what ever you call it) in the definition. The parameter list is a tuple and hence read only. If you do not explicitely place self in it, the compiler can not place it in that tuple either. Also, it helps to add clarity to show where from the self came into being; otherwise one is forced to assume that a self argument manifests itself by magic. That does not go well with the readbility phylosophy of Python. Also why would Python force upon the user a special word self, when it can give the choice of the name to the programmer.

f  e  x


as noted before saying that __init__ is the constructor is misleading (especially for C++ developers) because the object is already constructed by the time it executes the __init__

f  e  x



Add your comment below. Use an empty line between each paragraph. Paragraphs will be automatically formatted, and single carriage returns will be respected. Use <code> to begin a code block, and </code> to end a code block. Your email address will not be visible to spam harvesters or used in any way except to contact you with further questions.

Your Email Address:

Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.