6 ms·
Rewriting the Messenger codebase for a faster, smaller, simpler messaging app (2020)
- DueDilligence 3y ago[dead]
- p-o 3y agoIs it me, or are they implicitly saying that they're ditching React Native in favour of native code? That's a pretty big deal if that's the case.
- helsontaveras18 3y agoThey’ve ditched react native for quite some time now
- brundolf 3y agoAnd I don't think this is a knock against it. React Native is mainly an effort-multiplier, and Facebook has plenty of resources to do 2x the work (or 1.5x or whatever it is in practice)
- wkat4242 3y agoDo they still after all the layoffs though? And it's not just an effort multiplier, it also provides a unified codebase on both platforms which helps to provide a more consistent UX and less bugs.
- shtack 3y ago“Consistent” UX is often one of the downsides of cross platform frameworks. Android and iOS have distinct UX details that users expect in their apps.
- inferiorhuman 3y agoThis is a problem even with desktop apps. Look at the print dialog abomination that Firefox unleashed on us.
- easrng 3y agoChrome did it first, and (at least on Windows) the system print dialog sucks anyway.
- inferiorhuman 3y agoSure, and the single biggest weakness over at Mozilla is that they're more focused on building a better Chrome (a.k.a. following the leader) instead of innovating or fixing bugs. That's why we've lost useful tools like the 3D DOM rendering in favor of a fucking chat client in Thunderbird. Or why if your system is lagged enough you can hit Cmd+T, start typing a URL, hit return, and have Firefox load the new URL in the old tab… but at least we have that awful search instead of separate, proper, URL and search bars. It's why we get limited-time-only!!! paid themes while all extensions get disabled because someone forgot to deal with an expired certificate. Mozilla, and by extension the Firefox crew, lost sight of their core competencies a long time ago. Every dumbass design decision the Chrome folks make, Mozilla will emulate a few years later.
- earthling8118 3y agoDefinitely agree on some of this stuff. The themes situation sounded pretty delusional the whole time. And there were many more decisions like that. However, what is this about separate search and url boxes? I have that, still. You don't have to have just the single box. Still, the main url box still behaves as a search either way. Is that what you mean?
- easrng 3y agoIIRC Thunderbird is a separate project now, not part of Mozilla, no?
- j45 3y agoReact was the last new curve of single code base. Things like Flutter are the new ones that have been able to learn from and improve on it.
- wkat4242 3y agoI generally prefer react native apps (note that this is not the same as react which is more of a web framework) over Flutter. Because Flutter fakes native UI elements instead of just calling them.
- j45 3y agoTypo, I meant react native and not react in my comment. React native is pretty heavy. Works nice and happy for those who enjoy it.
- ec109685 3y agoThey didn’t use react native for messenger previously.
- zer0zzz 3y agoThe desktop messenger apps are still react native. The mobile apps were always native (ObjC and C++ on iOS, C++ and Java on Android). The mentioned project was mostly to rewrite the core of messenger in C to further reduce overhead and code size compared to those other mentioned languages.
- morkalork 3y agoMust have been embarrassed after that recent reverse engineering messenger blog post / tour de force marathon.
- ipsum2 3y agoSeems like a waste of time machine, considering this article was written before the blog post.
- School-Cotton 3y agoFacebook doesn’t really care about reverse engineering in my experience.
- ipsum2 3y agoArticle is from 2020.
- saagarjha 3y agoUpdated, thanks
- metadat 3y agoJust curious, how did you update a submission you didn't submit? Edit: @flockonus (now deleted, why'd you do that, my new HN friend?!) If by "karma == moving maintains" you mean emailing hn@ycbombinator.com like the rest of us.. then ok ;)
- deleted 3y ago[deleted]
- saagarjha 3y agoSome users can add dates to submissions that lack them.
- Tycho 3y agoWould it not be possible to write a good messenger app in say 10,000 lines of code? What are the other hundreds of thousands of lines doing?
- rTX5CMRXIfFG 3y agoAnalytics perhaps, then handling “Login with Facebook” buttons in other apps.
- nostromo 3y agoMessenger does a ton of things. It does video calls, voice calls, text messages... you can send money, send gifs, send videos... you can even view Instagram Stories for some fucking reason.
- zamnos 3y agoPedantically, Instagram stories and Facebook stories are two separate things.
- eyelidlessness 3y agoI’d be shocked if they don’t have 10k loc devoted to the status indicator alone. It’s cross user-facing service, cross platform, and notoriously unreliable enough to be a convenient excuse for social inaction (not that I’d know anything about that /s).
- gibolt 3y agoThat is probably mostly handled by a backend service. Client code should be minimal
- zamnos 3y agoimplementing error handling and features
- binkHN 3y ago> In the end, we reduced core Messenger code by 84 percent, from more than 1.7M lines to 360,000. iOS only.
- vimy 3y agoIs it still using Objective-C? Is there still a job market for Objective-C developers or only in big companies to maintain legacy apps?
- saagarjha 3y agoMessenger is primarily a C codebase.
- deleted 3y ago[deleted]
- MarkSweep 3y agoI can’t remember if this is the exact library LightSpeed uses, but this CG/SQL library that Meta made makes it easier to write complex SQL queries for SQLite: https://cgsql.dev/ https://cgsql.dev/
- ipsum2 3y agoYes, it's the same one.
- javajosh 3y agoCan anyone shed light on where the complexity is coming from? Even 360kloc for a chat client seems excessive - its original size, 1.7Mloc, is hard to accept. How does it break down - e.g. 120kloc UI, 120kloc networking/data, and 120kloc other? (For comparison I dl'd https://github.com/signalapp/Signal-iOS https://github.com/signalapp/Signal-iOS and ran cloc. It's about 400kloc of Swift, so I guess it's in the ballpark. I just wouldn't have guessed it was so big, and I'd like to know why.)
- SOLAR_FIELDS 3y agoJust conjecture here since I have not ever done work in the messenger space: Perhaps it’s like Uber in that all of the complexity comes from localization features? Edit: I saw another post further down that hypothesized that all of the complexity was with integrations outside of barebones messaging like photos, calls, other Facebook products etc. which seems plausible as well
- j45 3y agoOne guess: abstracting abstraction enough times can accomplish pretty much any Mloc.
- lanza 3y agoBecause you don't make money deleting code. People at tech giants don't love their employers like they are their mother or something. They don't do things that don't get them rewarded. Implementing new features does. And so engineers implement new features and write more code and release the features and get rewarded for doing so. Once the feature is done, if it's easy to delete it they will. If not, and it never is, they'll leave it around and move on to something else. When you have 3 billion users if you make the company 1/100th of a penny per user per year you pay for yourself. That's like increasing the value of the average user by 1/200,000. So your feature doesn't even have to be that good. It just has to be minimally better than what it's replacing. Restyle a button to be more appealing in the peripheral vision of users and that probably breaches that threshold. Reality is that it isn't quite this easy (fewer users are that valuable, most don't use it daily, etc). But it gets the point across. You work there to make more money and deleting some feature that is probably referenced by some other dead code somewhere else isn't profitable work for anybody.
- mvdtnz 3y agoMessenger on Android is genuinely one of the buggiest pieces of software I have ever used. It astounds me that people will take technical advice and use software libraries developed by this company that delivers such poor quality software. Just a few of the issues off the top of my head. Most of these have been ongoing for several months and some for several years. * Type something into the input box, quick-switch to another app, then switch back to messenger. Your half-finished message is now gone. But if you kill messenger completely then bring it back, your message is back - even if you have sent and received dozens of messages in the interim. * The sticker selector has been completely broken for at least 3 years. It shows the grey smiley face placeholder image for every sticker pack apart from your bitmoji rip-off pack. This bug has been around long enough that I have verified it happens on 3 different phones from different manufactures (because I have upgraded twice in the time this bug has existed). * The recently used emoji category may as well be using a random number generator to select what goes in there. * The share menu from other apps sometimes shows Messenger twice. This doesn't happen for any other apps for me. * Custom notification sounds on a chat will randomly revert back to the hideous default sound. * Images I post will display properly until one other person sends a message to the chat, then will turn white and not come back unless I hard-stop the app and bring it back. It's not clear if this is occurring for other people in the chat, but I've only seen it happen to my own images and not others'. * Quite often someone will post a picture to the chat and instead of a picture I will see them post the message "XXXX posted a photo". The only way to see the photo is to hard-kill the app and bring it back. There are so many more. Terrible software.
- gigatexal 3y agoThis is the coolest thing to me: “We accomplished this by using the native OS wherever possible, reusing the UI with dynamic templates powered by SQLite, using SQLite as a universal system, and building a server broker to operate as a universal gateway between Messenger and its server features.”
- ilrwbwrkhv 3y agoi wonder how vk does everything faster than facebook. their website and apps feel much faster and snappier.
- gmerc 3y agoThis was a clusterfuck. When David Marcus failed upwards they decided to throw out the overcrammed feature experiments that had turned the app into Word 2000, a deluge of features with 2-8% user base. But they never informed any of the dozens of other teams in the company they had courted for 5 years … gaming, payments, bots, etc and who had been building on top of it and brought partners. Just overnight suddenly they went ‘fuck you and your customers, we need to compete with iMessage in the US, we deprecate everything and your partners can eat it’ Of course it failed and the cost was massive - partner trust was destroyed, game developers ruined, people left without access to bot based financial services, etc.
- dgellow 3y agoWhat’s the context here? As someone who doesn’t know anything about Facebook or messenger I have difficulties understanding what happened. Are you saying that this rewrite was a clusterfuck, or that the previous implementation was one?
- k4mgur 3y ago[flagged]