6 ms·
> We ported our React frontend from JavaScript to TypeScript, then did the same for our Ruby backend. Next year it will be an article on how they ported everyt
by ecmascript 6y ago
> We ported our React frontend from JavaScript to TypeScript, then did the same for our Ruby backend.
Next year it will be an article on how they ported everything to rust and webassembly and how that is just so much better than everything.
Of course they come to the conclusion that types and tests aren't the same thing. Otherwise you would never need tests, not even in dynamically typed languages.
- noelwelsh 6y agoI agree that the answer is obviously yes, as types and tests do different work. However "types" in dynamically typed languages are not the same thing as types in statically typed languages. One difference is that one causes an error at compile time and one causes an error at run time. Types in statically typed languages can replace tests, but types in dynamically typed languages cannot (unless you believe program crashes are a desired response to code errors.)
- steveklabnik 6y agoGary has already checked out Rust and didn't particularly like it, so I doubt that will be happening. Regardless, it was not about being some sort of hipster. It solved real problems: https://www.executeprogram.com/blog/porting-to-typescript-solved-our-api-woes https://www.executeprogram.com/blog/porting-to-typescript-so... (this is linked from the part you quoted, of course.)
- tln 6y agoThat's not really fair, they ported their stack so front end and backend share type definitions. It was not a fashion driven decision. Wrt to types and tests, "Types" means some verifiable annotations on the code. If a type system can encode enough information in them, perhaps with preconditions or other contracts, then would tests be superfluous? If so, I don't get your assertion about tests and dynamically typed languages. On the other hand, since typescript is unsound, shouldn't you really test like a dynamically typed language?