Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
john-doe9403yEvery 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
-
Root825993yRuby 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.
Related Rants
I just discovered that Ruby is a clusterfuck!
rant
ruby