←back to thread

177 points bartekpacia | 2 comments | | HN request time: 0s | source
Show context
phendrenad2 ◴[] No.45103164[source]
It's been a long time since I last used RubyMine, but I always felt that it was the weakest of the JetBrains tools. And not because JetBrains didn't try hard enough, but because Ruby just doesn't offer a lot of opportunities for an IDE to take advantage of.

I ended up cancelling my subscription over some trivial thing (I think it was the fact that I couldn't quite get the IDE to preserve the indentation of a file. It was an all-or-nothing global setting, but I work on codebases that might have a 4-space indent HTML file and a 2-space indent HTML File in the same directory, and the IDE was ignoring the current style of the file and using whatever indent level I had configured).

replies(4): >>45103607 #>>45103627 #>>45103891 #>>45104910 #
ryandv ◴[] No.45104910[source]
In general it's impossible to "find usages" or "go to definition" when the language not only fails to equip IDEs and tooling with the static typing information that would grant definitive answers to such questions; but even goes further and allows methods to be redefined or even synthesized and defined, for the first time, at runtime, with no corresponding source location or file. Method lookup and dispatch are fully Turing complete (you can `#send` anything, including fully dynamic method names, and respond to any message with arbitrary logic in `#method_missing`), and you can even redraw the method lookup chain and inheritance hierarchies at runtime (includes, mixins, module prepend, eigenclasses et al).

This is not a failing of JetBrains tooling but rather a pervasive language smell and consequence of Ruby philosophy.

replies(3): >>45105119 #>>45105413 #>>45105632 #
1. mrinterweb ◴[] No.45105119[source]
It is infrequent that "find usages" and "go to definition" don't work for me on good sized ruby code bases. Both solargraph and ruby-lsp seem to work fine for me. Occasionally, I'm surprised when they don't work. In my recent mileage, that happens once every couple weeks, and I use find references and go to definition multiple time per-hour.

Metaprogramming has fallen out of fashion in the ruby community for the most part. Rails is a great example of where that shift has happened. ActiveRecord used to have `find_by_<attr-name>(<value>)`, which became `find_by(<attr-name>, <value>)`. Sure devs can still go wild with metaprogramming in ruby, but it is generally discouraged.

replies(1): >>45105283 #
2. ryandv ◴[] No.45105283[source]
They work well enough to a first approximation, but it's far from the certainty one has using other JetBrains products (e.g. C# ReSharper) on a statically typed codebase.

RubyMine will give you "Untyped (potential) usage." That's not good enough if I need to make a breaking API change and be sure that I've fixed all the callsites, such that I don't find out that I've missed a spot when the change breaks in production.

For all this talk about LLMs and AI improving developer productivity - what is one click and a few seconds in ReSharper to "Change Signature" or "Pull Members Up," which is a 100% guaranteed safe refactoring that will not introduce regressions, ends up being anywhere from "a few hours" of playing whack-a-mole with usage sites, to "completely intractable" in 15+ year old 1MLOC+ codebases making heavy use of metaprogramming.

If the Ruby milieu has turned against metaprogramming, I say good riddance; but my understanding is that it is still quite deep in technologies like Rails and RSpec in particular, where it's the fundamental secret sauce that enables convention-over-configuration and fluent, natural-language like DSLs.