Things that may inspire me to hunt and kill you

Written by Piers Cawley on

Let’s say you’re writing a ruby library. Something you want and expect others to use. Here’s how to reduce those others to incandescent rage: require ‘rexml’ include REXML module MyShinyModule … end No. Not no how. Not never. You just crapped in my namespace and stomped on who knows how many of my own classes. Now, include is a fine and dandy thing, and it certainly has its uses, but using it at the top level of your library files is not one of them.

Let’s say you’re writing a ruby library. Something you want and expect others to use. Here’s how to reduce those others to incandescent rage:

require 'rexml'

include REXML

module MyShinyModule
...
end


No. Not no how. Not never. You just crapped in my namespace and stomped on who knows how many of my own classes. Now, `include` is a fine and dandy thing, and it certainly has its uses, but using it at the top level of your library files is not one of them.

Ahem.

Can anyone guess which library has been wasting my morning?

    
  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions