> The people who like Haskell think differently from the people who like C.
I'm familiar with numerous people who _like_ C and there's one thing that stands out about them is they don't think in abstractions, effectively ruining the whole point of abstraction as a concept. You offer them, say, an STM¹, and they are like "oh, right, a semaphore here, a mutex there, that's an easy one" and so on.
> The problem comes when the Haskell types (pun intended) think that everyone else just needs to use/study Haskell more, and then they'll have their enlightenment moment.
I'm a Haskell type and ex-C type, and I don't think it is correct. To get Haskell, you have to step back and unlearn some of your knowledge about computers, no matter how hard you've acquired it. The problem with the abstractions offered by p^Wmainstream programming languages, is they leak, one way or another, so you inevitably end up not trusting any abstraction ever at all. In Haskell, abstractions are more reliable (dare I say rock-solid?), compared to mainstream, thanks to effects isolation, referential transparency, laziness and other merits and properties of the language.
Another mistake I did when starting Haskell was I expected the same words to mean the same things, `class` in particular. That cost me months of struggling to understand why it didn't work.
The bottom line is Haskell is significantly different from anything mainstream you've programmed in before and expecting it to work the same way is, uh, not very efficient.
Me from 2013 when I've left PHP for Ruby would definitely be in awe. Today, not using Ruby for 5 years now, it's "meh". With the utmost respect to the effort of everyone involved.
I mean, you have to justify being stuck somehow. While GitLab is certainly not an average Rails project technical debt-wise (I'm a tiny-time contributor to GitLab and my experience was quite amazing), but it's still Rails & Ruby all the way down there which could get you going only so much. You still have to write shitloads of tests, most of which are doing a sum-types-able programming language compiler's job over and over again. One day you realize this and that's the day Ruby is dead for you because there's no chance in hell you can persuade your peers to use measly dry-rb (dry-rb maintainers — no offense, I'm admiring your stellar work), not to mention moving to F#/Ocaml/Haskell/Rust.
I don't know the authors reason but I've personally always avoided refinements after first reading about their performance hit for JRuby code[0].
I read somewhere recently that even for MRI ruby you can take a 40% hit when using refinements (but please take that with a big pinch of salt as I can't find the source right now).
Note that this overhead apply as soon as a refinement is defined for a method regardless of wether it's ever active.
That 40% figure is for an empty method. So for "big" methods that are infrequently called it's probably fine, but it should really be avoided in hotspots.
For me refinements are a bit like meta-programming; I'm glad they exist but I think there's other ways to get the same result which are easier to live with.
Not sure why the author chose not to, but personally I’ve avoided use of refinements because of the weird, stateful way that it changes the implementation of a class. It’s too confusing to scan the code quickly and know whether a particular class has a refinement activated in a particular scope. Ideally don’t monkey patch things, wrap them in your own class that decorates a stdlib class. If you can’t do that, my personal preference is to have the monkey patched class be consistently monkey patched on all scopes.
I use refinements in a couple of my projects, they definitely feel like the right approach, especially in a library where you don't want unintended consequences.
Admittedly they're a bit of a mystery to lots of devs.
Absolutely, refinements are the most legit way of monkeypatching. I could almost bet the author doesnt know about it, had he known there is no way anyone would forego mentioning it when it was specifically introduced to address the title of the post.
I'm familiar with numerous people who _like_ C and there's one thing that stands out about them is they don't think in abstractions, effectively ruining the whole point of abstraction as a concept. You offer them, say, an STM¹, and they are like "oh, right, a semaphore here, a mutex there, that's an easy one" and so on.
> The problem comes when the Haskell types (pun intended) think that everyone else just needs to use/study Haskell more, and then they'll have their enlightenment moment.
I'm a Haskell type and ex-C type, and I don't think it is correct. To get Haskell, you have to step back and unlearn some of your knowledge about computers, no matter how hard you've acquired it. The problem with the abstractions offered by p^Wmainstream programming languages, is they leak, one way or another, so you inevitably end up not trusting any abstraction ever at all. In Haskell, abstractions are more reliable (dare I say rock-solid?), compared to mainstream, thanks to effects isolation, referential transparency, laziness and other merits and properties of the language.
Another mistake I did when starting Haskell was I expected the same words to mean the same things, `class` in particular. That cost me months of struggling to understand why it didn't work.
The bottom line is Haskell is significantly different from anything mainstream you've programmed in before and expecting it to work the same way is, uh, not very efficient.
¹: https://en.wikipedia.org/wiki/Software_transactional_memory