GoingNative 8: Introducing Casablanca - A Modern C++ API for Connected Computing

Sign in to queue

The Discussion

  • User profile image
    felix9

    NICE ! The April GoingNative in the last minute.

  • User profile image
    Heavens​Revenge

    Steve Gates was way too bland, go deep or go home Tongue Out

  • User profile image
    devcodex

    This is amazing, I have been toying around with a pet project that interacts with several REST/JSON  based API's and seriously feeling the lack of a good library for this type of work in native c++. This is the type of effort that I've been looking forward to and I can't wait to start playing with it.

    @Charles Good job on the solo mission man, this was a great ep!

  • User profile image
    NoSenseEtAl

    STL will be back! Im sooooo happy. :)
    Now will watch the rest of the show...

  • User profile image
    Zura

    This is great!

    Samples are very elegant. This brings C++ to a whole new level.

    Charles, on a similar (C++) note, always wanted to ask here, do you know Jeff Alger and where is he now? He is the author of favorite book of my "teenagehood" - "C++ for Real Programmers". He used to work on MS at that time.

    Thank you!
    Zura

  • User profile image
    Charles

    @Zura: Hi Zura,

    I have no idea where Jeff Alger is these days.

    In terms of samples and Casablanca SDK, I couldn't agree more. It's great to see a modern C++ API that doesn't involve too much ceremony to do to relatively simple things. This approach is clean and user-friendly. Bravo, Casablanca team! Way to go modern. Smiley

    C

  • User profile image
    Charles

    @NoSenseEtAl: Indeed. We're very excited to get STL back into our studio! Smiley

    C

  • User profile image
    XTF

    What platforms does this API support?

    Just Windows? Sad

    C++ needs cross-platform libs.

  • User profile image
    Niklas Gustafsson

    We discuss this in the DevLabs forum on Casablanca. The short answer is as an incubation project, it's Windows-only, but it's not our intent to keep it that way.

    http://social.msdn.microsoft.com/Forums/en-US/casablanca/thread/82f5d4a2-91a6-4abc-8509-5bb48a277ab7

    Niklas

  • User profile image
    pnewhook

    Super excited to see some ideas from Axum coming back to life. That was a sick project.

  • User profile image
    Int64

    This is a really nice library, something that I would love to see in the standard. The client code I wrote was really simple and clean. You really start to see the goodness of C++11 when you use a library like this.

    One comment - is there a reason why the field/key operators in the json::value class only return by reference and not by const reference as well?

    Something like this:

    void kung_foo(json::value const& jobject)
    {
        int id = static_cast<int>(jobject["id"].as_double());
    }

    won't compile.

  • User profile image
    benjamin​Lindley

    @Int64: Sounds like it's modeled similarly to std::map, where operator[] inserts an element if one is not there, and so cannot be const.  Does it have an at() function?  Or a find() function? I can't check it myself at this time.

    And speaking of that @Devs, is there any way for us to view the code online or off without having to run a setup program that only works on Windows?  Or at least a way to see the full interface even if we can't see the implementation?

  • User profile image
    freefly

    I really appreciate the efforts with new libraries for C++. This is a huge step forward.
    I wish that Microsoft will consider moving the development to windows phone platform as well.

  • User profile image
    Int64

    @benjaminLindley: Ah, that makes sense. Looking at the interface, it appears the solution is to return a const ref to the underlying field map and/or element vector and use their find/at functions:

    auto& fields = jobject.fields();
    auto iter = fields.find("id");
    if (iter != fields.end())
        id = static_cast<int>(iter->second.as_double());

    The field map is implemented as stdext::hash_map - wonder why no std::unordered_map?

  • User profile image
    Niklas Gustafsson

    benjaminLindley is absolutely right -- it's so we can use the operator on either side of an assignment operator. And yes, it is modeled after existing STL collections. No at() or find() yet -- I will add that to the list of things to augment with.

  • User profile image
    Petke

    Wishlist: SOAP and HTTPS

  • User profile image
    Charles

    @Petke: Thanks for the feedback. The team is aware of the need for HTTPS, for sure.
    C

Add Your 2 Cents