3 ms·
Sigh. There are three major camps with Ruby. - Plain Old Ruby (The original.) - Rails (Ruby++) - Functional Programming (dry-rb and friends) I find it reall
by kayodelycaon 3y ago
Sigh. There are three major camps with Ruby.
- Plain Old Ruby (The original.)
- Rails (Ruby++)
- Functional Programming (dry-rb and friends)
I find it really hard to sympathize with the functional programming crowd. They are trying really hard to make Ruby into something it isn't suited for. They committing many of the same "sins" as ActiveSupport by creating a large superset of the language. (Only bolted on instead of integrated.) The end result is having an awkward interface between their code and everyone else's. Similar to how jRuby feels.
What they really want is a different programming language with a ruby-like syntax with a massive standard library and many third-party libraries.
- WJW 3y agoThe weirdest thing about things like dry-monad is that they're so incredibly shoehorned in. In places like Haskell, the default for a function is to be pure and monads add some capability for side effects (ie logging, or keeping state, or error tracking, all the way up to arbitrary IO). In Ruby on the other hand, the default is that a method can do anything it pleases, from from monkeypatching the standard libraries to database queries to launching intercontinental nuclear missiles. There is (by design!) no contract enforced at all on what the code can do. Trying to bolt paradigms from stricter languages onto Ruby is like nailing jelly to a wall.
- perceptronas 3y agoFP Scala is enforced by discipline rather than the language itself. It works wonderfully, even though you don't have effect tracking and can launch intercontinental missiles everywhere. Not saying this paradigm fits in Ruby, but it certainly works with discipline as well. As for shoehorning things into Ruby – I think its fine to experiment. Libraries can always try to bring best practices from other languages, some might fit wonderfully, others might not. I personally dislike exceptions, I will happily include "fake" Result/Either for non panic workflows
- arrowsmith 3y agoFYI: the author of this article is one of the creators of dry-rb.
- kayodelycaon 3y agoAnd he's still as bitter about Rails now as he was in 2016. :)