Quite a few comments seem to imply Messenger was written in React Native, so I want to clarify this is not true. Messenger was a fully native app before the rewrite, too! RN isn’t the right tradeoff for Messenger — whose new core is written in plain C — but its use at FB in general is growing, with 750+ screens in RN. So the rumours of its death are greatly exaggerated. I think it’s great to have different options wi…
LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
311–320 of 333 posts
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#312Earlier quoted context omitted.
Thing is, all these frameworks are leaky, to debug anything on them, or to add missing functionally, that small team needs to be an expert across two native frameworks, and the hybrid/abstraction framework that they are betting on.
Yes and no, I think that depends how deep you want to go. For your standard "show and update some content and make it look pretty" type app, I can tell you from both my own and others experience you don't really need much familiarity with the native platforms, other than how to use build tools etc. which are well detailed online. If you want to go deeper or have more specialised requirements, then you might need a de…
Beyond "Hello World" all of them required me to get my hands dirty, at which point I was better off just doing C++ with native views, standard out of the box tooling available across all SDKs.
Nowadays I rather go for PWAs, or plain mobile Web, unless it is something very special that requires OS APIs or hardware access.
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#313Earlier quoted context omitted.
How in the name of everything did they manage to write 1.7M lines of code for a messenger app? That is an astonishingly large code base! We're talking about an instant messenger app with heaps of features, having a LoC footprint 3.5% of the size of modern Windows.
LOC is proportional to the number of engineers on a project. All engineers have to justify their existence, so, they will write code.
Another plausible explanation is lack of code re-use and reinventing the wheel because you don't know someone else solved the same problem. Also correlates with number of engineers.
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#314Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#315Earlier quoted context omitted.
I would love to read more about why large apps are so big. I currently work on a project that is much larger than I would expect it to be, both in terms of codebase and people, and while I don't know who to jank, I also don't understand why it has to be so big.
Part of it also comes from the tendency of large orgs to ship their org structure. It can oftentimes be worthwhile to have individual teams each fully "own" a piece of the product, and that also comes with the autonomy to choose to duplicate stuff that other teams might have already built rather than working with them and tweaking it to match their own specific new requirement. This significantly reduces communicatio…
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#316Earlier quoted context omitted.
To be clear, Messenger wasn’t being rewritten from React Native. It was a fully native app before, too.
Yeah, not sure where this idea has come from. Seems like RN haters just jumping on any opportunity to slate it. Reality is, just like most technologies, RN is a good fit for some scenarios (small team needing to support both mobile platforms? no native devs on the team? performance not critical? etc.) and not a good fit for others. I guess many native developers feel negatively towards it because a lot of companies w…
There seems to be a much more obvious explanation as to why people are assuming it used to be React Native. The article says:
> > Compared with the previous iOS version, this new Messenger is [mentions improvements].
> > We accomplished this by using the native OS wherever possible […]
That seems to imply that it wasn't native before and they got the gains by switching to native. And since Facebook are well-known as the creators and biggest users of React Native, it's not a big leap to make the assumption that that's where they were coming from.
[Also, in case there's any confusion please note the distinction between "native", meaning it is compiled to native code; and "React Native", which is a cross-platform framework that is not compiled to native code. "React Native" is a horrible name for something that is not native.]
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#317Earlier quoted context omitted.
LOC is proportional to the number of engineers on a project. All engineers have to justify their existence, so, they will write code.
I've never felt the need to justify my own existence. There's always been a longer backlog of work than my teams would ever get through and managers who appreciated the work getting done. Another plausible explanation is lack of code re-use and reinventing the wheel because you don't know someone else solved the same problem. Also correlates with number of engineers.
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#318Earlier quoted context omitted.
From TFA: "We reduced core Messenger code by 84 percent, from more than 1.7M lines to 360,000." Sounds like not only did they make the app quicker and lighter, they improved code maintenance too. If the android app is as the same size as the new ios messenger app, they'd still have less code to maintain than the previous ios messenger app. See also: this other comment - https://news.ycombinator.com/item?id=22468036
How in the name of everything did they manage to write 1.7M lines of code for a messenger app? That is an astonishingly large code base! We're talking about an instant messenger app with heaps of features, having a LoC footprint 3.5% of the size of modern Windows.
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#319Earlier quoted context omitted.
Yes and no, I think that depends how deep you want to go. For your standard "show and update some content and make it look pretty" type app, I can tell you from both my own and others experience you don't really need much familiarity with the native platforms, other than how to use build tools etc. which are well detailed online. If you want to go deeper or have more specialised requirements, then you might need a de…
I can speak for Qt, Ionic and Cordova. Beyond "Hello World" all of them required me to get my hands dirty, at which point I was better off just doing C++ with native views, standard out of the box tooling available across all SDKs. Nowadays I rather go for PWAs, or plain mobile Web, unless it is something very special that requires OS APIs or hardware access.
Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app
#320The architecture they have ended up with is similar to that described in Out of the Tar Pit, which describes how to remove as much complexity from software as possible. By moving all state into SQLite they have implemented the "store state in relations" layer, and then written (as far as possible) functional code on top. I've been thinking about how to make my software more like this so it's interesting to see Facebo…