3 ms·
Ruby definitely optimizes for the writer but it fails for the reader (a saying I say quite frequently at work).
by setheron 4y ago
Ruby definitely optimizes for the writer but it fails for the reader (a saying I say quite frequently at work).
- richardlblair 4y agoIt _can_. Much like any other language, if you're not careful you can write some very convoluted Ruby code. What makes Ruby different is when you invest in readability you get far greater returns for much less effort.
- deleted 4y ago[deleted]
- itake 4y agoI've been coding for 10+ years and I would argue that ruby is not kind to the writer. Ruby requires you to be aware of much more "state" than any other language that I have coded in, because all assumptions about methods cannot be confirmed until the code is run. For example, a gem might modify the default_scope of a portion of active record models. You have to memorize all these tweaks and even then you don't know if the code you've written will do what you want until it is actually been run.
- jeltz 4y agoThat is a Rails issue, not a Ruby issue. Outside some Rails libraries this is not a thing. Virtually all non-Rails libraries try hard to avoid modifying global state.
- itake 4y agorspec uses monkey patching for stubbing methods. Even rails libraries avoid modifying global state, but its still very much a thing.