3 ms·
> Ruby have a subpar gradual typing story Whether you agree with it or not Ruby's (the language not the developers) resistance to static typing is just how Rub
by Spivak 3y ago
> Ruby have a subpar gradual typing story
Whether you agree with it or not Ruby's (the language not the developers) resistance to static typing is just how Ruby wants to be written. There are no types, only messages. The whole culture surrounding Ruby is burying all the underlying data in favor of pure message-passing nirvana. I have no ducks but I must quack.
- djur 3y agoThis is partially true, but a pretty large chunk of idiomatic Ruby is focused on Enumerable method chaining, transforming arrays and hashes, slicing and dicing strings, etc. A language that was totally dedicated to message-passing nirvana wouldn't have regexes as a built-in data type with a literal syntax (or dictionaries, ranges, and so on)
- chris12321 3y agoThose things are all just Objects in Ruby, just with some syntactic sugar, not built in data types. `/a?/` is just syntactic sugar for `Regexp.new('a?')`, ['a','b','c'] is just `Array.[]( 'a', 'b', 'c')` everything is an object being sent messages.
- gabrieledarrigo 3y ago> There are no types, only messages. Yes but...what is the shape of those messages? I ways prefer to know the type of the material I'm working with...