This sentence surprised me. How does Rails do it?
I never documented types in Rails and all was well, since 2005.
If a function accepts an arbitrary type, as is the case for all inputs in a dynamic language, one needs to document how the function is expected to behave when given x type. This is ultimately the same as type checking in a typed language. It just moves where the documentation is located.
In that move, it is true that you often lose some strictness in the quality of the documentation. The developers who have an active hatred towards their co-workers may even forgo writing documentation entirely. But if you reach that point you've really got people problems, not technical problems.
It's a problem, but it's not a big problem.
This is not anymore inherent in the language. Gradual typing support for Ruby is now reasonably mature (companies like Shopify with large codebases have adopted it), so it's up to the team do decide if they want to take advantage of it or not.
Like what?
What exactly do you mean by that? It's just a bad ORM all around or is there something specific that is insane about it?
> poorly designed table relationships/indices
What does that have to do with Rails? Poorly designed databases are the fault of the developer(s) who designed them.
I've been experimenting with Rbs, Sorbet & Contracts though, they have their potential.
As someone who maintains Rails 3 apps ad infinitum, this is where things break down with Rails applications. You can create applications very quickly with Rails if you stay within the conventions. But as the app grows, that discipline breaks down and the structure starts to suffer.
This is true for a lot of web applications. But I think the problem is worse for Rails because it's so easy to get started and create apps. That ease comes back to bite you -- as a giant legacy Rails app that no one on the team understands and no one is interested in fixing or maintaining.
As I add type annotations to my methods, VS Code and Sorbet are giving me similar feedback to what I get from Typescript projects.
Most people that use it are fine and productive.
Because of lazy evaluation, type issues persist though. Plenty of instances of trying to call string methods on integers, and array methods on nil, and Rails devs in denial that that's a big problem as the app continues to grow.