Re:Read this post ‘unless’ you’re not a Ruby developer
by burke on Tuesday December 13, 2022 @10:48AM
(#33970409)
On this note: I’m sad ruby style guides generally ban “and” and “or”.
This reads much worse, when the string pushes the line near max width, than:
Of course it’s another idiom to learn but it’s not a difficult one when used simply.
[ Parent
| on HN ]
Re:Read this post ‘unless’ you’re not a Ruby developer
by klodolph on Tuesday December 13, 2022 @11:07AM
(#33970720)
That’s a very Perl idiom, did you previously write Perl?
Re:Read this post ‘unless’ you’re not a Ruby developer
by burke on Wednesday December 14, 2022 @10:25AM
(#33984720)
No, I just think for all ruby is bought into these guard clauses, it's sad that we generally reject the feature that allows putting either the condition or the consequence first, depending on which reads better.