Michael Yanagi

Joined

1,620 Experience
16 Lessons Completed
0 Questions Solved

Activity

Posted in Open Closed Principle Discussion

I couldn't agree more. Thank you Chris!

Posted in Open Closed Principle Discussion

Hi there! I have a question about raising NotImplementedError.

I see "raise NotImplementedError" in the abstract class, but some people suggest not to use it. Instead, they add documentation and remove the methods. However, I think raising error in abstract methods is beneficial to those who use IDEs such as RubyMine to increase productivity with its code completion and inspection for method existance.

Could you share your opinions on which approach to use?

References:
https://github.com/rubocop-hq/ruby-style-guide/issues/458
http://chrisstump.online/2016/03/23/stop-abusing-notimplementederror/

Thanks!

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.