3 ms·
> As a person who's dabbled a bit in Rust and Ruby, I'm surprised people find Ruby intuitive and simple IMO it's because they mostly just don't think about the
by BugsJustFindMe 1y ago
> As a person who's dabbled a bit in Rust and Ruby, I'm surprised people find Ruby intuitive and simple
IMO it's because they mostly just don't think about the chaos they're doing.
You encounter a function call that ends in a hash. Does the function being called use that as a hash or does it explode the hash to populate some extra trailing parameters? You have no way to know without going and looking. To me that's super dumb. To them it's just another day in unexpected behavior land.
- jeffrwells 1y agoWhy the us vs them mentality? How is that productive? Did people who love Ruby do something to you? Pretty hard to grow and learn new concepts if you immediately label anything you don’t understand yet as “super dumb”
- BugsJustFindMe 1y agoThis isn't any new concept to learn. There are real consequences to the other people who need to read and improve the code later to not being able to form rapid linear intuition about the meaning of values being passed around programs without looking somewhere else. It's like reading a garden path sentence where the understanding of the beginning can only exist after working backwards from the end. And there's definitely a distinct dichotomy between developers who detect the discommoding and developers who don't.
- jaredsohn 1y agore: function that ends in a hash I assume this is referring to passing hashes in as parameters to methods. Ruby 3 made this more explicit; you must use ** to convert a hash into positional arguments and you must use {} around your key/values if the first argument is a hash.
- BugsJustFindMe 1y agoI'm glad the light was eventually seen after 25 years, but that's a significantly breaking change which means the update often doesn't happen. A lot of Ruby 2 codebases still exist with people still doing Ruby 2 bad behaviors.
- yxhuvud 1y agoIt was a breaking change, but it was really small and affected only very few usages. Most places just went on with no changes. It was not at all a painful change. Also Rubyists as a whole tend to update to the newest Ruby fairly fast. There are of course places that don't upgrade quickly (especially legacy systems that are barely touched), but most places with living code bases seems to be very quick when it comes to updating nowadays.
- yxhuvud 1y ago> You have no way to know without going and looking. Honestly, this is a feature. If the difference matters, then you are likely doing something wrong.