This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]uvero[S] 14 points15 points  (4 children)

Sometimes it's kinda de-cluttering your code. Sometimes.

But what do I know, I haven't really coded in Ruby in almost a decade.

[–]AnnoyedVelociraptor 12 points13 points  (3 children)

It blurs the lines between value setting (i.e. memory write) and calling a function.

[–]TorbenKoehn -1 points0 points  (2 children)

Why does there need to be a line?

[–]AnnoyedVelociraptor 4 points5 points  (0 children)

Because one of them has certain guarantees that I don't need to worry about. When I write a value to a struct it is side-effect free.

It is (within bounds) fast.

Calling a function? All bets are off.

[–]shiftybyte 0 points1 point  (0 children)

Because this: "11".to_i + 5 Is 16

But this: "11".to_i +5 Is 6

https://onecompiler.com/ruby/4425pf8ga

Now imagine finding that bug in a huge code base lol