All the Ruby tools are so bad. It's all crap.
I started a new job where I have to use Ruby. The company has about 300 engineers, and it seems that no one has a good setup.
Some people use VSCode, but no one has a set of extensions that really works well. Debugging by attaching to a running process doesn't work.
Some people use RubyMine, but it's also somewhat broken - for example, it formats the code in a way that RuboCop doesn't like. The debugger works every other week.
A lot of people set debugger breakpoints by inserting "debugger" or "binding.pry" manually. That also sucks because you can't easily disable a breakpoint after you've reached it. And of course it's an idiotic way of inserting breakpoints, because you can't just detach the debugger - you have to delete every breakpoint if you want the the server to just run.
The language itself is also badly designed. A single-line block uses { }, but when it's multiple lines, it has to be changed to "do" and "end" - why? Do/end is dumb for the other constructs - VSCode can easily jump to a matching paren/bracket/brace, but not to the matching do/end. Who thought |x| was a good idea? Look at C# to see how this should be done. That's just scratching the surface, there are so many shitty features in this language.
Then on top of this, you have Sorbet - grafting type checking onto the code, but outside the language. It's about 100 times uglier than just having typing built into the language. Today I learned that you can't provide a Sorbet sig for a module_function - Rubocop doesn't understand it. Rubocop runs as part of "git commit", so you can't do anything that Rubocop doesn't like.
All of this is so shitty and amateur and primitive and backwards. Right now is not a good time for finding a new job as a software engineer, otherwise I'd be out of here looking for a job where I can use a real language with real tools that work and improve productivity rather than killing productivity like the Ruby circus.
Rails has some nice features, but for every bit of productivity gain that it gives you, there's about 10x as much negative impact on productivity.
I'm very sorry to hear this. Switching from C# to most things is painful, because of an uncloseable rift with its tooling, features and standard library. In particular with Ruby, that HN insists on loving to its own detriment, which is by far one of the worst offenders - it is slow, brittle and stuck in the past, just like you described.
Some developers will claim "it's a preference" or mistakenly assume it can be compared side by side with other back-end stack. This just stems from critical gap in required software engineering knowledge - Ruby does not and cannot compete with other stacks. I tend to be critical of Go, but I would pick it every time over Ruby if the circumstances would not let me use something better.
(seriously, friends don't let friends deploy new projects in Ruby, use C# or Kotlin or any other compiled language that strikes your fancy)
I just randomly started learning Ruby for shits and giggles over this last week, so I'd love to hear more of why not to go down this path (not that I necessarily would hit the brakes)
I've also been dabbling in Go over the last year or so and really enjoyed playing around with it, but I do find it a bit verbose. On the other hand, its performance is really impressive.
Ruby is OK (although still slow and pointless) if you just want to work on some pet project by yourself. When you have a large team working on a commercial product, you run into these problems:
- it allows people to write difficult-to-read code. Everyone invents their own DSL for showing how clever they are
- the lack of typing built into the language means that either people and IDEs have no idea what type anything is, and you run into runtime type errors that should have been caught at compile time, or you use Sorbet to add types, and it looks like crap and reduces readability
- the tools (VSCode, RubyMine, etc) can only partially understand the code, so they can't help you much, and you're back to the 1980s in terms of tool suport while writing code.
HN has a pretty negative view of Ruby/Rails overall, but I wouldn't let that deter you. Every language/framework has its downsides; If you're enjoying Ruby/Rails then I'd say keep going!
It's brilliant for side-projects and smaller teams; At 50+ devs working in the same Rails codebase, it can start to get pretty chaotic which is potentially where a lot of the HN-negativity comes from.
50+ Devs working on a single project/codebase tend to get messy/chaotic. I don't think it's worth blaming this on Ruby/Rails.
Over time I learned that Ruby and Rails are as told easy to learn, but sadly you'll need some time to master the Language/Framework. And the difference is quite big and easy to overlook once you do.
People like to say that it's easy to learn, and "fun" and "efficient". The opposite is true. Of all the languages I've learned (Pascal/C/C++/Java/C#/Hack/Go/Scala) it's by far the most difficult. For the following reasons:
- it makes a lot of unconventional/strange design decisions
- the nature of the language makes it difficult for IDEs to offer good support (e.g. autocomplete, show what methods you can call on a given object)
- it encourages people to write unreadable code to show how clever they are
All of these things are the opposite of fun and efficient and easy-to-learn.
Ruby is slow. Very slow. How much you may ask? https://www.techempower.com/benchmarks/#hw=ph&test=fortune&s... fastest Ruby entry is at 272th place. Sure, top entries tend to have questionable benchmark-golfing implementations and are highly sensitive to hardware config, but it gives you a good primer on the overhead imposed by Ruby.
It is also not early 00s anymore, when you pick an interpreted language, you are not getting "better productivity and tooling". In fact, most interpreted languages lag behind other major languages significantly in the form of JS/TS, Python and Ruby suffering from different woes when it comes to package management, publishing, static analysis on big problems and overall trying to graft type system on something that wasn't designed with one in mind. I would say only TS manages to stand apart with being tolerable, and Python sometimes too by a virtue of its popularity and the amount of information out there whenever you need to troubleshoot.
If you liked Go but felt it being a too verbose to your liking, give .NET a try. I am advocating for it here on HN mostly for fun but it is, in fact, highly underappreciated, considered unsexy and boring while it's anything but after a complete change of trajectory in the last 3-5 years. It is actually the* stack people secretly want but simply don't know about because it is bundled together with Java in the public perception.
*productive CLI tooling, high performance, much more expressive and FP-style than Go, works well in a really wide range of workloads from low to high level, by far the best ORM across all languages and back-end framework that is easier to work with than Node.JS while consuming 0.1x resources
I remember feeling similar a few years back when a scripting language was thrust upon me (python in this case) coming then from a few years in statically compiled languages. It felt clumsy and unproductive for an astonishingly long time. I complained endlessly about this and that. At some point though it somehow clicked and I felt at home in the language.
Ruby is really not easy to get into with its n ways of doing things and supposed "magic" methods. I think it can be worth it. Rails (7) feels very productive right now.
(Never had to deal with sorbet/rubocop though and guilty of just writing "debugger", Rubymine has normal breakpoints as well though.)
A lot of people set debugger breakpoints by inserting "debugger" or "binding.pry" manually. That also sucks because you can't easily disable a breakpoint after you've reached it. And of course it's an idiotic way of inserting breakpoints, because you can't just detach the debugger - you have to delete every breakpoint if you want the the server to just run.
The language itself is also badly designed. A single-line block uses { }, but when it's multiple lines, it has to be changed to "do" and "end" - why? Do/end is dumb for the other constructs - VSCode can easily jump to a matching paren/bracket/brace, but not to the matching do/end. Who thought |x| was a good idea? Look at C# to see how this should be done. That's just scratching the surface, there are so many shitty features in this language.
Then on top of this, you have Sorbet - grafting type checking onto the code, but outside the language. It's about 100 times uglier than just having typing built into the language. Today I learned that you can't provide a Sorbet sig for a module_function - Rubocop doesn't understand it. Rubocop runs as part of "git commit", so you can't do anything that Rubocop doesn't like.
All of this is so shitty and amateur and primitive and backwards. Right now is not a good time for finding a new job as a software engineer, otherwise I'd be out of here looking for a job where I can use a real language with real tools that work and improve productivity rather than killing productivity like the Ruby circus.
Rails has some nice features, but for every bit of productivity gain that it gives you, there's about 10x as much negative impact on productivity.