AMA with

Ben Lesh

Lead developer of RxJS, Software engineer at Google

December 1st 2017, 7:00 pm

Ask me about:

  • RxJS
  • JavaScript
  • Contributing to Open Source
  • Working at Google
  • General advice


Shout out


This AMA session is over but you can still ask questions to Ben Lesh on their Hashnode profile.

Message from the host 💬

Thank you all for the awesome questions and the kind words! It's been fun! 🍻

Which tools/software/websites do you use everyday to accomplish your work?

Chrome, TypeScript, VSCode, Git, Bazel, Github, jsbin, Babel,,,, Vim (occasionally), Node, NPM, and a whole bunch of Google internal tools when working on Google internal stuff

What motivated you to start working out consistently? How seriously do you take the food you eat as a part of it? Do you think it helps with your work?

Well, a lot of things motivated me. I didn't like where my life/body were headed, once I started doing a lot of talks, I started seeing more and more pictures of myself and thinking "Whoa, I look really fat and old" haha.

The food you eat is 90% of fitness, easily. Weightloss and fatloss is about calorie deficit. Muscle growth is about ensuring you have enough calories, protein and nutrients to rebuild muscle you're purposefully damaging in the gym. "Abs are made in the kitchen" is totally true.

I have no doubt it helps with my work. It's much easier to stay focused when your body is properly fueled and you have a little exercise to balance out your blood sugar. If you don't feel like crap it's easier to get your work done.

I've also noticed people take me a lot more seriously and I have more pleasant interactions with people throughout the day since I've lost weight. It's unfortunate, but people do treat fit people better than overweight people, so that's been a positive effect too.

You are an experienced programmer. What five serious pieces of advice would you give a new programmer?

Five? Whoa... hmmm

  1. Keep an open mind. You can learn things from anyone or any thing. That technology you think "sucks" probably has some really brilliant parts to it.
  2. The delete key is your friend. Don't be afraid to make mistakes. You can always delete them. It's better than not trying.
  3. Work incrementally. Don't try to build things "big bang" right out of the gate.
  4. Have tests. Preferrably integration tests and unit tests where needed. They will save you some day. They might be a pain to right and maintain at times, but they're critical to your emotional well-being later, trust me.
  5. HAVE A LIFE. Work isn't everything. Don't let a company trick you into working 60 hour weeks. I've literally NEVER in 20 years seen someone work themselves into a promotion by burning the midnight oil every single night. It's, frankly, dumb. Go enjoy kids, or (non-computer-related) hobbies, or movies, or get some fresh air.... whatever, just get away from the computer for a bit.

Barack Obama vs. Donald Trump? Who do you support? 😂

According to you, which family decorated White House better for Christmas?

What is a product you've built that you're really proud of?

Other than RxJS (obvious)... I once wrote a vector graphics processing engine for a small garment customization shop in Columbus, OH. It would look up your school/high school, get colors, mascots, names, etc, and generate dozens of designs based on procedural templates, and even render them onto images of garments with perspective and everything. It did all of this in a second or two, and all in the backend. I was written with C# and GDI+. Such a fun thing to write. Even cooler, when you ordered the design, it would take the vector image, generate an SVG file, and send it to the designer for approval, saving TONS of work recreating the design in Illustrator. AFAIK, that code is still backing the design customization stuff on (although the website is not the one I worked on 7-8 years ago)

Hi Ben, ReactiveX library for JavaScript sounds dreadful. How would you explain RxJS to a noob? 😊

Thanks for the AMA. 🍺

Haha... It's not that bad.

I think that it's important to get people to start off slowly and not just dive into every operator and being "fully reactive". I recommend people start small and just learn how to subscribe to observables, maybe try filter and map... then work their way up to merging, error handling, etc.

What coding editor do you use and why?

I'm using VSCode, primarily because for a while it had better handling for TypeScript, which is what RxJS is written in. Also, inside of Google, VSCode is very popular. I'm addicted to multiline editing pretty much since using Sublime forever ago, and VSCode has that, which is nice.

Microsoft makes fantastic IDEs.

I've just switched to VSCode and amazed at how good it is. Great to hear your recommendation for it.

Which language rule the future software industry?

Always bet on JavaScript.

... Until WASM matures to do more and is targeted by something amazing or widely known like C#, then bet on that.

Hi Ben, The internet hasn't been good to Angular this year. What's your take on it? What went wrong with Angular? Why I don't hear fellow developers recommend Angular for any projects?

Some of it is echo chambers. If you're in the React community, that's all you'll hear about, same for Angular. The Angular conferences I've been to are MASSIVE. Easily some of the biggest conferences I go to. I don't think it's going bad for Angular at all, and I've seen a lot of growth.

Now that said, I do think there things Angular can do to improve, and I know they're doing those things. Making Angular simpler and faster being the primary thing there.

Do you think it is feasible to replace redux with RxJS and maybe recompose? It seems it would keep my closer to javascript and first principles of functional reactive programming. What would be the downside of that approach?

Totally. A redux store in RxJS is basically just the scan operator.

However, the downside is you're going to be rolling your own architecture and forgoing any of the nice devtools that people have developed for redux.

What's the hardest thing to learn about RxJS?

How to "think reactively", basically thinking in terms of sets of events and how to query/join/create them from one another.

Besides RxJS, what other libraries or paradigms are pointing the way in front-end development?

I think React has been a huge driver for most recent innovations.

Another thing you're going to start seeing more of is async functions and async function* (Async generators). Those are pretty powerful and intuitive.

Finally, WASM. WASM isn't quite ready yet. But it's a dark horse. Once it's ready and there's an attractive language to use on top of it, it's going to cause some serious shake-ups in web development.

Hi Ben,

Do you remember your first OSS commit? What was it? Please share your experience. :)

I made a PR to AngularJS that was quite large, adding handling for HTML5 date-time inputs. When it was merged by Tobias Bosch it ended up getting merged under his name, which was a little disappointing at the time (because I wanted that sweet github street cred), but I was still thrilled my contribution made it in. Again, very educational around the processes, etc. with regards to contributing to open source. It was a great experience.

What are your thoughts on TypeScript? The future of web? Will it replace JavaScript?

TypeScript is great for adding some type-safety to JavaScript apps. I don't think it can/will ever replace JavaScript, there are some things you can do in JavaScript you just can't do in TypeScript. For example higher-kinded types aren't a thing in TypeScript, so you can't have "generic generics" that can support some of the interesting things you can do with a dynamic language like JavaScript.

TypeScript shines more in providing safety and refactorability for large apps and teams.

How hard is it to get into Google as a machine learning engineer?

Well, it's hard to get into Google in general. The interview process is notoriously difficult. I don't have any ML experience, so I can't speak to that, but generally Google hires Software Engineers (SWEs) without knowing what position they will be placed in. Placement comes after they join Google. There are a few exceptions to that, but that's the general process.

What is your favorite Pokemon

Snorlax. Hands down. Snorlax knows what's up. 😴

What's your work like outside of open source? How is the team dynamic different in your 'day job' vs rxjs?

Well, in my day job I work directly with other developers, who are all brilliant folks, in-person. I eat lunch with them. I have a lot of design reviews and meetings and such. In RxJS I'm working with brilliant devs as well, but it's a little more asynchronous, meaning that I don't get a lot of face-time, and a lot of the work is done in my off-hours and spare time, then communicated to someone like OJ Kwon for review.

So overall the feel is just different. Not better or worse. I do wish I could work in-person with other RxJS contributors, but that's just not how OSS works usually.

I saw your article on Embular. Did you believe that Ember and angular will be merged on some day? Did you spoke regarding this with those team?

Are you working on react? If it is yes, when you will choose angular and react ?

No. I don't think Ember and Angular will be merged. I think they share a lot of ideas, and despite a perhaps thorny past, the two teams seem to get along pretty well, and there's been some collaboration between the two in recent years. In particular the initial AngularCLI was based directly off of EmberCLI. But I don't think they'll merge, they are two different organizations run by two different types of entities.

Redux-saga vs RxJS vs GraphQL... what do you see as the future?

Well, those things are all very loosely related. Side effect management, vs push-based primitives vs Async Graph library.

So if I had to predict the future, I'd say they all win? haha. :)

Well I meant the front-end.

In the company I work for, we see redux-saga as a poor man's RxJS, and GraphQL, I've heard can sometimes replace both ... i.e., you can make data requests declarative, eliminating the need for aync management.

But in the same vein, there's still room for all three in the front-end... which leads to developer overload from having to learn three different technologies.

What do you think about Angular Universal? Do you think SSR is addressing js becoming more of a 'compiled' language? Why would we think about SSR in development?

SSR is something you think about to address perf issues with time-to-first-interactive. I think SSR is here to stay, but it's definitely not something that is required in all apps. Or even most apps, really.

As for compilation, any templated framework (Angular, Glimmer, etc) is going to, and should have, a build-time step to compile templates into simple functions that update DOM or write HTML. That's definitely a trend I don't see stopping anytime soon.

As for getting paid for oss. What would you like to work on and how could we support that. Rxjs has changed my way of programming and I'm more then thankfull for that.

I'd love to be able to dedicate more time to making RxJS better for everyone, keeping up on PRs, updating docs, establishing better relationships with contributors, working with standards bodies and browser vendors to ensure RxJS stays in-line with upcoming changes to the web. It would be practically a full time job for more than one person. It's just hard because I don't have the time, my day job is important too, and kids gotta eat ;) haha.

Can you share your Google interview process? Just general, not details. For example, did you go through the same process as an unknown candidate (you were already a celebrity when you joined). Were you asked to solve a problem on a whiteboard?

Oh I definitely did all the same things anyone else had to do.

Basically you do a phone screen. Then you come in for a day and you sit through 5-6 45 minute interviews, each of which involves whiteboarding through a problem. You're asked questions, most of which are probably way harder than they need to be, and you're expected to write and talk your way through it. Talking through your thought process, asking questions, and considering edge-cases is key.

If you want to study for one, I recommend going to and trying to solve some of the problems there, then looking at the REAL answer, and trying again. Just keep practicing like that until you have most of the patterns memorized. It's sort of fun anyhow.

Just remember, the person interviewing you DID NOT come up with whatever binary search or sorting algorithm you're answering with. They had to memorize it just like you. They're only as smart as you are.

There's currently a TC39 proposal for adding a Observable implementation to JavaScript. How do you expect this to affect RxJS? Is the proposed pipeline operator a way how this could be integrated with operators from RxJS?

Btw. thanks a lot for your work on RxJS. I'm currently using it for a gesture driven animation and Rx is the only model I'm able to express this in a clean way :).

RxJS 5 and up has always had a goal of being a reference implementation for the proposal. Obviously RxJS has to change a little slower than the proposal might, but the goal is to be in-line with proposal so we can leverage native Observables when/if it lands.

The pipeline operator, if it landed, would work OOTB with the lettable/pipeable operators we have in RxJS:

import { map, filter } from 'rxjs/operators';

  |> filter(x => x > 3)
  |> map(x => x + x)

I think the pipeline operator would be fantastic for libraries like RxJS and Lodash.

Thank you for your kind words, BTW! I means a lot!

What is the most ingenious growth hack you have encountered?

Put yourself out there, blog, do OSS, start a podcast. Look at Kent C Dodds, a lot of people don't realize he only has about 5 years (?) of experience under his belt. He's really good at self-promotion, and that to me is a fantastic growth hack. He's met and learned from some great people because of how proactively he promoted himself and his brand. He's also a really nice guy so I'm sure that helps.

What are your strategies for keeping yourself up to date as a Software engineer so that you can continue to be innovative?

Mostly I just follow people on Twitter honestly. I talk to people in the industry a lot. I ask a LOT of questions to anyone that might be able to answer.

Have your jumped into the AI and ML world? Have you experimented with it.

Outside of interacting with it, no. I do like to see if I can trick it, or see what it comes back with. The best I've done is I once wrote a very simple bit of ML around a custom search engine for a garment customization company's ecommerce site.

Any resources you can recommend for marble testing libraries for observables? We've been using jasmine-marbles for this but it can be slow going when testing more complex scenarios and need to do configuration with the test scheduler.

OJ Kwon (fellow RxJS admin) has a library called rx-sandbox that's pretty beta, but probably worth a look.

Hi Ben,

Name a few developers you admire and whose opinion matter to you!

Oh gosh, this wouldn't be fair. I've met so many amazing people in this industry and there are so many developers I admire. I mean the ones whose opinions matter the most to me are generally friends of mine like Jay Phelps, Igor Minar or Stefan Penner.

Sam Saccone, MIsko Hevery, old friends from back in the day like Tom Jelen and Chris Klein...

Oh God... see? I feel guilty for all of the amazing people I know that I've missed. 😰

What advice do you have for someone who is looking to get involved in an Open-Source project, but doesn't have a lot of confidence in their knowledge and skills? I want to get involved because I know I'll learn a ton from the experience but i'm not sure where to start? Any tips on seeking out projects to engage would be greatly appreciated!

Well, first of all, have more confidence. Or at least have the confidence to try. Most maintainers will help you get a PR through if it's something they find valuable.

Also, be very, very patient with maintainers. Most likely they're overworked, and this is their part-time job. It might take them a long time to get to your PR, and you might have to ping them several times to get them to notice. Don't pester them too much.

Thanks for answering and for the encouragement! I also would like to ask where one might search for a project to join? Do you just cruise Github and look for one or are there any sites that make it easier to find projects to join that you recommend? Thanks again!

I have an RxJs question that might be good for helping others (and myself) understand RxJS Observables and timing.

Lets say I have a service that looks like so: getData(something){ // ...code return IntervalObservable.create(1000) .flatMap(() => { return this.http.get(url).map(res => //do something with res ); }); }

This is getting called in a component like so:$ = this.MyService.getData(this.something)

A) How would I fire this request to get the response back right away (instead of waiting 1 second) and then wait another 5 seconds to resend the request? B) Let say I want to add other observables to this, and have them all call the service and get data back at the same time. How would I do that? I read some place about hot and cold observables and .share(), but I don't know if that is relevant.

My use case is an app that will allow you to add multiple devices to listen to a server and sync data, but they all need to sync at the same time. I am not sure this is even the best way to do it, but it works so far for one item. Thanks for the guidance!

A) You can use timer instead of interval to send a request right away but have the same effect:

timer(0, 1000);

// which is the same, basically, as:

concat(timer(0), interval(1000))

B) You'd use share or shareReplay which makes the observable multicast, thus "sharing" it's values with many subscribers. Since it's something happening on an interval, I'd use shareReplay(1), because that is going to cache the previous value and give it to a new subscriber right away, instead of them having to wait for the next notification.

timer(0, 100).pipe(
  switchMap(() => this.http.get(url)),

The above approach is what you'd what to do.

BTW: I recommend against using IntervalObservable.create, that's more of an implementation thing from the library, instead import { interval } from 'rxjs/observable/interval';. That will give you a static function to use.

Am a fresher, which is the best language for my career start as well as my future growth?

Depends on your goals. Frontend? JavaScript. Backend? Probably Java. (Rust, Go, et al are really cool, but these are where the jobs are right now still)

What is your opinion about mean stack ?

I don't really have any solid opinions on it. I've only played with it a little, and it's been several years.

Is it good idea to use Vue.js with RxJS? Why and why not?

I've never used Vue, but I do know they have a vue-supported-and-maintained library for integrating with RxJS, so it seems like they go together quite nicely.

RxJS is pretty low-level. I've used it with Angular, React and Ember, and I'm positive it will work well with any framework.

Sometimes java is best in industry , sometimes python , sometimes c++ , or other . Why it is like this ? who is making best each other ? Actually it is existing or any marketing trick ?

There is no "best". They're just tools to accomplish tasks. If I write a web server in Assembly or I write it in Basic, the end user doesn't care at all. They only care that the server works. If you're looking for what to use, then I'd say just choose the most common thing, there will be more jobs and better documentation.

The only way I've figured out so far to get arbitrary data into a stream (besides .from operators and the like) is to make a Subject and use .next. I read somewhere this isn't recommended. Do you have a suggestion, or even a link to a good article on it?

So anything you could use a Subject on:'send me');

can be wrapped in an Observable:

const source = new Observable(observer => {'send me');

The latter is better because it's less imperative than the former, and you can encapsulate more (setup and teardown of a resource, for example).

Thanks for your work with RxJS. What do you think about remote working? Have you worked remotely?

Remote work is fun but it has it's challenges. I've spent about 2 years of my career as a remote worker in the past. The upsides are obvious: No commute, can wear pajamas, you're at home, etc.

The downsides are less obvious: You feel (and perhaps are) more expendable when you don't have face-time with your team. You're never "not at the office", so you feel more beholden to requests from managers at 8pm on a Saturday. You also get lonely sometimes as you don't really see other adults for a good chunk of the work day.

All in all, I'd do it again for sure. It's just not all a bed of roses like people think it is.

Hi Ben,

What do you like most about working at Google and what do you like least?

Brilliant people, gyms, free food, gBikes. Lots to love.

There's a bit of institutionalization here though, where many people have never worked anywhere but Google, so their perspectives can be a little skewed by that.

Can you recommend me in Google for a job?

I can help you apply. But I don't feel comfortable recommending people I don't work with or know. :)

I asked you near to five questions ! Do you want to ask some questions to me?

Sure... if you could go anywhere and eat anything in the world for lunch, what would it be? How would you eat it? Where would you eat it?

Sorry, it's creeping in on lunch time so my mind is on food.

Answer for you lunch question : actually lunch time for you , my time is 12 :29 am assume my location? ,😎

I was thinking more like "I want to eat a burrito, while on horseback, on the beach in St. Barts".

Actually you only typing answers for all this question or do you have any assistance or helper for this session?

It's really me.

An assistant! 🤣 LMAO.

I drove my dented Hyundai to work, where I sit at a tiny little desk under fluorescent lights. I assure you, I'm not fancy enough for an assistant.

I'll ask for one though... just to see what happens. hahaha.

View Ben Lesh's profile on Hashnode

Community Sponsors

The all-in-one cloud platform developers & their teams love. Get started free for 60 days.

Learn more

Chat SDK for your web and mobile apps.

Learn more