Skip to content →

Tag: ruby

Please Stop Abusing NotImplementedError

The purpose of NotImplementedError is defined in the Ruby docs: NotImplementedError is raised when a feature is not implemented on the current platform. For example, methods depending on the fsync or fork system calls may raise this exception if the underlying operating system or Ruby runtime does not support them. So whenever I see code like this:

I cringe. Raising NotImplementedError¬†simply to signal that a subclass didn’t abide by the contract of its superclass is an abuse of the error. The error is intended to be raised when a method cannot be implemented due to a limitation of the underlying…