[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] The use of 'new_'



On Thu, 16 Nov 2000, ShredWheat wrote:

>this was my first impression also. and i had it emplemented for
>awhile. i had switched all my code to use it this way, but it never
>really sat well. (as reasons mentioned in my previous longer post)
>
>it just felt broken to have the following types of code
>
>myevent   = pygame.event.Event()
>mysurface = pygame.Surface(...)
>mysoundfx = pygame.mixer.load(...)
>mychannel = pygame.mixer.get_channel()
>myvidinfo = pygame.display.get_info()
>myarea    = pygame.Rect()
>mycdrom   = pygame.cdrom.open(...)

>since classes and types are pretty much the same thing, each one just
>created in a different language. :P (this is definitely a python wart!)
>but notice the python functions to create types are not capitalized
>int(), float(), str(). this makes me a lot more comfortable with noncaps.
>
>at this point i've got the "new_" style functions in cvs. of all the
>methods, this one feels the most comfortable to me. it gets a lot of
>things right, and leaves little room for confusion. on the other hand
>i'm not 100% pleased with this setup. this just falls into one of those
>tough categories where there's got to be a compromise.
>
>the case isn't totally closed on this on this issue, but i think the
>cement is drying.

"The cement is drying..." :-) Well, I'm in a totally different timezone
here, so all work and important decision takes place when I'm in the
kingdom of dreams.

Python uses to have classes with capital letters, see for instance
MatchObject, all thread classes etc. All classes are capitalized. Having
'new_' makes it feel less OO and more procedural. But I will not argue
about it. I can live with it, but I won't like it. :-) This is not meant
as a flame, just me trying to poke holes in the cement with a stick.

I'll check the CVS for 'set_clip()'. Thanks for fixing it!

--
--------------------+--------------------------------------------------------
Jan 'Chakie' Ekholm |     Balrog New Media    http://www.balrog.fi/
   Linux Inside     | I'm the blue screen of death, nobody hears your screams

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org