| ▲ | kmarc 5 hours ago | |||||||||||||
I'm tasked to amend a project written in ruby. With a python background (and some nice pydantic, type annotated, etc "strong" code bases behind my back), every day I spend with ruby is a minefield, a nightmare. I hoped that ruby4 maybe implements stuff that python has, like type annotations or making the damn parens mandatory, but no. Not surprised that python has ten times more developers according to stackoverflow's survey... I can't possibly imagine a collaborative project where other people also have to work on the same code base, and not having any clue what a symbol under the cursor might be. No type hints. No mandatory requires. No parens, so never know if something is a method or, callable, or variable. Basically IRB is a must for development, because in the editor, I'm blind. And the ecosystem is just sad. Swagger-rails libraries out there are rookie jokes compared to what python has. At least there is decent GRPC / protobuf integration, so all new services I am writing can be in python. Or any sane language. | ||||||||||||||
| ▲ | dalenw 5 hours ago | parent | next [-] | |||||||||||||
I used to be a big ruby/rails fan but I have to agree with you. I now write c-sharp and it's a lot less stressful than Ruby. If a Ruby/Rails codebases get to a large enough point it's really difficult to keep track of what types a method you wrote accepts. You end up just constantly double checking your own code. Or you end up with a few type checks and/or type conversions at the top of every method. And maybe I was doing it wrong because it was early on in my career. But when a method can accept literally anything and return literally anything, not even a strong IDE like RubyMine can save you. | ||||||||||||||
| ▲ | haolez 2 hours ago | parent | prev | next [-] | |||||||||||||
I don't know. In my experience, the real nightmare is when a competitor uses Rails and has strong developers. Their velocity is insane and I don't see things falling apart when the project gets bigger. Nowadays, I pray that my competitors use something like .NET or Spring Boot. And this comes from someone who never developed in or lead teams that use Rails. | ||||||||||||||
| ▲ | phantasmish 5 hours ago | parent | prev | next [-] | |||||||||||||
I’ve sworn off Rails development for anything short of stupid-high compensation for similar reasons. Implicit imports (“… which package defined this symbol? Who knows!”), dynamic definitions all over the place (“where’s this defined? Literally nowhere until the program runs!”), all that stuff. It’s awful. I feel blind not being able to answer basic questions about a codebase with grep. And that’s not even considering the lack of static typing. | ||||||||||||||
| ▲ | dragonwriter 2 hours ago | parent | prev | next [-] | |||||||||||||
> I hoped that ruby4 maybe implements stuff that python has, like type annotations Ruby has had type annotations and typecheckers for quite a while. Unfortunately (IMO) the annotations are not inlinine. > or making the damn parens mandatory, but no. A linter/formatter can give the effect of that (and tune it for where it is appropraite) whether or not the language has it, though there are good reasons Ruby does not in general. > No parens, so never know if something is a method or, callable, or variable. Method and local variable are the only possibilities (callables are either the value of local variables or the return value of method calls), | ||||||||||||||
| ▲ | pkkm 4 hours ago | parent | prev | next [-] | |||||||||||||
Similar feelings here. Ruby's philosophy of providing a ton of different ways to do the same thing can lead to some pretty sweet-looking code, almost like poetry... but I'd rather have Python's stylistic consistency and better-integrated type hints. Now that Python has Poetry and uv, Ruby's main remaining advantage has evaporated and it's hard for me to justify using the language. Another thing I don't like about Ruby is how much the community has embraced the Clean Code brand of readability snake oil. It's easy to come by the opinion that any function over 5 lines is a code smell and over 10 lines it's outright bad. I've even heard the view that if-else statements are a code smell and I should always try to replace them with different classes that have the same interface. To be fair, that only happened twice, but that's two more times than I've heard it from users of any other language. I think that the Python community usually strikes a better balance between avoiding excessive function/class length and avoiding excessive indirection. | ||||||||||||||
| ||||||||||||||
| ▲ | arp242 3 hours ago | parent | prev | next [-] | |||||||||||||
This is a classic "I am used to language X. I am now trying language Y, but nothing in language Y is like language X! Why can't language Y be like language X?!"-type post. Yes, Ruby is a different language. It does things differently and priorities different aspects. | ||||||||||||||
| ▲ | wiseowise 5 hours ago | parent | prev | next [-] | |||||||||||||
What's with the downvotes? Every word here is true. | ||||||||||||||
| ||||||||||||||
| ▲ | chihuahua 5 hours ago | parent | prev [-] | |||||||||||||
People on HN seem to hate it whenever someone criticizes Ruby. But the language is a sad joke that's gone on for too long. I totally agree with your points and have many more I could mention (lack of proper debugger support and shitty tooling in general - these things exist, but they break every week) The 4.0.0 release notes (TFA) are like a joke. Here are the language changes in their entirety: Language changes: *nil no longer calls nil.to_a That's it. | ||||||||||||||
| ||||||||||||||