Hacker News new | ask | show | jobs
by ht85 2094 days ago
> bugs where typings don't match what you expect and everything blows up are common

> the only overhead is making sure objects were passing around match on both ends

Seem like is it a big deal based on the first sentence.

I've never been convinced of the single language argument. Sharing code between frontend and backend sounds good but as in practice there's little overlap... models have subtle differences, there's extra logic server side... All in all it's not very practical.

To me the most awesome part of a fully TS project is that you can use the same interfaces everywhere. If you take the time to define them for any input / output, everything is pretty much guaranteed to be sound.

> the type erasure problem is far worse than Java

Check out RunTypes [1], amazing to guard any incoming data.

1. https://github.com/pelotom/runtypes

4 comments

It's more about the ability to share programmers than the literally code, in my opinion.
This library looks great! For cross language comms you can also use gRPC to avoid writing objects for both sides. We're not using it company wide but so far it works as advertised, minus the annoyance of having to use gRPC proxy to web endpoints
> Seem like is it a big deal based on the first sentence.

There is big difference between "this API can blow" and "it can blow everywhere".

Sharing same stack is more important when team / project is small.