It's easy to make Fibonacci fast. And even so I wouldn't count non-idiomatic code. The first version is clearly what you would write.
Ruby
A community for discussion and news about Ruby programming.
Learning Ruby?
- Try Ruby in your browser
Tools
- Ruby Version Manager (RVM) Install, manage and work with multiple Ruby environments. adsf is an increasingly popular option too.
- rbenv Groom your app’s Ruby environment with rbenv.
- Looking for new gems? ruby-toolbox
- Install Ruby on macOS
Documentation
- Ruby API or Ruby Doc
- YARD docs via rubydoc.info YARD Documentation Server
Books
- Well Grounded Rubyist
- Eloquent Ruby
- Metaprogramming Ruby
- Effective Testing with RSpec 3
- Programming Ruby 1.9: The Pragmatic Programmers’ Guide
- The Ruby Programming Language
Screencasts
News and updates
- Ruby news in a weekly email from Ruby Weekly
- 'Planet' of Ruby blogs at rubyland.news
- Ruby tweets at @RubyInside
Very cool that Ruby can get that much faster with relatively small changes. Even just the implicit return + array allocation tip is a useful one on its own.
Even if ruby was the fastest language ever, it would still be awful. It encourages such awful coding practice.
Like what? Meta programming? Ruby on Rails is still fairly mature.
From what I've seen it encourages writing highly dynamic code that is extremely difficult to follow if you didn't write it. This is based on me trying to understand Gitlab's code. I have tried to read it to understand several different features and behaviours and every time I always get to a bit of code where I can't find the caller or callee.
Compare to VSCode which is a similarly huge codebase that I have contributed some small fixes and features to. It's night and day. Just click things to follow them. The only time it is even slightly difficult is when there's an abstract interface and then it can be a little tricky to find the concrete code that you want. But still very doable.
I think you'd have to be crazy to pick Ruby for anything other than tiny one man shows.