Earlier quoted context omitted.
Isn't there already one? I seem to recall that it mostly works, just much more slowly than the java version Edit: here you go: https://www.npmjs.com/package/google-closure-compiler
Nice! Didn't realize this was a thing. I suspect they could make even more aggressive optimizations if they made a TS version.
TypeScript at Google
31–40 of 201 posts
Re: TypeScript at Google
#32I love typescript as a JavaScript developer, but having used go for personal projects, I find the type system complex (maybe necessarily so). Having said that, I cannot thank TS enough for how it’s made life easier when working on and refactoring large codebases.
Re: TypeScript at Google
#33I'm hesitant to work in any JavaScript code base that isn't using TypeScript at this point. Two years ago, it was painful to use as any early release is but the benefits were obvious. My biggest wish for TypeScript is that it was easier to use experimental flavors that supported JS features currently being considered, such as the pipeline operator proposal.
Have you spent any real time with Flow? As I’m starting to get into the modern front end world… I do want the safety of a stronger type system but it doesn’t look like the React ecosystem has really decided which way to go. TypeScript is popular. But flow was developed by Facebook and so it’s obviously heavily used by some of the top people. I’ve only been reading about them, I haven’t chosen to use one yet. But I’ve…
Re: TypeScript at Google
#34I love typescript as a JavaScript developer, but having used go for personal projects, I find the type system complex (maybe necessarily so). Having said that, I cannot thank TS enough for how it’s made life easier when working on and refactoring large codebases.
I don't know what you find complex about the type system, but I actually find it slightly limiting. They keep improving it, so it can express about 95% of what I want, but I still hit situations where I can't tell the compiler everything.
Generics are a complex concept for people to grasp without some time playing and reading docs, but once you learn it, you can express almost everything you want.
But for simple projects you can get away with all but the most basic of generics, if any at all.
With the release of conditional types, I find most of my js typing cases are covered.
Though tbh I've always leant toward the side of "if you can't express it easily, then you're being to JavaScripty".
Re: TypeScript at Google
#35I'm hesitant to work in any JavaScript code base that isn't using TypeScript at this point. Two years ago, it was painful to use as any early release is but the benefits were obvious. My biggest wish for TypeScript is that it was easier to use experimental flavors that supported JS features currently being considered, such as the pipeline operator proposal.
Have you spent any real time with Flow? As I’m starting to get into the modern front end world… I do want the safety of a stronger type system but it doesn’t look like the React ecosystem has really decided which way to go. TypeScript is popular. But flow was developed by Facebook and so it’s obviously heavily used by some of the top people. I’ve only been reading about them, I haven’t chosen to use one yet. But I’ve…
Re: TypeScript at Google
#36Earlier quoted context omitted.
Have you spent any real time with Flow? As I’m starting to get into the modern front end world… I do want the safety of a stronger type system but it doesn’t look like the React ecosystem has really decided which way to go. TypeScript is popular. But flow was developed by Facebook and so it’s obviously heavily used by some of the top people. I’ve only been reading about them, I haven’t chosen to use one yet. But I’ve…
For what it's worth typescript is developed by Microsoft. Doesn't get much bigger than that
But is not developed by the same developers/company as React.
I will say given what TS is competing against the fact that it so well used is rather compelling. I know all of Angular is also written in TS. It’s clearly very heavily used.
Re: TypeScript at Google
#37Earlier quoted context omitted.
Have you spent any real time with Flow? As I’m starting to get into the modern front end world… I do want the safety of a stronger type system but it doesn’t look like the React ecosystem has really decided which way to go. TypeScript is popular. But flow was developed by Facebook and so it’s obviously heavily used by some of the top people. I’ve only been reading about them, I haven’t chosen to use one yet. But I’ve…
From my personal experience, Flow prioritises soundness in its type system, and thus can catch some bugs that TS won’t, but the TS tooling and editor support is drastically better than Flow’s. Edit: oh and it’s worth noting that I’ve had much more luck finding TS definitions for third party packages than I have with Flow.
I’ve only done a cursory look. My editor (IntelliJ) supports both to some level. Webpack/Babel do too.
I’m very new to writing React and modern front end JS so it’s quite possible there are things that I should be looking out for that I don’t even know about.
Re: TypeScript at Google
#38Re: TypeScript at Google
#39Earlier quoted context omitted.
For what it's worth typescript is developed by Microsoft. Doesn't get much bigger than that
I know, and that’s a definite plus. I don’t have to worry that it will go away or lose all the main contributors. But is not developed by the same developers/company as React. I will say given what TS is competing against the fact that it so well used is rather compelling. I know all of Angular is also written in TS. It’s clearly very heavily used.
Re: TypeScript at Google
#40We primarily do JavaScript, and I see no issues with it when you set up governance in how to use it.
I don’t think building your own libraries is really a bad thing either, in fact I think you should do so often instead of relying on 3rd party packages of quality you typically judge on how many times they’ve been downloaded if you’re being honest.
I think typescript is silly. It works with legacy code, sure, but if you’re refactoring you might as well rewrite your JS or if you’re compiling to JS you might as well chose Dart which is vastly superior to typescript.
I don’t really see type safety as an issue. I can’t remember when it was a problem for us, and we operate millions of lines of code, but they are all written with governance. Want a number? Then call your argument numWhatever and check your input. It’s really as easy as that.
I mean, sure type checks will prevent shitty code from compiling, but really, just don’t write shitty code. I know that sounds silly to some people, but 95% of what you write is about shifting data around through simple mechanics, it really shouldn’t be so hard to do it right.
You won’t see an engineer go “oops that support beam in your building wasn’t right, my bad” and programmers really shouldn’t get that luxury either. If they write shitty code then figure out why, maybe they need more time, maybe they need training, maybe they need governance or maybe they need to be replaced.
But hey, feel free to fix your shitty code with code that’s only less shitty because your compiler protects you. Just know that typescript comes with a different set of risks, once you need your JS codebase to move forward in a way that isn’t supported by JS.