Live data from Hacker News

Object-oriented Design in Ruby/Rails

news.ycombinator.com

1–2 of 2 posts

Object-oriented Design in Ruby/Rails

#1
In a discussion about design and ruby/rails apps, a statement has been brought up as a counter argument against the use of trailblazer, DDD techniques and Rails (best/standard) practices to tame complexity. And that is that "[...] there are cases where 300+ lines of a Ruby class are the right thing". Just to be clear, these 300 lines are pure LoC, no comments or line breaks (I already subtracted those away).

I cannot believe that's even close to true, but nevertheless I would like to know the opinion of the Ruby/Rails community. Can you really think of such (valid) use cases and or did you even come across those (apart from anti-pattern use cases)?

Re: Object-oriented Design in Ruby/Rails

#2
For most code, separation of concerns should mean 300 lines of code is spread across multiple files. But Ruby programming can still be fairly rote sometimes. Say there's some grammar parser which has 50 case statements. It might be easier on the eyes, but I don't think separating such code into multiple files is necessarily an "object oriented principle".