5

I just discovered that Ruby is a clusterfuck!

Comments
  • 1
    Every language is a clusterfuck. Have you heard of Haskell? It's supposed to be the most elegant language in use. I bet there are more examples of bad Haskell code than of state of the art clean code they say it's possible with Haskell
  • 7
    Ruby absolutely allows creating clusterfucks. Probably more than most languages because it allows you to overwrite anything you want.

    class Integer
    def +(number)
    result = self - (-number)
    return (result == 4) ? 3 : result
    end
    end

    2+2
    => 3
    2+2+2+2
    => 7
    (2+2)+(2+2)
    => 6

    It is a contrived example, but apply this to typical cases of e.g. overriding methods defined in a parent class, and a method elsewhere accepting instances of either the parent or child, and operating on them in the same way. You could say it’s a bad interface or an improper separation of concerns, and you would be right. but does this still happen in practice? It absolutely does, and it inevitably leads to a nightmare debugging session. And unless fixed correctly in the implementation, the tendrils of technical debt slowly creep throughout the codebase.

    This isn’t to say it’s unique to Ruby; all languages allow similar code smells and bad practices. The cause here is that Ruby makes everything easier — including writing absolutely atrocious code.
  • 0
    The language I love but never get to use
  • 0
    I discovers that on the first module of the learn ruby page lol
  • 0
    Ps isn’t that a fun word ?
Add Comment