Facebook Has a New Private Mobile Photo-Sharing App, and They Built It In C++
jfruh writes: Facebook [on Monday] announced Moments, a new mobile app that uses Facebook's facial recognition technology to let you sync up photos only with friends who are in those photos with you. Somewhat unusually for a new app, the bulk of it is built in the venerable C++ language, which turned out to be easier for building a cross-platform mobile app than other more "modern" languages.
Thank you for being a friend
Traveled down the road and back again
Your heart is true, you're a pal and a cosmonaut.
And if you threw a party
Invited everyone you knew
You would see the biggest gift would be from me
And the card attached would say, thank you for being a friend.
>>>Facebook announced Moments, a new mobile app that uses Facebook's facial recognition technology to let you sync up photos only with friends who are in those photos with you, advertisers who are unlikely in these photos, law enforcement agents who are probably not in these photos, APT hackers that are no in these photos, and that dude who specializes in recovering data from used electronics that always presents at the conference.
Fixed that for you.
one in the toolshed."
So, what, it's written in Lisp with some Fortran libraries?
With modern certification mills cranking out millions of Java and .Net and Framework and Node.js and Shiny chimps, they've essentially guaranteed that it's unauditable by anyone not on a short list. +1 to you, Facebook.
If C++ is "the best tool" for cross-platform mobile app development, then the state of mobile app development is in a sorry state indeed.
Seriously if C++ is the best we can do for *anything*, then we need to just throw in the towel and go back to pencil and paper right now.
Only to people who don't know what the fuck they're talking about ;-)
C++ is all over the place. Yes, it's a complex language. But it gives a hell of a lot more control over all the tradeoffs in software implementation than all the other "popular" languages, with pretty high-level abstractions at the same time.
a station wagon full of #ifdefs hurtling down the information superhighway.
"Fuck That."
... Oddly enough. At least, that's what the Play Store says. Maybe some other restriction in place.
Shouldn't it be written in assembly then, or maybe on punch cards? :)
Just cruising through this digital world at 33 1/3 rpm...
Somewhat unusually for a new app, the bulk of it is built in the venerable C++ language, because the main guys on the team were big C++ fans who found a way to justify their preference.
Not saying it was the wrong choice, particularly for the team in question, but I'm betting if you hand the project to another team you come up with a different language.
Also interesting is it sounds like they're using an automatic code generator to translate some of the stuff from C++ to Java to run on android, maybe it will work seamlessly but that extra layer always makes me nervous.
I stole this Sig
We could call it 'getting facefucked' and the cameras could now squirt semen in people's face to complete the experience.
My ism, it's full of beliefs.
FIRST POST of that type
C++ is so flexible that you can write all your nasty "legwork" code (performance-sensitive stuff, like the actual facial recognition, image data manipulation, etc.) *once* and call it from whatever UI layer you write.
Granted, it's probably somewhere between hard and impossible to write a mobile platform-agnostic UI layer that actually looks good on both Android and iOS, since iOS and Android are so different in that regard; but even if they didn't bother doing that and just wrote two entirely separate view layers, they still can separate out all the heavy lifting and "write once, compile in two places". Both Android and iOS have decent to good C++ support, so if you make it platform-independent, you can have an optimized core library that works on the two major mobile platforms with no modifications.
Not sure I would go with C++ for something that was less performance-sensitive, but in this case, they can probably peg the CPU of a modern smartphone for at least a good fraction of a second with some of their heavier code.
Unless of course they are simply taking the image and uploading it to "the cloud" to do the facial recognition, in which case it's kind of a head-scratcher, since you don't need C++ to make HTTP requests.
On what planet is C++ an unusual choice?
I'm completely ignoring the "Facebook" part of this announcement. What's news to me is that (most of) an app on any mobile platform can actually be written in C++ instead of Java or Swift. I quite seriously had no idea this could be done. The few times I've dabbled in Android development, for example, absolutely everything centered around Java. I've never played with iOS development because I don't have a suitable device, but I assumed you had to go with Objective C or Swift.
Where do I get started building Android apps in C++? Inquiring minds suddenly want to know.
Anything that has to be shipped outside your own organisation really has to be written in C++.
Look at the alternatives for commercial development of retail applications:
- Java - no good gui toolkits, resource hungry and bad latency. It is _possible_ to use, but never seems to be as performant as a native choice. Requires JVM. Contaminated and effectively dead as a platform as a result of Oracle's extremely, extremely, extremely extreme view on API copyrights, so not an option in my company any more sadly. Oracle really scared our lawyers, however crazy us technical people consider Oracle management to be, and however unlikely they are to prevail. SWT was the best toolkit I used for java GUIs. Definitely shippable.
- C#/.NET - no portable choices for GUI toolkits. Shipping a binary mono that works everywhere is tricky on Linux due to dependencies on GTK. No acceptable portable UI toolkit. Winforms kind of works, but it actually rather clunky and nasty. My impression is that it performs better than java, I guess because we ahead of time compiled everything we built with it mostly.
- C++ - Qt, GTK, wxWidgets all work as commercially supportable toolkits. I have shipped Qt apps. The best GUI toolkit I have used on any platform, when used properly. Dependencies in C++ are simple and easy to manage. C++14 also offers a never nice improvement over C++98 - almost like a whole new language. The traditional reasons for avoiding C++ are gone. Sure, it may be a mental burden to less competent developers to learn properly, but do you want to employ incompetents anyway?
Of course, developing internal software, that doesn't need to be packaged and shipped on all customer's Linux and Windows is a completely different world.
In this world, I would probably go with a mixture of C++ and C#, depending on project requirements.
If you didn't restrict the toolshed to high-level languages, it would have been written by flipping switches and rearranging patch cables.
Where do I get started building Android apps in C++? Inquiring minds suddenly want to know.
The latest versions of Qt5 support building Qt/C++ apps for Android and iOS. I've never tried it for more than running a few examples, but it seems pretty nice and easy, and I've really enjoyed Qt development for years now.
These guys clearly have no sense of fashion. On the other hand this could have been done with any turing-complete language.
Only Luddite software uses C++. Modern app appers use App languages, like AppScript and App App!
Apps!
C++ is "Venerable"? Based on its first standard version, it is 17 years old. Seriously, we set the bar of language decrepitude at only 17 years?
I might might let it slide if you used that adjective for C or something even older. But C++ has only just now gone through enough revisions to start getting halfway decent. You wanna just chuck it in the retirement home right when they are starting to get some of the kinks worked out? One or two more revisions and they were going to get it up to the capabilities of Ada. :-)
Brutal.
Please note the following quotes from the article:
With C++, “a lot of our more complicated logic can be written once and run on both iOS and Android,”
Due to the complexity and the performance required, HTML / Cordova were not viable options ( see http://magenic.com/Blog/Post/4... Test 4: Prime Number Calculation, where cordova takes 12 - 23 times longer to run than native / xamarin). This performance is not an issue for most applications, but for something like face detection you bet this has an impact.
In regards to Xamarin, it could have been a viable solution. The main issue here though is that doing work on images is a lot harder to do performant without pointers in c# (ignoring unsafe code), and in a portable class library so it can be shared (limited support for images).
The best performance wise (ignoring memory, Xamarin seems to manage memory better in most instances) would be to go native. But doing this means that you would have to write the complex calculations twice, once in swift/objc and java.
So this leaves doing it in c++. This is indeed possible, but you would only do this when you have very complex and performance dependant code that you do not want to write twice (for example, image manipulation). If you pick c++ for any other reason, you are most likely picking the wrong technology as it is more difficult to write mobile applications in c++ than the other languages (yes, the other languages have abstractions, that is because most applications have no need to care about low level operations).
So Facebook, look at their business problem and solves it using the best tool available. This does not mean that c++ is the correct technology for all cases.
The smart ones only know java , the rest think HTML +CSS are programming languages and javascript is the domain of almost omnipotent god like beings whose radiance they can only begin to emulate.
Facebook has some actually competent coders that do not need to be coddled and do not start to cry if the language they use requires some actual understanding?
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Seriously, if you want to write something that works in any platform, write it in C, C++ is a second but still valid choice.
When people design a platform, one of the first thing they do make it run code written in C. It is also the language of choice for everything UNIX : Linux, BSD, GNU, etc... It is well standardized too : sure, it is easy to shoot yourself in the foot but if you code properly, it should work on any platform. And as an added bonus, good C code is also valid C++ and ObjC.
As probably many others, I've been looking into this exact problem for a while, comparing a lot of available options. Ultimately, I want something to run on Android, iOS, Windows (+ Phone), Linux, and OS X. The very complex core logic should be a write-once affair, while not having a single shared UI is not such a major issue, nor is writing some platform-specific utility classes. I have also come to the conclusion that C++11 for that core is the most viable option.
Some interesting tidbits not mentioned in the summary is that they used DropBox's djinni to generate C++, ObjC and Java bindings; and they used the Flux unidirectional data flow architecture. Both of these things are worth reading about, more so than any thing that is actually mentioned in the summary.
If you want fast applications, write them in C or one of the C family (C++, Objective C). If you want fast to write code, don't then,
There's yet to be a single language that can compete with that language group for speed, capability and power of the resulting code (providing it's relatively bug-free) It's a higher cost of production for a better quality result.
While occasionally a really well-tuned script language can match it for capability (perl succeeded there) - usually they cannot.
And anyone who calls these "Venerable" has to realize they're being arrogant in a way they can't back up, because they're linguistically implying obsolescence.
I make apps, using Qt, for Desktop (Win, Mac & Linux), Android and iOS. Having the same source code (which happens to be c++) across all platforms allows me to master one tool kit and spend time make more apps instead of learning a new language every time Apply or Google feels like it.
"There are only two kinds of languages: the ones people complain about and the ones nobody uses"
Bjarne Stroustrup
I criticise Snowden for not knowing what the American people want in practice. In my book, corporations stealing my private info is worse than the NSA stealing my private info. People willingly use Facebook, whom sells private info to corporations. Therefore, NSA stealing that info is acceptable.
I have seen people online argue the opposite. Namely, that the US govt has lots of military power, and corporations do not. It would be nice if the public could come to an answer on this.
Initially developed in the late 1970s, C++ is a powerful general-purpose programming language, and is still widely used for writing mission critical and performance-sensitive applications.
Hardly. Stroustrup first introduced C with classes at Bell Labs in 1979. It wouldn't be known as C++ until at least 1983.
'The tyrant will always find pretext for his tyranny.' - Aesop's Fables
I learned Objective-C so that I could deploy on iOS and otherwise wouldn't have given the language a second look. Then I discovered Cocos-2d which makes C++ on iOS, Android, etc very easy so boom I happily made the leap back to C++ and haven't looked back. There is pretty much zero chance that I will write more than a few dozen lines of Objective-C again in my life. There is also pretty much zero posibility that I will write any swift and I certainly have dodged the Java bullet for Android.
About the only problems that I have encountered are some artificial ones where some API features are cut off from me without a tiny bit of Objective-C or Java. But those tiny bits get wrapped in a C++ class and forgotten.
Seriously if C++ is the best we can do for *anything*, then we need to just throw in the towel and go back to pencil and paper right now.
Sometime, "pencil and paper" *are* the best tool for the job, because they work everywhere.
Same for C++:
It's maybe not Dart (for Google Chrome), nor Rust (for Firefox), nor Swift (latest gen iOS), nor whatever is the latest cool thing (scala ?) to run on a Java machine (for Android), nor Ruby (is that the lastest hipster thingy on servers ?)
But it works everywhere. Thus there *are* legitimate solution were using the older or simpler tool is better than all the modern hyped bells and whistles.
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
I just got through doing an app this way. It's a sensible way to do certain types of apps. Definitely not everything, but in this case it was talking to a BLE device, and it was easier to code the "core" (the part that dealt with packets, etc.) in C++ and leave the UI specifics to the Android and iOS SDKs. The biggest inconvenience is the layer between the C++ and "native" parts, but it's not rocket science.
He didn't say C++ was worthless. He said it would be a pretty bad thing if it was "the best tool" or "the best we can do", and going by the rest of your comment I'm not sure if you'd completely disagree.
Take away its heritage advantages (libraries and compilers-- "it's popular for being popular"), and you are left with what exactly?
Let's see, you have almost-foolproof C compatibility... except most other languages can link to C code. Annnnnd... hmm. I can't really think of anything else. High performance OO maybe, but other languages can do that in more powerful ways (including Objective C).
Why is that modded funny? It's not a half-bad idea!
(Of course, these days when you want half-Lisp, half-Fortran, you use a different syntax and call it Matlab (or GNU Octave). It's better than using C++, at any rate!)
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
What's news to me is that (most of) an app on any mobile platform can actually be written in C++
What do you think games for Nintendo DS, PlayStation Portable, Nintendo 3DS, and PlayStation Vita are written in?