Object-oriented Design in Ruby/Rails

3 points by sleeptillseven ↗ HN
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)?

1 comment

[ 2.0 ms ] story [ 10.4 ms ] thread
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".