4 ms·
I have a genuine side question... Why does Meta have 10M lines of Java for their Android code base? What's in it?
by keyle 2y ago
I have a genuine side question... Why does Meta have 10M lines of Java for their Android code base? What's in it?
- t-writescode 2y agoJava's how you wrote Android apps before Kotlin came out. I expect they have __all their existing Android code__ in Java. 10MM lines doesn't seem out of line for a very, very established company with 100k developers across several products. It's one of the 3 main platforms that people interact with Facebook on and so they'd want it to be as good and as fast as possible, especially on older phones for the time when Android phones were new.
- wg0 2y agoWhy they wouldn't use React Native?
- t-writescode 2y ago* Facebook Messenger came out on Android in 2011 [0] * React Native came out in 2015 is written in C++, Java, JavaScript, Objective-C, Kotlin [1] [0] https://en.wikipedia.org/wiki/Messenger_(software) https://en.wikipedia.org/wiki/Messenger_(software) [1] https://en.wikipedia.org/wiki/React_Native https://en.wikipedia.org/wiki/React_Native So, even if they did use React Native, they still have 4+ years of code in the original language; and, React Native doesn't stop the use of Java
- lawgimenez 2y agoMost importantly, why was Threads not written in React Native?
- Yiin 2y agoBecause Instagram wasn't, and Threads is pretty much a copy pasted Instagram codebase (for good reasons).
- rycomb 2y agoI'm pretty sure wg0 was being facetious.
- keyle 2y agoI'm well aware of the history of Android, Kotlin and Java. Still my question stand...
- cowsandmilk 2y agoMeta doesn’t have close to 100k developers.
- aithrowawaycomm 2y agoThere's a lot of subtlety in what exactly a "line" is, especially for Java and especially for a legacy enterprise codebase: hard to say that Meta's 10M is actually twice as big as someone else's 5M. I have no clue what's in their code, but I would expect a lot of "almost redundant" stuff around specific Android versions, manufacturers, etc, which can really pile up.
- smrtinsert 2y agoReally the only question I have on this post. So many of their non ai updates make me roll my eyes
- Too 2y agoAll those AbstractContextFizzProviderMetaFactoryBuilderInjectorStreamManager quickly add up.
- incrudible 2y agoThat is mostly a meme. What really adds up is putting every little thing into its own file and having an interface and a (usually trivial) implementation for everything.
- optymizer 2y ago(Android dev at Meta here, though not involved with the Kotlin migration. Opinion below, completely my own) We have: public and internal apps, tests for those, tons of wrappers around Android APIs, autogenerated infra code, did I mention the API wrappers?, custom layout engines, duplicate code that people wrote because they couldn't be bothered to search the monorepo, code that was copied without much thought because people searched the monorepo and found something, app architecture tools like dependency injectors, annotation processors, custom build tooling, etc If you can think it, someone has probably committed Java/Kotlin or native code for it already.
- keyle 2y agoThat makes sense. Thanks for the answer.
- 59nadir 2y ago> duplicate code that people wrote because they couldn't be bothered to search the monorepo, code that was copied without much thought because people searched the monorepo and found something This is also a very common way in Object-Oriented code bases to ensure you're not messing anything up by re-using classes. Concatenating yet another class to the code base is the safest and laziest way to ensure you're not possibly changing the behavior of anything else when you inevitably need to add/change something in the class.
- optymizer 2y agoWe move fast and break things ;)
- redditor98654 2y agoWhy is this a OOP problem and not a problem in large code-bases in general? I can easily see it happening in functional or imperative languages where one creates an almost identical copy of a function instead of reusing and modifying an existing one.
- 59nadir 2y ago
- phyrex 2y agoAs a consumer you're only ever seeing the tip of the iceberg of Meta apps. There are at least 3 major user groups: The consumers, the producers, and the advertisers, and each of them is at least as complex as the others. Then you have to consider the global audiences, and that e.g. ads are handled very differently in the EU than in North America, and that needs to be accounted for.
- redleader55 2y agoI don't think people realize that "Android" at Meta is not just the "Facebook" app, but also: WhatsApp, WhatsApp for business, Instagram, the whole Oculus layer on top of AOSP, whatever they use for Ray Bans, etc.