News for hackers. Stuff that matters.
Re:Read this post ‘unless’ you’re not a Ruby developer by shric on Tuesday December 13, 2022 @04:37AM (#33966569)
I'm mildly surprised the article doesn't mention that Perl, one of the languages that influenced Ruby, also has unless.
Re:Read this post ‘unless’ you’re not a Ruby developer by rjsw on Tuesday December 13, 2022 @07:59AM (#33968256)
Common Lisp has unless too, I use it where it makes sense.
Re:Read this post ‘unless’ you’re not a Ruby developer by dgunay on Tuesday December 13, 2022 @05:21AM (#33966849)
In Perl you can write postfix conditionals: `thing() unless $condition`, which at least is more natural usage of "unless" to a native English speaker than the other way around. That's the best way to use it IMO.
Re:Read this post ‘unless’ you’re not a Ruby developer by byroot on Tuesday December 13, 2022 @05:57AM (#33967141)
It's the same in Ruby. It's even mentioned in TFA.
Re:Read this post ‘unless’ you’re not a Ruby developer by sshine on Tuesday December 13, 2022 @04:44AM (#33966608)
Those who don't know history are doomed to repeat it. ;-)