4 ms·
I wrote Ruby for years (for fun). I always had to stop and think twice about 'unless' and translate it into 'if not'.
by afandian 4y ago
I wrote Ruby for years (for fun). I always had to stop and think twice about 'unless' and translate it into 'if not'.
- qubitcoder 4y agoExactly the same here. I write Ruby for a living and use 'unless' where it makes sense or fits with existing code. That said, when reading code, I often have to pause and mentally translate "unless" to "if not". This is especially true for more complex logic. Elegant, yes. Additional mental overhead at times, certainly.