From: Philip Mak Date: 2002-07-09T08:39:16+09:00 Subject: Should libraries perform type checking? When coding a library that is meant to be reused in other code, is it a good idea to make it so that the library will react gracefully if you pass it a type that it wasn't expecting? Ruby is a bit odd in that it has type restrictions to an extent, but function definitions (i.e. "def ()" do not include type checking. Take this function for example: def CGI::escapeHTML(string) string.gsub(/&/n, '&').gsub(/\"/n, '"').gsub(/>/n, '>').gsub(/