Hacker News new | past | comments | ask | show | jobs | submit login
Rails is not written in Ruby (solnic.codes)
11 points by psadauskas on Feb 3, 2022 | hide | past | favorite | 4 comments



I know many people are saying that nowadays the Ruby community is more disciplined and doesn't favor monkey-patching and I respect that. To me though, it's a huge turn-off that the language even allows for monkey patching.

For context, I worked with Rails for ~6.5 years, starting somewhere in 2009 and stopped at the beginning of 2016 in favor of Elixir + Phoenix.

"Just be disciplined" simply isn't cutting it for me anymore. That's why I started leaning more and more to Rust and OCaml with time, too.


I’ve been developing in Crystal a lot lately, and it’s a very interesting middleground.

You can still monkey patch, but having type safety and compilation gives you guarantees that you don’t get when you do the same thing in ruby. What you get out of the box is flexible, but still doesn’t require “discipline” in the same way Rails is.

The downsides right now are the small community and compilation times are an impediment to new dev UX for sure, but it’s definitely caused me to rethink what I really value from ruby.


Adding methods isn't patching or altering.

It doesn't change anything because nothing existing knows or depends on the added methods.

If you want to show that something is rotten/bad, you have to show that existing methods are being redefined. This article makes no accusation that ActiveSupport adds this; it just gives evidence of and discusses methods being added.

There is a problem when you don't have Lisp style symbol packages. If two developers add a frob method to the String class, they have a clash.

With Lisp style packages, they can make it abc:frob and xyz:frob: different frob symbols in different packages. They are completely unrelated and so the methods just coexist.

But if you have no such thing and classes are your namespace, then ... oops!


Some languages/cultures encourage morphing the language towards a DSL. Lisp does, C does not. Rails is written in a language that encourages that, and wow does it morph.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: