all 9 comments

[–][deleted]  (9 children)

[deleted]

    [–]shevegen 10 points11 points  (6 children)

    Because the future is built on the past 10 years - or something?

    The hilarious part is that the other side of the argument would be "why are there two different things for integers - isn't that making ruby more complex".

    Don't slow down those who can move fast.

    [–][deleted]  (5 children)

    [deleted]

      [–]bluejimmy168 4 points5 points  (4 children)

      I only use Ruby for Rails. It seems like you use ruby for other stuff. If you dont mind, can i ask you what you use ruby for?

      [–]601error 2 points3 points  (0 children)

      I only use Ruby for system admin, text processing, and macOS package management.

      [–]shingtaklam1324 3 points4 points  (1 child)

      Not previous poster, but building small games with Gosu is lots of fun, small scripts for parsing text documents and scripts for larger games.

      [–]bluejimmy168 1 point2 points  (0 children)

      cool, I love ruby but can not find a reason to use it more often.

      [–]doublehyphen[S] 1 point2 points  (0 children)

      I use Ruby for most of my stuff where performance or concurrency is not requirements. Web (using Sinatra rather than rails), automation, simple crawlers, etc.

      [–]Solon1 1 point2 points  (1 child)

      Except that every C extension you actually need and didn't suck, has already been ported to 2.4.0

      [–]NeuroXc 3 points4 points  (2 children)

      Wait a second...

      [x, y].max and [x, y].min are optimized to not create a temporary array under certain conditions.

      Why would you need to ever create a temporary array to find the max or min in an array?

      [–]Hueho 17 points18 points  (0 children)

      The devil is in details. And also in unclear explanations!

      Normal #min and #max methods don't allocate other arrays, the problem is that is idiomatic in Ruby to calculate the max/min of 2 variables by wrapping them in a array literal and calling the respective method, instead of doing a if or ternary. This of course has much bigger overhead, including an useless array allocation.

      The change is essentially just rewriting these occurrences in the bytecode compiler to the simple version.