KoalaUnknown@lemmy.world to Programmer Humor@programming.devEnglish · 1 month agoWhat's a readabilitylemmy.worldimagemessage-square45linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageWhat's a readabilitylemmy.worldKoalaUnknown@lemmy.world to Programmer Humor@programming.devEnglish · 1 month agomessage-square45linkfedilink
minus-squarefloofloof@lemmy.calinkfedilinkarrow-up0·edit-21 month agoAnother old programmer here, and I don’t see the issue. C# gets better with every release and the null coalescing assignment operator is very handy. It also exists in JavaScript.
minus-squareLeFrog@discuss.tchncs.delinkfedilinkarrow-up0·edit-21 month agoRuby has it as well: a ||= b # which means a = a || b # wich is the same as a = b if !a # which rubyists like to write as a = b unless a # or as ternary a = a ? a : b
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up0·1 month agoThat’s way too many ways of doing the same thing, yuck. But you’re saying the idiomatic way is to use unless, rather than the actual operator for this?
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up0·1 month agoI feel like it boils down to understanding that operator. I’m a TypeScript developer by trade so I had no issue understanding this. 🤷♂️
Another old programmer here, and I don’t see the issue. C# gets better with every release and the null coalescing assignment operator is very handy. It also exists in JavaScript.
Ruby has it as well:
a ||= b # which means a = a || b # wich is the same as a = b if !a # which rubyists like to write as a = b unless a # or as ternary a = a ? a : bThat’s way too many ways of doing the same thing, yuck.
But you’re saying the idiomatic way is to use
unless, rather than the actual operator for this?I feel like it boils down to understanding that operator. I’m a TypeScript developer by trade so I had no issue understanding this. 🤷♂️