8 ms·
I’ve been trying to get into Ruby for a new job and am finding it hard. Not being designed for machines is right - a lot of the IDEs seem bad and can’t even fi
by retrobox 7y ago
I’ve been trying to get into Ruby for a new job and am finding it hard.
Not being designed for machines is right - a lot of the IDEs seem bad and can’t even figure out where your methods come from. I don’t know how the interpreter manages to run it. Multiply the problem by 10 once you add rails and all the methods it generates.
It makes for a good, rapidly developed monolith but most places I’ve worked in recent times are moving to services and micro services and it doesn’t seem cut out for that.
- kawsper 7y agoGenerally, I think RubyMine is quite good as a Ruby IDE. You can also use IRb, Ruby's REPL, and #source_location to find definitions, it works for monkeypatches as well if your team is using those.
- deleted 7y ago[deleted]
- dgellow 7y agoHave you tried RubyMine from Jetbrains? It's the best dev environment I know for ruby. https://www.jetbrains.com/ruby/ https://www.jetbrains.com/ruby/
- sosodev 7y agoI love Rails but even RubyMine struggles to understand the context of a Rails app. Everything being dynamically required seems to be the real thing that makes it hard to be context aware.
- retrobox 7y agoThis ^ Perhaps it’s fairer to say a lot of my struggle so far is with a Ruby on Rails project. I’ve had less exposure to Ruby without the Rails part, and maybe it’s regrettable that’s the case. I’ve used frameworks in other languages and mostly always been able to dig back to the original source of things but I’ve not had such a positive experience with Rails and any of the IDEs out there.
- elliotlarson 7y agoAs dgellow and kawsper pointed out, Rubymine is a good IDE, or Intellij with the Ruby plugin, which is functionally the same thing. Also, vim support for Ruby is amazing. Tim Pope has dedicated a chunk of his life to ensuring this (thanks, Tim). Also, a lot of the core team members have been using Emacs since the beginning. I haven't spent a lot of time with Emacs, but from what I've seen, the Ruby support is pretty great.
- jackschultz 7y agoThat's my biggest problem with Ruby, where you can create a function and suddenly poof, you can use it anywhere. Like I'm writing tests and want to create a util function, so I put it in a different file and I can use that anywhere without having to be explicit with where it came from and was defined. Glad it's not just me but the IDEs as well.
- sosodev 7y agoThat’s not a Ruby thing. That’s a Rails thing. In Ruby you still have to require your code like every other language.
- horsawlarway 7y agoI'm in the same boat. I'm coming up to speed on a very large, 5 year old monolith RoR codebase. I fucking hate the thing. I've done quite a bit of web dev across a pretty large variety of languages (c/c++/c#/php/js/golang/other). They all have rough edges, but never in my career have I been more frustrated than when dealing with Ruby on Rails. The tooling is... the best I can call it is bad. Simple things like jump to definition just don't work, basically anywhere, autocomplete is non-existent. RubyMine is the closest to functional, but it's still MILES away from good. Non of that alone is a deal breaker - I've written sites in plain old notepad or gedit, but when languages have bad tooling, I expect good documentation. Rails is off in la-la magic land though. Docs are hard to find and inconsistent. I'll frequently find documentation that contradicts itself (ex: Are middleware "Set-Cookie" headers delimited by a comma, or returned as an array? Ans - Trick question, the documentation says both in different places, but it's actually a newline, which isn't documented fucking anywhere.) Trying to just figure out where a method definition lives is needlessly tiring. I asked a long time dev at the company how he finds the source for methods that are magically pulled in by rails. His answer: "I do a global search for "def [name]" and if that doesn't find it, I give up and ask the development slack channel". Personally, I find that mind-boggling. And honestly, I guess most of my frustration isn't really Ruby. It's Rails. I don't love that Ruby seems to encourage the "make it a dsl!" type programmer, but by itself there are good times/places for that. Rails though? It just doesn't scale for humans. Rails feels like it started off with a solid idea - Don't worry about the boilerplate, just write productive code, we'll handle the magic. And that works great... up to a point. But that point was years back. Now the whole ecosystem has grown to the point where I HAVE to understand at least some of the magic, but because they didn't want you to see it, it's really, REALLY hard to get good answers about how/where all the various bits play together. Instead you chase outdated docs, bad stack overflow answers, and shitty forum posts. I came on board pretty excited to pick up Ruby on Rails. A year in and I'm pretty convinced that I'll recommend basically ANY other framework and toolset.
- gchucky 7y agoHave you looked at Hanami? https://hanamirb.org/ https://hanamirb.org/ I'm in the same boat about RoR. I just find its size to be overkill for most uses. Hanami is considerably smaller and lightweight, but not to the point where it's more of a micro-framework (like Roda). I've been happy with it for a number of microservices and some larger websites.