3 ms·
Are new developers choosing Ruby on Rails? I feel like there’s a real shift towards strong (er) typing. What does this mean for Rails? My main language has b
by andrewstuart 3y ago
Are new developers choosing Ruby on Rails?
I feel like there’s a real shift towards strong (er) typing.
What does this mean for Rails?
My main language has been Python for a long time now but I’m really coming to prefer typescript for certain applications.
Does Ruby remain relevant as the industry moves towards typed languages?
- sinkwool 3y agoruby is strongly typed, in that it doesn't allow you to implicitly coerce between types*: 1 + "1" will raise an error. (As opposed to weak typing in C or JS) ruby however is not statically typed. *(there are actually ways to implement certain types of coercions by defining to_ary, to_str, to_int)
- werdnapk 3y agoRuby has Sorbet and RBS as options to integrate types into Ruby projects, so Ruby isn't sitting still on this front.
- e12e 3y agoHaving seen how well typing works with python and FastAPI - I'm afraid the current path ruby is on isn't great, unfortunately. It feels extremely bolted on - but I hope something useful and enjoyable will come out of the various typing efforts.
- veidelis 3y agoIsn't ruby strong and dynamic?
- ninkendo 3y agoThere's no type annotations (outside of experiments), and thus no way for a "compiler" step to tell you if you're passing an array to a function that expects a string or something. The "strong" typing doesn't happen until runtime, so the closest you can get to this is writing a unit test that asserts on the behavior you want (assert that this method raises an exception when I pass an array, etc.) This is what people mean by "typed languages". Ruby isn't one of them.