Hacker News new | ask | show | jobs
by listrophy 5532 days ago
After seeing Avdi talk about this at Ruby on Ales, I've started using `fail` almost exclusively instead of `raise.`

It's the little things.

1 comments

I quick check of the Ruby documentation (http://www.ruby-doc.org/core/) suggests that raise and fail are the same method.

Is there an actual difference between these methods?

Nope! It's strictly a style issue. As I explain in the video (or the book if you buy it), as a result of a conversation with Jim Weirich I'm starting to use "fail" once again.