CodeSOD: A Ruby Encrusted Footgun

This post was originally published on this site

The Daily WTF

Many years ago, JP joined a Ruby project. This was in the heyday of Ruby, when every startup on Earth was using it, and if you weren’t building your app on Rails, were you even building an app?

Now, Ruby offers a lot of flexibility. One might argue that it offers too much flexibility, especially insofar as it permits “monkey patching”: you can always add new methods to an existing class, if you want. Regardless of the technical details, JP and the team saw that massive flexibility and said, “Yes, we should use that. All of it!”

As these stories usually go, that was fine- for awhile. Then one day, a test started failing because a class name wasn’t defined. That was already odd, but what was even odder is that when they searched through the code, that class name wasn’t actually used anywhere. So yes, there was definitely no

To read the full article click on the 'post' link at the top.