6 ms·
TypeScript at Google (2018)
- melling 5y ago2018 Guess that means Gmail is now 17 years old.
- canada2us 5y agoAnd the web version of Gmail is slow to open with splash screen.
- throwaway4400 5y agoYes! Does anyone know what on earth it is doing during this period? It does not appear to be fetching data.
- deleted 5y ago[deleted]
- rejectedandsad 5y agoAm I missing something or is this fundamentally not that interesting of an idea? The tl;dr of it is just that they slowly migrated a smaller subset of the internal tooling to use TypeScript, and probably in the last 3 years have migrated even more. Is that...notable? I'm sure lots of big companies use TypeScript now. My company has roughly the same # of engineers as Google and has had some teams that adopted TypeScript while others didn't. We even own a product that uses Flowjs, for some reason. It didn't require a huge rigamarole to do so, just a hook into the internal build system (which, looking at it now, is significantly smaller in surface area than the rules_typescript Bazel rule).
- wffurr 5y agoThe post covers this in detail. JavaScript at Google was almost completely different from JavaScript elsewhere. The tools were different, the libraries are different, and even the language itself is different (jscompiler’s ES4-inspired type system). It’s also a huge company with a gigantic monorepo (there’s papers about it elsewhere) and a lot of inertia. It’s amazing what Evan and his team were able to do for front-end development at Google by building tools to bridge between Google JS and TypeScript.
- rejectedandsad 5y agoLots of companies have turned JS into effectively another language with a subset of its features with internal libraries. Perhaps they aren't as academically interesting as Closure, but it's not that notable. The monorepo aspect of the story just seems to just make doing this significantly more difficult for no discernible benefit. Isn't this the same team that made that 5 page issue on the TypeScript Github page complaining about a version bump?
- Orphis 5y agoA monorepo surely makes that kind of change difficult. But when it's in, you know every team has access to it. Not just 2 or 3 teams out of hundreds. It has many other benefits as well that have been outlined in lots of other posts.
- xmprt 5y agoThis is one such change that is much harder with a monorepo because it introduces many breaking changes. However, in a lot of cases monorepos allow for upgrades and code sharing without much if any effort from individual teams. So a lot of people can get the benefits without doing anything.
- emmelaich 5y agoIt's interesting because it's a problem that crops up in every software shop to some degree. Tech debt is a wicked problem and certainly not exclusive to Javascript. It's well written too; a good model for design / discussion papers.
- dnndev 5y agoIs typescript really that great? Every implementation I have seen has 1 - Work-arounds for interoperability with non typescript / legacy third party dependencies. (issue: ugly, non consistent code) 2 - Turn off strict type checking due to third party component compatibility. (issue: isn't the purpose of typescript type checking?) 3 - Is type checking really needed for most applications? (assuming some flavor of CRUD with the occasional special sauce). (issue: seems a bit academic unless your working on a webapp for the mars rover) This is coming from someone who programmed in java, .net, strongly typed languages for years and then feels like javascript is being held back with typescript. I love programming in vanilla javascript using frameworks (in this order) vuejs, reactjs, and charge extra to work on angular.
- Toadtoad 5y agoI like TypeScript just because it makes it easier to know what you're writing, due to features like autocomplete with types, even if I don't strictly follow it.
- k__ 5y agoI started a new project with TypeScript a few weeks ago and I kinda like it. Many libraries come with TS support out of the box and the autocomplete and automatic renaming across files is quite nice. I'm using strict mode and didn't have issues yet, but I'm just at the beginning, so let's see how it goes.
- ckaygusu 5y agoDoing Typescript for a living. 2 out of 3 of the items you wrote down has to deal with old baggage, so whatever form of language you are dealing with those, you aren't going to have a good time. You can either bite the bullet and write the type definitions yourself, or just disable the type system altogether, which, if you can isolate it to a certain area in the code, you are fine. If you are writing code that some other person is going to read and/or you are interested in having it behave reliably in the long run, I think a static type system is a must. Coupled with good unit tests, if the type checker does not complain, you can be very confident the code you wrote is working and will work for a vast majority of the cases. Typescript is especially great because, unlike some other statically typed languages, you can choose not do use it in some cases (e.g., setting up mocks for tests, writing a small script to see how stuff works, etc), which is liberating. I went from Python to Typescript. Python is still my go-to language for random tasks, though unless I have a good reason to do otherwise, I don't want to deal with a production codebase that does not do static type analysis anymore. I don't know others, but I just get more done in less amount of time in this way.
- heluser 5y agoLove “x at y” stories. Would be cool to hear about graphQL at Google too
- paulddraper 5y agoFor that to happen, Google would probably have to use GraphQL.
- jefftk 5y agoThings are a lot better now than they were in 2018, in large part due to his work and his team's. The typescript migration has gone well, with good automatic migration tooling, and I mostly only use TS now. This means good error messages, and good editor support. (Disclosure: I work on ads at Google, speaking only for myself)
- rejectedandsad 5y agoIt sounds supremely annoying to have to wait for the entire ecosystem to develop (Cider extensions, Bazel rules, whatever-the-fuck-else-someone-needed-to-feel-less-guilty-about-making-$700k/yr) in order to write code in a new framework that's significantly more modern than the ones that are used currently.
- ARandomerDude 5y agoI mean, they don't have to release the code. Nobody owes you open source tools.
- rejectedandsad 5y agoI'm saying internally to Google. You don't have to do any of this at most companies.
- jefftk 5y agoOn the other hand, all of the JS here has been fully typed for 10+ years, so there are some pluses
- pjmlp 5y agoActually at big ones you need IT clearance to adopt new versions, as you are only allowed to use what everyone is using. Hence plenty of companies still on Java 8, baby steps adopting C++11, Python 2.7, .NET Framework 4.8 is now being deployed, and similar.... Installing whatever you feel like locally doesn't work, because either you miss the required rights, or it will die on the CI/CD pipeline anyway.
- koprulusector 5y agoPersonally, I’m not a huge fan of TypeScript. I feel it’s unnecessarily verbose at times. I used ReasonML for a while, and I absolutely LOVED it. I’m just bummed about the uncertainty of the projects future and adoption and the lack of alternatives that seem to make TypeScript the defacto standard.
- draw_down 5y agoI agree, however its utility outweighs that in a large org. It’s basically indispensable for frontend programming at scale. Having dozens or even hundreds of people contributing to a codebase without it (or equivalent) would be chaotic and painful.
- tasogare 5y agoSuper set of JS instead of a beging a totally different language, fix its main issue (lack of useful types for error checking and refactoring), adopted by many projects, backed by Microsoft and quickly releasing new versions: there is no wonder it's replacing JS where it can.
- dnndev 5y agoIt’s a fad. Give it some time… it’s not the first layer on top of JavaScript someone has come up with. Microsoft drops project all the time- this is a stunt on their part to attract devs and it’s actually working for now.
- draw_down 5y agoIt’s a “fad” in the same sense React is
- lstamour 5y agoThere was a time when folks said the same thing about Node.js...
- BoorishBears 5y agoI don't know how anyone who's actually used plain Js and Ts in a large project can say it's a fad. For frontend it might be different, but as someone who usually touches the Js ecosystem through node, I pretty much won't use Js. Like why should I give up insane utility with negligible (if any) runtime cost, high configurability (with sane defaults), easy buy in (since all Js is valid Ts)? Maybe the last part is what you're missing? Most "layers on Js" needed you to rewrite or annotate all your code to get and value at all. But you drop a tsconfig in a project and you instantly get value out of it. What past layer on Js had that?
- bilalq 5y agoI just resigned from Amazon today, and reading this is giving my flashbacks to my earlier years there. When I first joined in 2013, it was incredibly difficult to leverage open source third party libraries and build systems like grunt/gulp. I ended up doing a lot of work to make it possible to model JS dependencies using the standard Amazon dependency management setup and to create bindings to our language/stack agnostic build system. It was an uphill battle at times, but I got things to a point where you could reasonably do things in Amazon similar to how you'd do them externally (without sacrificing any of the advantages of of our first party tools). The solutions I engineered still had to make some compromises and better solutions by dedicated teams were built later on, of course. All this just to say that I can very readily sympathize with the challenges that Googlers must be facing. Edit: To clarify, I put in my 2-week notice a while back and today was my last day. That's what I meant by "resigned today".
- rattray 5y agoCurious to hear more about the resignation?
- bilalq 5y agoOh, hey Alex. As soon as I saw your handle, the name "Alex Rattray" popped to mind, and sure enough, that's who you are. I think I probably met you at a hackathon many years ago (maybe PennApps?), though it was probably in passing, since I don't think we ever worked together on a project. Small world though! I'd been at Amazon for many years and had always wanted to move on to doing my own startup, which is what I'll be doing starting tomorrow. It's an exciting moment for me. My biggest worry about leaving is figuring out what to do about health insurance, but my fallback plan is to go with COBRA until I figure something out.
- seanmcdirmid 5y agoYou should also checkout the health insurance exchange if in Washington. Those policies can be cost competitive to your COBRA costs, and resignation is an event that allows you grab one outside of open enrollment.
- ausumm 5y agoSummarized this great article into an audio clip, feel free to listen to this one, it's 1 minute and 40 seconds: https://ausum.io/s/Ztlw5iibrIRTiSRAJvsVpq8_Mn9xsB20s71VeYtuusw https://ausum.io/s/Ztlw5iibrIRTiSRAJvsVpq8_Mn9xsB20s71VeYtuu...
- ChrisArchitect 5y ago(2018) As others will point out alot has progressed and changed since then, this isn't news. Lots of previous discussion: https://news.ycombinator.com/item?id=17894764 https://news.ycombinator.com/item?id=17894764