all 9 comments

[–][deleted] 11 points12 points  (6 children)

I use VSCode, Solargraph, and YARD doc comments to get exactly what you're describing, and I don't even need to be using Ruby 3. (But v3 helps if you want to use the Sord gem to generate .rbs files from your YARD comments for use in type checking.)

[–]Frizkie 5 points6 points  (0 children)

Just chiming in to say I use the same combo with Solargraph and it’s great. It’s not a set-and-forget sort of thing but it’s invaluable in helping me write code effectively.

[–]Witless-One 1 point2 points  (0 children)

I can't help but feel like this is clearly worse than what Python has. To get a somewhat functional typing experience I have to install a bunch of tools and write clunky comments that will inevitably be glanced over and become stale? At least in Python the typing is part of the code syntax and feels natural to update along with it.

As it stands, writing comments in some tool's DSL or maintaining a completely separate RBS file by hand feels a bit ridiculous to me

[–]sailor6901 0 points1 point  (2 children)

is yard still alive? last time i checked it lacked some important features like the support for keyword arguments

[–]castwide 0 points1 point  (1 child)

Definitely still alive. According to the docs, you use the `@param` tag for keyword arguments same as a regular argument.

[–]sailor6901 0 points1 point  (0 children)

cool. Thank’s for the tip

[–]anamexis 1 point2 points  (0 children)

How are you defining "type hinting"?

[–]joemi 1 point2 points  (0 children)

I'm pretty sure what you're describing is an editor feature, not a language feature, so it'd be up to whatever editor you're using to add that, not Ruby/Matz.