C++ and Facebook Moments: Facebook code blog, Techworld

fb-moments.PNGHere are two notable articles related to C++'s central role in Facebook's Moments app, released yesterday.

The first is the announcement on the Facebook code blog:

Under the Hood: Building Moments

by Ashwin Bharambe, Zack Gomez, and Will Ruben

From the article:

... There are many alternatives for sharing code between mobile platforms. We wanted to optimize for fast iteration, app performance, and native look and feel. After weighing the alternatives, we chose to write the UI in platform-specific code and the business logic in shared code using C++. Traditionally, C++ is known for providing high performance while lacking easy memory management and higher-level abstractions. However, using modern C++11 features such as std::shared_ptr reference counting, lambda functions, and auto variable declarations, we were able to quickly implement highly performant, memory-safe code...

The growing use of C++ for cross-platform shared code in mobile apps is not a new technical story in itself -- last year's CppCon had multiple sessions about doing this including from Dropbox and Microsoft Office -- but even the mainstream press is starting to notice this is happening more often:

C++: It is back to the future for Facebook's new photo-sharing app

by Joab Jackson, TechWorld

From the article:

Faced with the burgeoning problem of maintaining a code base for multiple, incompatible mobile applications, Facebook engineers turned their noses up at HTML5 and trendy development programmes and went back to the 70s [sic] for an answer.

By choosing the C++ programming language for its new Moments photo-sharing application, Facebook is able to maintain a single code base for much of the app, which runs on both iOS and Android devices.

"It is somewhat of a surprising choice," admitted Ashwin Bharambe, one of the Facebook developers who created Moments, about the use of C++. "There are more and more people trying to do this in order to share code across different platforms." ...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.