Hacker News new | ask | show | jobs
by marcus_holmes 2823 days ago
No, I get it.

As a JS dev, Cofeescript appeared to be nothing more than an attempt to make JS more like Ruby.

From this perspective, TS appears to be nothing more than an attempt to make JS more like C#.

Either way, both appear to be attempts to use JS's massive flexibility to make the language work more like another language, because people are more familiar with that other language. And in both cases, there's a familiar response of "please don't do that. Please stop complaining about JS because it's not like your favourite language. Please learn to use it properly instead".

I played very briefly with CS to see what the excitement was about, and haven't touched TS at all, because I enjoy JS. But with Vue moving there, I think I'm going to have to bite the bullet and take a look.

1 comments

I suggest you give TypeScript a try. You might like it, you might not, but at least then you'll know. It uses gradual typing - you can use static types as little or as much as you like. It's not C#.
I'm writing the backend in Go, so static typing is not where the resistance is coming from ;)

It's more like separation of concerns. I want Postgres to take care of data integrity. I want Go to take care of type safety. I want to give Vue all the flexibility it needs to handle user interaction. I don't really want to care about types in the UI, because Go can sort out whatever it sends to the server.

If I have to start writing code in the browser to translate between Go structs and TS classes then that's a step too far imho.

Try it before saying something like that.

TS is like swift, and it does not require type declaration. A lot is automatic.