4 ms·
I do think this is the culture of Ruby, appealing to some and not to others. Ruby is a practical language by design and it's common to see good-natured poking
by mmahemoff 10y ago
I do think this is the culture of Ruby, appealing to some and not to others.
Ruby is a practical language by design and it's common to see good-natured poking fun at academic concepts that sound good in theory, but fall apart on corner cases (and real projects are full of corner cases).
Case in point: https://twitter.com/dhh/status/216238003817938944 https://twitter.com/dhh/status/216238003817938944
People looking for conceptual purity should look elsewhere.
- tinco 10y agoPlease don't look elsewhere for conceptual purity. Ruby is absolutely ideal for exploring any concept that can be expressed in object oriented programming, and even many that are expressed in algebra. Ruby has been designed fundamentally as an Alan Kay style object oriented programming language. In that light in my opinion it is more suitable for conceptual purity than most other scripting languages. DHH's criticism of SRP has to do with legitimate drawbacks. I think all of us have experienced the over-engineering SRP can invoke when applied naievely. Also note that DHH's framework Rails has made significant steps in enabling SRP for modern Rails applications, so this is not a flat out rejection of the idea.
- mmahemoff 10y agoI'm not sure Ruby is ideal for exploring OO concepts, as fine a language as it is. Missing, for example, are: inheritance of class attributes/methods, constraints on overriding methods (e.g. declaring as abstract or un-overridable/final), dynamic attributes. Thankfully it's a very flexible and forgiving language, so there are third-party libraries (e.g. Hashie, ActiveSupport's Concern) to accomplish these kinds of things, but the core language doesn't offer them.
- jdminhbg 10y agoThe SRP isn't really an academic concept, it's an industry concept: https://en.wikipedia.org/wiki/Single_responsibility_principle https://en.wikipedia.org/wiki/Single_responsibility_principl... I'd say it's more of a question of taste and organization.