Live data from Hacker News

TypeScript at Google

neugierig.org

21–30 of 201 posts

Re: TypeScript at Google

#21

I'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.

The codebase powering www.twitch.tv utilizes TypeScript and I can’t imagine working on a project of any significant size without leveraging it going forward.

Re: TypeScript at Google

#22
post #12

I 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.

Re: TypeScript at Google

#23

I feel like this sort of organic growth (for typescript) is a very healthy sign for a project. ES6 (or whatever we’re supposed to refer to it as now) is good enough for many things, but when you see it used heavily with, for example, proptype hints... you get the feeling that there really is a trend these days towards flavoring static type checking and the error checking that offers. I think its an interesting shift,…

Sorry if this is a well known term but what is a "proptype hint" in this context? I can't seem to find any references for '"proptype hint" "javascript"' or any variations that come to mind on Google.

Edit - changed previous sentence to "proptype hint". I originally erroneously read the parent as saying "prototype hint" which I couldn't find results for, but even after correcting my reading error my question still stands.

Re: TypeScript at Google

#24

I'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 been leaning on flow since it’s developed by the React team at Facebook.

Re: TypeScript at Google

#25

I'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.

That's the main reason I use Flow almost exclusively. I don't like sacrificing really useful features for the sake of a cleaner code base.

Re: TypeScript at Google

#26
post #23

I feel like this sort of organic growth (for typescript) is a very healthy sign for a project. ES6 (or whatever we’re supposed to refer to it as now) is good enough for many things, but when you see it used heavily with, for example, proptype hints... you get the feeling that there really is a trend these days towards flavoring static type checking and the error checking that offers. I think its an interesting shift,…

Sorry if this is a well known term but what is a "proptype hint" in this context? I can't seem to find any references for '"proptype hint" "javascript"' or any variations that come to mind on Google. Edit - changed previous sentence to "proptype hint". I originally erroneously read the parent as saying "prototype hint" which I couldn't find results for, but even after correcting my reading error my question still sta…

I believe they’re referring to the PropTypes Library that grew out of React. It’s extremely limited in scope compared to something like TypeScript, but it does give you some benefit.

https://www.npmjs.com/package/prop-types

Re: TypeScript at Google

#27
post #24

I'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…

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.

Re: TypeScript at Google

#28
post #23

I feel like this sort of organic growth (for typescript) is a very healthy sign for a project. ES6 (or whatever we’re supposed to refer to it as now) is good enough for many things, but when you see it used heavily with, for example, proptype hints... you get the feeling that there really is a trend these days towards flavoring static type checking and the error checking that offers. I think its an interesting shift,…

Sorry if this is a well known term but what is a "proptype hint" in this context? I can't seem to find any references for '"proptype hint" "javascript"' or any variations that come to mind on Google. Edit - changed previous sentence to "proptype hint". I originally erroneously read the parent as saying "prototype hint" which I couldn't find results for, but even after correcting my reading error my question still sta…

`PropTypes` are a library for runtime type checking of props for React components. It was originally part of the React core, but split out into a separate library with React 16.

PropTypes are used for a combination of debugging during development ("you accidentally passed a string instead of a number", or "you forgot to include a required prop"), as well as documentation for a component. React devs have traditionally used PropTypes to act as readable documentation of a component's expected props, and there are tools that can extract PropTypes usages and generate documentation files.

However, with the rise of TS and Flow as static type systems, the need for a runtime-based type checker has gone down, especially since people using TS/Flow have probably already declared types for a given component's props.

Re: TypeScript at Google

#29
[Irony on] It's somehow reassuring that Google engineers also "check StackOverflow for answers". Helps me to raise my low self-esteem. :D I thought all what Google engineers do is writing code from scratch in brainfuck all day long.[Irony off]

Of course I am just joking. Well, the author faced the same dilemma that we all face when instead of joining the next-to-be-unicorn startup we join an established company which has been operating for more than one decade. Namely legacy code.

They should pick up a copy of 'Working effectively with legacy code'. They might extrapolate some of those advices and apply to their situation.

Re: TypeScript at Google

#30

Google has enough resources for someone to write a transpiler that can take annotated JS and convert most of it to TypeScript. It's certainly much more pleasant than having to type random comments everywhere, which kinda makes syntax highlighting way less useful. Oh, and last I checked there were no editor plugins for linting Closure Compiler annotated code. Another option would be to add TypeScript support to Closur…

I couldn't tell from your wording if you knew this already, but we wrote a JS->TS converter too. I didn't call it out very clearly but it's the second to last link in the post.

I am really sad that TypeScript gave up on their spec. It previously was one of the strengths of the language that I was happy to cite. I guess it's a common crutch for languages (Python and so on) to say "the implementation is the spec" but without a spec to guide you, you lose sight of which features are intentional or accidents or even what the distinction between the two are.

The Closure library does has some great stuff in it. It's the accumulation of years of experience of working around lots of really subtle issues in lot of browsers. On the other side it also has a lot of code for issues that are obsolete, and it's hard to know which pieces are for what.

Post reply on HN