Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

'self' and 'this'

Name: Mature Related !K/L9IJgMJY 2010-06-09 22:49

Whats your opinion on "self" or "this" in the programming languages. I think it is retarted.

you always see people doing stuff like this (in psudeo-py):

class blah
     def bloo(self, x, y)
          self.x = x
          self.y = y
               pass

when it could be:

class blah
     def bloo (x, y)
         pass


picture unrelated; this is a text board.

Name: Mature Related !K/L9IJgMJY 2010-06-09 23:50

>>3
>>7

the is issue is having it everywhere is redundant.

Though I would settle on this:

class blah
     def bloo (x, y)   <--- notice the lack of self argument
          self.x = x
          self.y = y
                pass


or some add some lua-ness:
     

       Blah.Bloo (self, x,y)     <---- notice the period
       
is the same as:

       Blah:Bloo (x, y)      <---- notice the colon



>>5
ofcourse it is real.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List