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

not hating ruby

Name: Anonymous 2012-01-16 8:20

g-guys i tried ruby a few days ago and i en-enjoyed it.

do any of you know where i can be cured of my homosexual urges?

Name: Anonymous 2012-01-16 15:28

# Why would I even bother trying to write
# an optimal sorting algorithm with such
# a slow language, I have no idea.
# Just look how horrid line 6 is

class Array
    def quicksort
       if self.length<=1
            self
        else
            # This next line of code is horrible
            # It isn't even the same as
            #   array=[self]
            array=Array.new(self) # Nightmares, man!
            pivot=array.pop
            less=array.select{|element|element<=pivot}
            greater=array.select{|element|element>pivot}
            less.quicksort+[pivot]+greater.quicksort
        end
    end
end

I do admit, I like type inference, blocks, complete immersion into OOP, but I find some things ugly, like blocks, singleton methods, Object methods used to access private ("object") variables, and of course the horrid:
class << self

Oh, and the Complex class makes fractions if given integers.  Ugly

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