3 ms·
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.
by listrophy 15y 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.
- umjames 15y agoI quick check of the Ruby documentation (http://www.ruby-doc.org/core/ http://www.ruby-doc.org/core/) suggests that raise and fail are the same method. Is there an actual difference between these methods?
- avdi 15y agoNope! 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.