Hacker News new | ask | show | jobs
by milch 24 days ago
I don't think I've ever been unhappier than working on a Rails project. See a bug on the site - something is rendering incorrectly. grep to find the view. Great, there's a method that is being called to render the buggy section. Grep for the method name - 0 hits. Amazing, it's something that is synthesized somewhere and I have no idea where. Guess I'll stop what I'm doing and read docs for an hour. If you do nothing but use Rails all day, sure, but the whole convention over configuration thing is such a huge anti pattern to me.
5 comments

I won't be as harsh because I have years of experience in Rails and didn't develop harsh feelings against it but moving from Rust/Go/Zig/TypeScript (which I used lately) to Ruby ain't smooth ride.

Discoverability is much worse, LSPs aren't super helpful. Using Dash (documentation app) helps a ton. Still some names are confusing after switch (took a minute to recall that 'filter' is actually 'select' in Ruby).

I won't say that dev experience is bad but it's definitely different.

filter is also just filter in ruby - aliased as select (and find_all) on Enumerable.
facepalms

Weird that searching for it didn't yield any results, though I stand corrected. However it seems that select is the actual "root" of documentation. Filter sends to find_all, find_all sends to filter or select.

I’ve had similar experiences with Spring Boot Java applications. Methods in stack traces that don’t exist in source code but are magicked into existence by annotations.
Spring Boot is very similiar to Rails. That's what was surprising to me, when I was forced to use it at uni. The annotations magic brings all the PTSD of method missing from Ruby
Hell with lombok it’s not even uncommon to have entire classes with no defined functions at all. shudder
method(:name).source is your friend
`method(:name).source_location`, but yes. Ruby is very introspect-able and it is fantastic.
I would advice reading the "efficient rails" book, which explains a lot about how to debug RoR apps.
The fact that you have to read a book and break out a debugger to do the equivalent of "find all" in any other languages should tell you something right?

My experience is exactly the same as Milch's. I've tried to fix stuff in Gitlab but given up when I couldn't even find where it things are defined.

That can happen in other languages, e.g. Rust or C where macros are used. But it's pretty much the exception there whereas in Rails it seems to be done by default.

Exactly. Sure, I can go read a book and learn about Rails. If I wanted to be a Rails specialist I probably would, but I don't want to be a Rails specialist. And like you said, other languages can do this too, but I haven't really found it to be too much of an issue. I remember one time where I had to break out whatever the rustc flag is that just produces the code with expanded macros, but that's it.
The worst part is communicating to the Ruby on Rails community that they have a problem with DX or that Rails is not really the top choice anymore for new startups. It's a cult of DHH. I am still mostly part of the Rails ghetto; it's paying my bills, but after gaining more experience during my computer science master's degree with statically typed languages, I clearly see the pitfalls of Ruby.

People often miss the difference between simple and easy. Yes, Ruby is easy, but it's not simple, and it will make you suffer a lot if you get to a complex app. The debugging sessions in Rails are a nightmare. Meanwhile Ruby community is acting like religion, it's almost impossible to convert people from Ruby to other languages, they don't see the language as tool, but as part of their identity

Maybe I'm just not tapped into the community but I've been a ruby developer going on 6 years now and I find debugging ruby apps no better or worse than any other languages I've worked with over the years. It's fairly easy to instrument ruby much like all the other dynamic languages (python3, js, etc) but with better ergonomics. My main qualm with ruby is their reliance on external type files for type annotations. What a terrible idea. Should have just done inline optional types like python3 or typescript.