Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Social Networks Facebook Programming

Facebook Has a New Private Mobile Photo-Sharing App, and They Built It In C++ 173

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.
This discussion has been archived. No new comments can be posted.

Facebook Has a New Private Mobile Photo-Sharing App, and They Built It In C++

Comments Filter:
  • by sinij ( 911942 ) on Tuesday June 16, 2015 @09:48AM (#49921369)
    >>>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.
    • by Anonymous Coward on Tuesday June 16, 2015 @10:11AM (#49921539)

      I'd like to add that with employers intruding more and more on our personal lives - we are on the clock 24/7 these days even though we're only paid for 40 hours. They are starting to scrutinize every aspect of our lives. [usatoday.com]

      And what I find disturbing is that younger folks, who grew up with facebook and other crap like that, think nothing of posting pictures of parties or other gatherings where one might be doing something that your current or future employer may find objectionable.

      I am more paranoid about what a backgroundcheck would turn up than even government persecution - I haven't started hiding Mulsims from stormtroopers yet in my basement. But being denied employment because someone put a photo of me holding a tray of shots and hanging out with some cross dressing friends frightens me. The job is too capricious and managing ones image is extremely important - and it is a sucky World that we live in - thanks corporate America for having privatized Stasi!

      • by OrangeTide ( 124937 ) on Tuesday June 16, 2015 @10:21AM (#49921619) Homepage Journal

        If the vast majority of the new generation manage to piss off future employers, what are these businesses going to do, not hire anyone at all? Because they certainly aren't going to start hiring 50 year olds.

        • If the vast majority of the new generation manage to piss off future employers, what are these businesses going to do, not hire anyone at all? Because they certainly aren't going to start hiring 50 year olds.

          This strategy seems to be working for military and police agencies not hiring white hats who were formerly grey hats or black hats.

          Oh wait. The government keeps getting their computers successfully attacked... guess it's not a great strategy after all. Never mind.

        • This is a case of selection bias. We see people posting ridiculous things, so we think everyone does, but believe me, there are plenty of people who don't post stupid shit to Facebook, and are -- not surprisingly -- very competent and responsible people, or who are at least competent enough to appear to responsible. There's no shortage of competition for jobs in sensitive industries, whether it's finance, government, or law, and yes, they pass on people who post stupid shit on Facebook.

          • Whew, I thought it was just every one of my friend's teenagers and most of the interns at work. But thanks for sharing, I'm glad it's only occurring among people that I interact with and is not a broader issue.

        • If the vast majority of the new generation manage to piss off future employers, what are these businesses going to do, not hire anyone at all? Because they certainly aren't going to start hiring 50 year olds.

          Ummm... you already know the answer to this since you work in Silly Valley currently: They will bring in more H1Bs since there will not be enough "qualified" workers locally. Heheh.

      • Meh. I had a government background check for my current IT job. The investigator and I spent four hours for a two-hour interview discussing every contracting job that I ever had in the last seven years. The security wonks find it strange that a person might actually have more than one employer at a time. We never discussed my Internet activities. I'm sure the Chinese will find my case file [cnn.com] interesting.
        • The security wonks find it strange that a person might actually have more than one employer at a time.

          That's because it is strange (at least for IT jobs, not McJobs). Having multiple clients at a time, however, is not.

          • I worked for three IT jobs in 2011. A Monday through Friday PC refresh job at one Fortune 500 company, a weekend job as a PC disconnect/reconnect technician for a moving company with multiple Fortune 500 clients, and a month-long job at a Fortune 500 data center when the other two jobs went on break for the holidays. I typically worked 12 days straight before I got day off.
      • by KGIII ( 973947 )

        I have no room for Muslims in my basement. That is where I keep my small Lithuanian boys and an elderly man of indeterminate (Hispanic?) ethnicity. The boys carry my packets to and from the ISP's network. The elderly man whistles a mean modem. I call them Team Server Room II. They replaced Team Server Room after the infamous 'Halon Incident.'

      • I'd like to add that with employers intruding more and more on our personal lives - we are on the clock 24/7 these days even though we're only paid for 40 hours. They are starting to scrutinize every aspect of our lives.

        Nobody is forcing you to be a wage slave; you can run your own small business.

        And what I find disturbing is that younger folks, who grew up with facebook and other crap like that, think nothing of...

        What I find disturbing is that so many people, old and young alike, subscribe to the idea th

      • Unless you are an hourly employee, you are not being paid for 40 hours. Common thinking, but wishful thinking.

  • by Anonymous Coward

    one in the toolshed."

    So, what, it's written in Lisp with some Fortran libraries?

    • So, what, it's written in Lisp with some Fortran libraries?

      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!)

  • by new_01 ( 4014887 ) on Tuesday June 16, 2015 @10:02AM (#49921469)
    a station wagon full of #ifdefs hurtling down the information superhighway.
    • Of course, because the compiler leaves *all* those #ifdefs in the binary. You know, all those the preprocessor didn't catch.

      • by halivar ( 535827 )

        Ah, I remember fondly the old days of MUD code in C, written to support 15 flavors of UNIX, MacOS, and 3 flavors of DOS. The #ifdef's on the socket code could go on for miles.

        • by Rob Riggs ( 6418 )

          Ah, I remember fondly the old days of MUD code in C, written to support 15 flavors of UNIX, MacOS, and 3 flavors of DOS. The #ifdef's on the socket code could go on for miles.

          Yes, and today we have POSIX and we code for that. And we use Boost ASIO to hide the Windows/POSIX differences from the application developer.

          • by halivar ( 535827 )

            Oh yeah! I forgot; we had #ifdef __posix, too!

            Absolutely non-obligatory XKCD: https://xkcd.com/927/ [xkcd.com]

            But yeah, I was ripping out a lot of legacy code and replacing it with POSIX; this was the late 90's, so it was already well-established.

    • Especially if the station wagon gone to plaid.
    • by Jamu ( 852752 )
      No matter how good your tools, sometimes you need duct tape.
  • by MurukeshM ( 1901690 ) on Tuesday June 16, 2015 @10:05AM (#49921487)

    ... Oddly enough. At least, that's what the Play Store says. Maybe some other restriction in place.

    • C++ for Android is an interesting challenge, because there are multiple processor types out there. Although a Nexus 5 is pretty close to a reference platform.

      • Doesn't seem to be directly C++ on Android, rather it's converted. It's just that the tools exist to convert C++ to Java and allow them to manage a single codebase.
        • Google's own documentation suggests that running native code isn't really a problem, and just use JNI to handle the interface.

      • C++ for Android is an interesting challenge, because there are multiple processor types out there.

        Remember when Apple was shipping MacOS for both Intel and PPC processors? C++ programs worked just fine. There's not much in computer science that hasn't already been solved.

    • According to the Play Store, it allows me to install it on all my Lollipop devices:

      My T-Mobile LG G2, my Sony Xperia Z Ultra, and my Nexus 9.

      May be, they're doing a staged rollout [android.com] thing. Staged rollouts are a good idea from a technical perspective. The marketing department hates them, but on a popular app they can avoid you thousands of negative ratings/reviews because there is always someone, whether it's an impatient higher up or an impatient developer, that tries to make one tiny little change to the fin

  • 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

    • by halivar ( 535827 )

      I suspect it is more likely that they are using a critical library that is easier to code around than to reimplement in another language.

    • Maybe so, but C++ is actually a smart way to go if you need to write cross-platform code, especially now that C++ 11/14 has fixed a lot of the most troublesome and problem-prone aspects of the language. Other than C#/Xamarin, I can't think of another language that would be easily portable across all platforms, and C++ certainly has a performance edge for any sort of heavy lifting that has to be done on the client.

      C++ compiles natively on Android, so I *suspect* they're using that translation to automatical

  • Bye bye freedom to walk anywhere and not be geolocated by a fucking computer with some exif data. They must be licking their lips for the amount of association data they can mine with people using this technology.

    We could call it 'getting facefucked' and the cameras could now squirt semen in people's face to complete the experience.

  • C++ makes sense here (Score:4, Interesting)

    by allquixotic ( 1659805 ) on Tuesday June 16, 2015 @10:20AM (#49921611)

    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.

  • LOL (Score:5, Insightful)

    by tylersoze ( 789256 ) on Tuesday June 16, 2015 @10:21AM (#49921617)

    On what planet is C++ an unusual choice?

  • by Anonymous Coward

    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

    • There has never been any problem with integrating C code in Mac OS X or iOS.

      • Did you mean C++, which is what GP was talking about, or stating a completely unrelated fact? Because Wikipedia supports either interpretation - I'm just concerned that you might be having a stroke and need help.

    • Qt for Android (Score:5, Interesting)

      by mx+b ( 2078162 ) on Tuesday June 16, 2015 @10:47AM (#49921805)

      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.

    • Google "Android NDK". That should point you in he right direction. However, I am not sure how much of the "app" is C++ versus the back end, which is the more likely place for the image processing to occur and C++ is an excellent tool for image processing.
    • 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?

  • by Anonymous Coward on Tuesday June 16, 2015 @10:37AM (#49921737)

    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.

  • 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 o

    • by putaro ( 235078 )

      I learned C++ in 1987. The original Stroustrup book came out in 1985, so more like 30 years old.

      • by T.E.D. ( 34228 )

        The original start date is quite debatable. Some argue back even further (like '79!). Its complicated because C++ had an unusually long development period. Personally I don't really consider anything prior to C++ "2.0" (1991) to be anything more than an experimental waypoint in the development of the language. After that you can start making arguments, but I still don't put it before the first true compilers (not precompilers) became widely available and a lot of people starting using it for serious project

        • by putaro ( 235078 )

          1998 may be a "convenient" mile post but it doesn't reflect reality. There was a lot of large scale development going on in C++ in the early & mid-90's. By your measurement, C++ is younger than Java!

    • "Venerable" does not quite mean "decrepit". The meaning is more like respect for an elder. "Official standard" or not, it has been around as a real language since the early 90s (Borland?), which definitely makes it an elder in computer land. I mean, Windows is written in C++ and it definitely gets the "venerable" title by now.

    • by JMZero ( 449047 )

      You realize venerable is a positive word, right? It implies age, sure, but the point of it is "respected" not "decrepit" or "ready to retire".

  • And the news is? (Score:4, Interesting)

    by gweihir ( 88907 ) on Tuesday June 16, 2015 @11:13AM (#49922015)

    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?

  • by GuB-42 ( 2483988 ) on Tuesday June 16, 2015 @11:17AM (#49922051)

    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.

    • Actually, C is indeed awesome for cross-platform compilability; however, try using libraries cross-platform. Nastiness.

      For example, the crypt() function. Call it under Linux and call it under OpenBSD and see how that works out for you. Yes, it is possible. I am not even sure that is available in Windows.

      Pure, ANSI standard C will compile under any platform. It is the details (libs) that kill you.

  • by SirJorgelOfBorgel ( 897488 ) on Tuesday June 16, 2015 @11:23AM (#49922117)

    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 [github.com] to generate C++, ObjC and Java bindings; and they used the Flux [github.io] 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 cal
  • 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.

    • Hardly. Stroustrup first introduced C with classes at Bell Labs in 1979. It wouldn't be known as C++ until at least 1983.

      While related and mostly compatible, C and C++ are different languages.

  • 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

I THINK MAN INVENTED THE CAR by instinct. -- Jack Handley, The New Mexican, 1988.

Working...