2 ms·
Is there an advantage for trb code to use colons for type annotations like: def greet(name: String): String Instead of arrows like rbs files? Why diverge fr
by cpeterso 10mo ago
Is there an advantage for trb code to use colons for type annotations like:
def greet(name: String): String
Instead of arrows like rbs files? Why diverge from precedent?
def greet: (name: String) -> String
- k1w1 10mo agoTypescript. I imagine most people writing Rails applications are also writing typescript for front-end code, so being able to use the same muscle memory for Ruby typing seems high desirable. That is the thing that stood out to me when I saw this site: it looks like they are taking the very positive lessons from Typescript and applying them to Ruby. I agree with other posters here. I don't need everything typed - Ruby's duck typing is an awesome feature - but I do wish that some of the more important interfaces in our code were more strongly self-documenting and enforced.