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

C#

Name: Anonymous 2007-07-16 11:10 ID:EEzO5dcf

Ok, so I picked up Visual C# about 20 minutes ago, and it seems to be the ultimate in faggotry:
"You may already know about destructors if you have used C++. Because of the automatic garbage collection system in C#, it is not likely that you will ever have to implement a destructor unless your class uses unmanaged resources"
Even objectPascal wasn't this gay.

Name: Anonymous 2007-07-16 14:01 ID:yUz0+9zB

Yeah destructors in C# are pretty pointless.

HAHAHAHwhat? You kidding, right? Who the fuck thought of that? See it properly implemented in Python:

text = file('lol').read()
#Open file lol, call read(), since the file isn't stored, it's immediately garbage collected. File's destructor closes the file.

class lol(object):
    def __init__(self, x):
        self.x = x
    def __del__(self):
        print 'Hi, I am a destructor. I work with the GC, but I also work when called by hand, so you can do whatever suits you.'
        print 'Destroying object', self.x

o = lol(1)
o = lol(2) #lol(1) is destroyed
del o #lol(2) is destroyed by hand

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