4 ms·
No, but gradual/optional typing did come after Ruby. Back in 2005, you could choose between static typing with type checking but lots of verbosity (e.g. Java "P
by JW_00000 4y ago
No, but gradual/optional typing did come after Ruby. Back in 2005, you could choose between static typing with type checking but lots of verbosity (e.g. Java "Point point = new Point();" or C++ "for (std::map<int, BlaBla>::iterator it = myMap.begin(); it != myMap.end(); it++)") or dynamic typing without type checking but also without the verbosity. Since optional typing, dynamically typed languages got the guarantees of type checking, and JavaScript/TypeScript and Python have embraced this. With type inferencing, statically typed languages lose their verbosity, and Java and C++ have embraced that (as have newer languages like Rust, Go, and Swift). It feels like Ruby hasn't progressed on this front...
- JeremyNT 4y agoRuby does have optional type annotations, if you want them: https://github.com/ruby/rbs https://github.com/ruby/rbs
- FpUser 4y ago>"for (std::map<int, BlaBla>::iterator it = myMap.begin(); it != myMap.end(); it++)")" All you really needed is: for (auto it : myMap) and you still get compile type safety
- Yoric 4y agoWell, in 2005, you didn't.
- Yoric 4y agoI'll pedantically remind the audience that type inference dates back to the 70s and has been present in the industry at least since the 90s. But in truth, you're right. Very few people know/cared about type inference at the time.
- pantulis 4y agoIsn't RBS for Ruby a way of having optional typing? (Not challenging here, honest question :P)
- Gigachad 4y agoI’m not aware of anyone using it, we evaluated it at work and decided it wasn’t worth using despite us making heavy use of TypeScript and Rust.
- munificent 4y ago> Since optional typing, dynamically typed languages got the guarantees of type checking Optional typing, at least in TypeScript, will not give you the guarantees of type checking. It finds many of your type errors, but not all of them because the type system is deliberately unsound.