CppCast - Cross Platform Mobile C++ in Visual Studio
Episode Date: March 12, 2015Episode number 3 of CppCast with guest Ankit Asthana recorded March 11, 2015 Ankit Asthana is a program manager working in the Visual C++ Cross-Platform space. He is knowledgeable in cross-pla...tform technologies, compilers (dynamic and static compilation, optimizer, code generation), distributed computing and server side development. He has in the past worked for IBM and Oracle Canada as a developer building Java 7 (hotspot) and telecommunication products. Ankit back in 2008 also published a book on C++ titled C++ for Beginners to Masters which sold over a few thousand copies. News Introducing the Universal CRT C/C++ Code analysis in VS 2015 Find your favorite Library for C++ in NuGet What is your favorite C++ IDE? Ankit Asthana Ankit on MSDN C++ for Beginners to Masters Links Visual Studio 2015 CTP Visual C++ Team Blog
Transcript
Discussion (0)
Episode number three of CppCast with guest Ankit Asthana recorded March 11th, 2015.
In this episode, we go over a few of the recent announcements from the Microsoft Visual C++ blog.
Then I'll interview Ankit Asthana, Senior Program Manager on the MS Visual C++ team.
Ankit and I will discuss how you can build and debug Android native C++ apps using Visual
Studio.
Welcome to Episode 3 of CppCast, the only podcast for C++ developers by C++ developers.
I'm your host, Rob Irving, and I wanted to start out this episode by thanking Jason Turner for being the guest last week.
We had a great talk about Chiscript, which is a really cool scripting language for modern C++.
So go listen to Episode 2 if you haven't already.
I also wanted to read a quick piece of feedback.
Scott wrote in to me that he's been enjoying CppCast. He says,
thanks for making my day. And I just want to let you know that the iTunes subscription link on the sidebar is pointed at the MS Dev Show podcast instead of CppCast. As far as I could
tell, the other subscription links were all correct, including the iTunes one in the footer.
Thank you, Scott, for the kind words. I really appreciate that. And I'm glad you're enjoying
the podcast. I have fixed the link on the website, and I really appreciate you visiting the site and trying to subscribe via iTunes. If you want to subscribe to the podcast, CppCast is available on iTunes, Stitcher, Player FM, and TuneIn. So please subscribe and share the show with your friends and co-workers. So joining me tonight is Ankit Asthana, who is a program manager for Microsoft on the
Visual C++ team.
How are you doing, Ankit?
I'm doing great, and I'm happy to be on the show.
Great.
So we have a couple blog items to read through tonight.
Because Ankit is here joining me from the Microsoft Visual C++ team,
I pulled these articles all from the Visual C++ team blog.
The first one is Introducing the Universal CRT.
And this calls back to another blog article
from James McNellis that he wrote a couple months ago
about the great C
runtime refactoring.
And it seems like they're basically
just trying to make the C runtime
a little easier to work with.
Do you know much about
what's going on with this, Ankit?
I think this is, yeah, absolutely.
I mean, I think this is basically
a complete, like, I think
James will do justice here,
but essentially we've basically tried to unify the different CRTs out here
and the purpose is for users to have a better experience
when they're coding up with this new CRD SDK.
So I think people who haven't actually read through this post,
this post is very, very detailed.
I would actually encourage you to go through it and ask us questions there.
Yeah, it is definitely a very detailed post.
It seems like one of the highlights
is that if you're distributing a Windows C++ application
onto Windows 10,
that you don't even need to distribute a CRT
because it's just going to be part of the operating system.
Yes, that's true.
Yes, that's very nice.
The next article I have is about C and C++ code analysis in Visual Studio 2015.
So Visual Studio 2015 is releasing some, what's the word for it, the RTPs, right?
Or CTPs.
Yeah, so CTP 6 just went out, and they turned code analysis back on,
and it seems like they've integrated the analyzer into the normal errors in Windows,
which should be just like a better GUI front end.
So that looks pretty nice. I was
actually really excited to go turn this on and test out the new analysis. But unfortunately,
it looks like it's currently only enabled for C, not C++. Is that correct, Ankit?
Yeah, that's correct. So like currently, I mean, like what we've done essentially,
you know, in the last one release is that we've basically, you know, migrated our front end or rejuvenated our front end.
That's the term we use around here.
And the reason for doing that is that we're now going to produce, essentially, we used to produce these ASTs.
We're going to produce these things called fully bound trees or FPTs, which are more rich in terms of information. And the purpose of doing that is essentially to have a rich analysis experience for static analysis tools,
whether it's code analysis or other tools
that can be written to leverage that kind of information.
So the effort, you know, the new front ends
only came around very recently.
And I believe currently only the C code analysis experience
is available, but, I mean, the team's working hard on enabling the C++ part of that as well.
So we're hard at work,
but if you have any feedback on your C code
using the C code analysis experience,
please let us know through the blog
or through comments on this particular episode.
So we're happy to hear that.
Okay.
Do you have any idea if the next CTP might be turning C++ analysis on,
or is that something you're not?
I think the next release that we have is the RC release.
Oh, okay.
And we're hoping, but, I mean, again, the team's hard at work here,
so I wouldn't want to commit, but it's possible that that might happen there.
Okay.
And the last article I had, and this was a more recent one,
was find your favorite library for C++ in NuGet.
And this is actually pretty nice,
and it's something that I bet a lot of C++ developers are not familiar with.
NuGet is the package management that's kind of associated
with.NET development. A lot of C Sharp developers, I'm sure, are very familiar with it.
But there's also a lot of C++ libraries in there as well. Just to name a couple, there's Boost,
Ogre 3D, Eigen, OpenSSL, C++ REST SDK, Libcurl, SQLite, JSON C++.
And these are all available to include in your Visual Studio C++ project.
Right.
And I think the other thing I want to mention here, maybe, in addition to what Rob, you know, you've added here already
or provided the description for already is the fact that it's actually really easy to, you know, you've added here already or provided the description for already is the fact that it's actually really easy
to, you know, if you use the NuGet Gallery
in Visual Studio, it's really, really
easy to incorporate and start using
these libraries. So I was actually playing with
the, like I was working on this OpenCV
app, you know, and, you know, using
you know, so I actually
incorporated the OpenCV library using this
mechanism. It's really, really dirt simple to
do this. So that's actually great.
And this is something that we've always heard from our.NET developers
who also write C++ code, that, you know,
it's really easy to have this go-to-library repository for.NET,
but it wasn't yet available for C++.
So this is actually great that, you know, we have the experience there too.
And the blog that I think Hong actually provided, you know,
kind of like enlists some of the details and the lips are already there.
So if you guys want to try this out and give us feedback, that would be great.
In addition to this, if you guys think that there's some libraries missing or other things that you guys are working on that might be interesting or the experience could be improved, again, you know, we're all ears to hear that out.
That's great.
How long has this been available?
I actually don't know the answer to that question.
But again, you can definitely ask.
I can follow up with details about that.
Cool.
So the other thing I wanted to comment on really quick was two weeks ago I actually put out a poll
and asked people on Twitter who are following CppCast on Twitter or following
CppCast on Facebook what their favorite C++ IDE is. And I thought that'd be a great question to
discuss the poll results with while Ankit is here. So, you know, C++ is a little different
than other languages because there's not, default IDE the way.NET is.
Everyone developing in C Sharp is going to go to Visual Studio.
Most people developing in Java are going to go to Eclipse.
C++ is a bit more varied.
But Ankit, you'll be glad to know that Visual Studio did get the majority of the votes, coming in at about 25%.
Awesome.
And what's the next clip? Was it Eclipse?
No, it was not Eclipse.
The next closest, I actually
feel a little bad about
this one because the
next closest was Klyon.
And I did not put them down as an option
but several people chose
other and then wrote in Klyon.
So Klyon was number two, followed by QT Creator,
and then there were a couple other votes for things.
I think there was one vote for Eclipse and a couple for Vim and Emacs.
Yeah, and I think Klyon is pretty new too.
So, I mean, or CLion or Klyon, however people prefer to say it, is pretty new. So,
I mean, that's actually great to hear and that's actually good to know. So, this is
actually interesting data for us as well.
Yeah, definitely.
So, let's talk about the work you're doing at Microsoft. I'm willing to bet that most
C++ developers aren't fully aware that you can
develop modern mobile applications using C++. Can you talk about this a bit and what you and
your team have been working on to help mobile C++ developers be more productive?
Absolutely, Rob. So, I mean, I think I would start with saying that if you take a look at the
different, you know, platforms of interest, like mobile platforms saying that if you take a look at the different platforms of interest, like mobile platforms.
So if you take a look at Android or Windows or iOS, for that matter.
I mean, if you take a look at the code element languages, like for Android, it's Java.
And for iOS, for a long time, it was Objective-C and now probably Swift.
And for Windows, it's.NET or C Sharp.
But one thing that's common across all
these different platforms is that they all
support C++.
And they all support C++
in majority,
with build system support
and debugging support and all that kind of stuff.
So what we've seen,
I mean, this project that we started working on
started off being internal to Microsoft
because what we've seen is that internally,
a lot of products that we had, like Office or Skype
or some of the other products that we have inside Microsoft,
they essentially tend to be very, very heavy C++ shops.
And what's happened is that they've actually extended
their traditional Windows desktop applications for Skype and for Office
to these different mobile platforms by adding a very thin layer of the core languages.
So, for example, for Office on Android, there's a very thin layer of Java in there, and same for Skype.
And then for Office on iOS, there's a very thin layer of Objective-C in there.
And when we actually started this effort, we started serving across external customers
with Garmin and Unreal
and all the other big enterprise customers,
Adobe, all these products have these things in common.
So if you take a look at why people want to use C++,
it makes even more sense in a cross-platform mobile world
because what people are trying to do now
is that they're trying to write this big fat layer of C++ code
and then share that layer of code across different platforms
because there is no other languages
that allow you the same functionality
in terms of performance and reuse of code
that allows you to do this.
So that's one thing that we've seen with C++ definitely being around
and presence being heavy in the cross-platform mobile world,
especially for big, heavy productivity apps like your PDF reader, Word, Skype,
and many other games especially as well.
So, I mean, that should give an idea perhaps.
Right. And one key thing you said there was performance
because a lot of people in the mobile application space will point to something like Xamarin or PhoneGap, which lets you do multi-platform using C Sharp or JavaScript, but you're not going to get the same performance.
And you're not going to get the same amount of code sharing as you can get with C++ probably. Yeah, I mean, I think it's actually worth talking about maybe, you know,
because these are pretty, you know, the other two cross-platform solutions,
as Rob was mentioning, Xamarin and Apache Cordova or PhoneGap,
these are great solutions.
But, I mean, I think C++ is unique in the way that there's already, you know,
like if you take a look at the enterprise companies or a lot of the gaming companies,
you know, or the games that are being written, they already have a lot
of C++ code.
So if you want to take your existing code and take it to this mobile platform as fast
as you can, you know, Xamarin is not the way and Apache Cartova is not the way.
It's more so that, you know, you want to write that C++ code, a C++ flat layer of software
and then share it with the native language on the platform,
that being Java or Detective C or C Sharp for Microsoft,
which it has to be.
So that's one thing that's clear.
The second thing that, as you're mentioning, Rob,
is basically performance, right?
I mean, if you want to extract, like, you know,
the neon instructions on your Samsung Galaxy device
running your app for your game,
you know, hardware differentiating features
are easy to leverage using native code or using C++ on these mobile platforms.
So definitely reuse and performance will be, I think, one of the two reasons why people
look towards C++.
And I think that's going to stay that way.
Absolutely.
So what is it that your team has done to help out all those mobile C++ developers?
Right. What is it that your team has done to help out all those mobile C++ developers? Right, so essentially our scenario started with, you know,
taking a look at internal customers here at Microsoft.
And, you know, they've been Visual Studio Shops to date
as they were targeting Windows Desktop and Windows Mobile.
And as they started targeting these different other mobile platforms,
we noticed that, you know, we started getting requests internal to Microsoft. And then we also started seeing that what can we do noticed that, you know, we started getting requests internal to Microsoft,
and then we also started seeing that what can we do for that, you know,
like the C++ developer today is no longer just, you know,
the monolithic desktop developer.
He has these other mobile scenarios as well.
So we started thinking of migrating our experience currently
that Visual C++ provide and take it to a cross-platform mobile world.
So using our experience, what we're going after is that when you're writing that cross-platform
layer of C++ code in Visual Studio, we want you to have a great experience, the VS experience
that people like and leverage, which is the code editing, refactoring, IntelliSense, debugging,
and all those marquee features, and extend that experience for targeting other platforms.
So with VS 2015 Preview, what we started with was basically
support building Android native libraries in Visual Studio itself.
So Android has the capability of having a complete mobile application
written in C++
using native activity and using the native development kit
that they introduced with API Level 9.
And we support all the functionality that's there.
So we support you building a native activity application with C++,
which is a complete end-to-end C++ application
for your OpenGL-type apps or your games.
A popular user of that is Unreal for that kind of scenario.
We support you building Android native libraries,
which means the dynamic shared libraries,
which is similar to a DLL on the Windows
platform, static libraries, which is
similar to a.live on the Windows platform.
And for doing that,
we obviously had to support the tools
and the tool chain that comes
with building these
applications for the Android platform, which is what we have done. So we support Clang tool chain within VS with building these applications for the Android platform,
which is what we have done.
So we support Clang tool chain within VS as well,
which has been another ask for customers who have been using C++.
That's pretty impressive.
So Visual C++ or Visual Studio 2015 now comes with a version of Clang,
a version of the Android SDK,
and if you're developing an app that targets both Windows and Android,
you can do both from within Visual Studio.
That's correct, yeah.
So we have this template there currently.
And again, the point is about the templates
and the focus that we have is not to be a competitor for Android Studio or Xcode.
The focus for us is for users to use a competitor for Android Studio or Xcode.
The focus for us is for users to use us for writing that cross-platform C++ layer.
We are doing stuff that's necessary to have a lightweight experience to build the end-to-end application in Visual Studio.
But that's the core experience.
So we're going to have a great experience with IntelliSense.
So you can actually, when you're working in that shared layer,
imagine that you have some code there, and some code is specific to the Windows platform
or the Android platform. We have IntelliSense for both these platforms. And you can use those kind
of experiences to basically refactor your code easily without even actually building it for that
particular architecture or particular platform. We have Debugger, which has been extended to,
you know, to the Android platform. So anything that you guys are used to doing in the Windows world, guess what?
You can also do that in the Android world.
In addition to that, I mean, you know, this experience, we noticed that, you know,
a key experience for our users is the F5 experience in VS, which is the edit, build, debug experience.
And we noticed that some of the out-of-the-box emulators that we found for the Android platform
weren't really, you know, they were good at what they did from a functionality perspective, but they weren't
actually that good when it came to the editable debug cycle.
Like the startup time slow, you know, or some of the, you know, sensor features that they
had wasn't capable enough to do some targeted testing on the application.
And with our experience, we also launched VS Android Emulator,
which is basically to build on that great edit, build, debug experience.
So with the end-to-end shop that we have there,
we're actually thinking of making Android development,
Android native development easy on the Windows platform.
So that's the work that we've done, and then we've
added smarts there to allow you to
share that code for your Windows app or
in the future
iOS apps as well.
Yeah, the Android emulator that
comes packaged with Visual Studio is pretty amazing.
The one that you get from
Google with the Android
SDK and Eclipse, it
takes minutes to launch sometimes.
So the one provided by Microsoft for Visual Studio really takes it to the next level.
It's really easy to work with.
Yeah, I think so.
I think we were very spectacle at the start when we were trying to look at this scenario
because every time we would do any surveys, we would see that folks are using Android devices. And since Android devices are so easy to find, I mean,
it seemed like that's the scenario. But, you know, being the emulator being there is definitely
useful because you can just, you know, you don't have to plug in a device. You can just
do stuff there. Also, the features that we have in the emulator, like we have the, you
know, you can actually rotate your, you know, you can simulate rotation of a device and see how your app looks like.
You have, you know, you have, you know, GPS functionality in there.
You have an accelerometer.
So you can use these kind of sensors to do more targeted testing for your application, which might be a little bit hard to do sometimes in a real-world environment.
So we have all these features there.
And one thing I would add at the end is that, I mean, if you guys have done, like, Android development today, you will notice that the acquisition experience, especially if you're writing an Android native application or Android C++ application, is not that great.
You have to go to the website, figure out the NDK separately, Eclipse separately, some plugins into Eclipse which enable NDK development, and all that kind of stuff, which might be a little bit troublesome at start.
And so one thing that we've also done
is that we've actually provided a great acquisition experience.
So the traditional Visual Studio installer
that you guys are used to
now basically allows you to install
all of your cross-platform needs
with a check of a box that we've enabled.
So that's something else that should get you guys going easily
when it comes to doing Android-native development today.
Right. So in those poll results about C++ IDEs that I mentioned, there was one vote
for Eclipse, which is primarily a Java IDE. But if you're working on an Android application
with C++ code, Eclipse was probably your best and only option up until now. What do
you think the Visual Studio integration is offering that might persuade an Android developer to switch
away from Eclipse? Right. So I think to begin with, I think Eclipse is a great platform. I mean,
I've used it for doing Java development myself, and it's a great tool and great IDE. But sometimes,
you know, when one shop does all, it makes it a little bit troublesome.
So one thing that you would notice in Eclipse
is that when it comes to doing
native development, one thing that we've constantly
heard, and I've personally experienced as well
while writing these Android applications, is the debugging
experience. It's hard
to get the debugger to work
reliably. It's not robust.
The breakpoints don't always get hit.
In addition to that,
the ability to build
your C++ code,
yes, it
leverages NDK build, which is the
build toolchain that the Android NDK provides,
but it's not trivial
to figure out from the error messages and all that
what's going
on with your application, what these errors
mean, and all that kind of stuff.
So if you're using VS, again,
VS has the cross-platform side for it.
So if you're writing an Android and Windows application
and you have that shared C++ code of error,
it's a great experience there.
The debugger works right away.
You can test your app on an Android device or a Windows device.
You will hit breakpoints.
You will have Intellisys for Android platform.
You will also your other platforms
like Windows and iOS eventually
which allows you to make sure that
you're not adding any platform specific code
in that shared layer. So that's kind of like
the marquee experience that we're saying that
VS will provide over
some of the tools that have traditionally been there
for example Eclipse for doing native Android
development. So it's a debugger
it's language services support for C++,
and then it's the ability that, you know, you're able to share code
and write code for other platforms as well.
It's about VS being a cross-platform native IDE
versus Eclipse being able to do that, perhaps OK-ish for native Android development only.
Right.
By the way, if you are out there listening to this podcast
and you're using Eclipse for C++ for Android and you really do like it, please let me know if there's some secret sauce that makes the C++ experience better.
Because I'm actually working on a project and I'd be interested to know what it takes to make that experience a little bit better because I'm not too happy with it right now.
Moving on, Xamarin is a popular framework for mobile development that allows.NET developers to write iOS and Android applications with C Sharp.
We mentioned it a bit before.
You recently wrote a post on the C++ team blog
about how Visual Studio can build C++ native libraries
to be used by an Android application with Xamarin. Can you tell us a bit about how Visual Studio can build C++ native libraries to be used by an Android
application with Xamarin. Can you tell us a bit about how that works?
Yeah, absolutely. So, like, you know, one thing that I want to probably start with,
you know, saying is that Xamarin is definitely a very popular framework technology that allows
you to provide iOS, Android, Windows applications as well using C Sharp. But one thing that,
you know, is interesting from a Xamarin.CNU perspective
is that a lot of users using Xamarin today
are traditional Windows users,
people who were targeting Windows desktop.
So as a virtue of that,
these developers also had a significant amount
of C++ code in their apps.
So today, Xamarin,
in addition to being able to write a complete app in C Sharp targeting
Android and iOS, for that matter, also allows you to include a native library. So it allows you to
include a C++ library when you're writing that Xamarin Android application. And prior to what
the work we've done with Xamarin, what would happen is that you would use Xamarin,
and Xamarin has an ID itself as well called Xamarin Studio, but
if you're using Visual Studio for writing
your Xamarin C Sharp code for targeting
Android, when it came to writing
that native Android piece,
you would basically go to Eclipse
and you would write that piece there.
And then you would
basically pre-build, you would write that piece there. And then you would basically pre-build, you know,
you would basically build your binary there,
and then you would bring the binary,
and then, you know, after some hokey-pokey magic in the project and build system,
you would include that pre-built binary.
So if you had, like, a dynamic shared library that you were building,
you would basically add a hardcore dependency in your Xamarin Android project in VS
to be able to include that.
So you can imagine that when it came to, you know, fixing bugs or when it came to maintaining two different IDEs,
it was troublesome for folks to be able to use C Sharp and C++ both, you know,
when you're writing a Xamarin Android native application. So the experience that we provide now basically allows you to,
and we already allowed you the capability to create an Android native library
in Visual Studio 2015 Preview, but with our recent launch,
we now allow you to consume that library that you built for Android
into a Xamarin Android project as well, or a Xamarin Android application as well.
So you can easily consume it by just adding a reference.
So there's no longer any need to go to another IDE
to build that Android native library.
In addition to that,
you can also debug that C++ code in VS,
you know, which is being leveraged by that Xamarin project.
So, you know, it just makes it easier for folks
to have that again,
that quick edit debug build cycle within VS without leaving VS and retaining the user completely in VS for
building a Xamarin, a complete Xamarin Android native application if the need be.
Very cool. The way a traditional like.NET application would call into a C++ library would be P invoke.
Is that the same way Xamarin would call into one of the dynamic shared libraries?
Yeah, it's exactly.
I know it looks a bit weird because, I mean, on Android you have dynamic shared libraries,
but it's still a P invoke DL import mechanism.
So in your source code, you would just go and decorate the DL import
with the name of the dynamic shared library that you're trying to incorporate
into your Xamarin Android C sharp piece of code. And then you would go about your
way. So it's exactly the same thing. And again, you know, it goes back to the scenario that they're
choosing. You know, it's basically Xamarin as an extension for existing customers who were
targeting the Windows platform and want to take their app to Android and iOS. So it's just an
extension of that,
and you can see that in the semantic and the syntax of doing things as well.
So it's just a regular PNVoC, and that's about it.
I mean, you know.
Very cool.
Xamarin is becoming more popular,
but I'm sure a lot of Android applications are still written in Java too,
some of which use JNI, Collins and C++ libraries.
What sort of support does Visual Studio have for developers
working on that type of application?
So, yeah, I mean, I think that's actually a great question.
So, I mean, from our perspective, again,
just to highlight a little bit more of the question,
it's absolutely true.
Xamarin is getting more popular,
but 99% of the apps are still written in Java and some of them are written in Java and C++. So basically
what we've done today is that if you take a look at our out-of-the-box templates that
you will see under the cross-platform node, under the File New Experience, if you install
our experience, is that you will see a template for an Android native activity application.
I'm actually selecting this template because it's a template that you can actually build a
complete Android package file or an APK file, which has C++ code inside. So what we're doing
today is that we have the ability to build not only the native portion for the Android code,
but we have integration with the AntPil system
to be able to also build the corresponding Java code
that's required,
and then be able to build the complete APK
that you can actually deploy and debug
on a device or an emulator.
So while we do not provide any rich language experience
for Java, such as syntax highlighting
or, you know,
IntelliSense or refactoring,
we do provide the ability to build it.
Again, like, I mean, our current thinking,
and this could change,
but our current thinking has been that, you know,
like an ideal customer for us
is someone who has, you know, 90% C++ code
and a very thin layer of Java code.
We're thinking that this might suffice for some time.
And if we get more user feedback that people need more
of a language experience in Java, then that's somewhere
that will be something that we might consider in the future.
It makes a lot of sense to me, because if you're in that situation
where you just have a thin Java layer that you might
occasionally need to debug, you can probably stomach Eclipse to debug that Java layer every once in a while.
But getting the Visual Studio support for debugging all the C++ code
where most of your logic is going to be sounds like a really big win.
Right, and I think the other thing is that in our more recent release in CDP6,
we also introduced this new kind of template, it's a makefile template.
So one thing that's interesting for our users to probably understand is that,
you know, Eclipse Android story is basically, when it comes to native code,
it's about, you know, it's still a makefile-based approach for NDK build.
So what we've done is that we've added this makefile approach template in VS as well,
which will make, you know, you using, you know, VS easier if you're coming from E this makefile approach template in VS as well, which will make you using
VS easier if you're coming
from Eclipse makefile world.
So, I mean,
users can use that and leverage that
and if they decide that they want to go back
because they have this
thick layer of Java code,
maybe in that scenario
you could still be in that makefile
world in VS and kind of use VS for the great C++ experience
and then use Eclipse or Android Studio for that great Java experience.
I mean, for your designers and such.
So that's another thing that we've thought about.
Very cool.
Shifting gears a little bit, what about iPhone, iOS?
Most iOS apps are going to be written in Objective-C or maybe Swift,
but there is support to add C++ libraries into an iOS app using Objective-C++.
Is your team going to try to bring iOS developers into Visual Studio as well?
Right, so I think, yeah, iOS is a very important platform
when it comes to mobile computing, for that matter.
But also, you know, iOS is tricky
both in terms of its technical and legal challenges, right?
So, I mean, Android as an ecosystem is very open.
However, like, iOS has some restrictions on us
in terms of, you know, where the app needs to be built
and how to incorporate some of the headers and stuff like that.
So we are looking at experience.
So we know of a lot of apps, actually,
that actually use C++ or leverage C++ libraries
or even C++ code in their iOS application
inside of Microsoft and customers that we talk to outside of Microsoft.
So the scenario that we're thinking of is that,
think of VS being essentially a
remote or basically being an environment where you're able to write that C++ iOS library while
essentially the build and the debugging is happening on a Mac that has been paired to
your Windows machine where the Visual Studio is running. So from a user perspective, you don't ever have to leave VS,
and you can debug from VS, and you can build from VS,
but the actual build and debugging and deployment of that application
to a device or a simulator is happening on a Mac
that's been paired to your Visual Studio Windows machine.
That's kind of the experience that we're thinking of.
And again, I said that's basically similar to what Cordova does or Xamarin does today.
So if users have used that, you know, that's basically the same parallel there.
So that's an experience that we're looking at currently, you know,
and we're trying to get user feedback on, you know, if that will be useful
and more user feedback on, you know, if we can actually better this experience.
So if you have any questions, concerns, or ideas for us, you know, reach out to us, you
know, via this channel or via Rob.
We'd be happy to hear them.
But that's the story so far that we're thinking about.
Very cool.
I mean, it definitely sounds like an interesting experience to me.
Xcode is not, you know, quite as difficult to use as Eclipse, in my opinion. The debug support
is definitely better, but I would definitely prefer to debug on Visual Studio if that were
possible.
Yeah, I think Xcode is a great idea, and it does its job really, really well. I mean,
both for Objective-C and C++ layer. Also, if you take a look at the Xcode list of instruments, I mean,
you know, like the heap analyzer, that's actually pretty
great, too. Yeah, that's true.
So from our perspective, I mean, you know, again,
it's for that user who's
writing an app, you know, and trying to target
these three platforms, iOS, Android, and Windows,
we are trying to target that user
to use VS for that purpose. And if
he's using C++ heavy,
then guess what? We want them to use our experience that purpose. And if he's using C++ heavy, then guess what?
We want them to use our experience
because we think that at the end of the day,
they'll be more productive
because they're using one IDE
and the advantages of that,
and also the fact that they can share code
easily using our experience.
And those are some of the marquee features
that we're trying to talk about
as a value prop for Visual Studio
or Xcode or Android Studio Eclipse. I think we're not competing with any one of them individually, but we're trying to talk about as a value prop for Visual Studio or Xcode or Android Studio Eclipse.
I think we're not competing with any one of them individually,
but we're competing with them from a perspective that
we want Visual Studio to be a cross-platform C++ IDE moving forward.
And we want to move VS into that space moving forward
is the direction that we're going in.
So that's where we're at.
iOS is definitely in our target list.
We're still trying to figure out the exact scenario for it.
Okay.
Shifting gears again, I was looking at your profile on LinkedIn before the interview,
and I saw that you actually wrote a book about C++ development while you were still in college.
You don't hear many university students publishing books.
How did you manage that?
Yeah, that was a long time ago now that I think about it. It was like nine years ago or something.
I think, so I mean, I've had the, I should say the delight or the fascination with me is the
fact that I've actually been able to spend a lot of time growing up in different countries,
India being one of them and Canada being one of them, United States being the one that I'm currently in.
But one thing that I've seen is that when I was younger, it was not always easy for us to, at least for me, to be able to buy books that were much expensive.
If you want to buy a Dennis Ritchie book or some of the popular C++ books out there, they're kind of expensive, you know, coming from India or coming from that kind of a country background.
So the purpose of me writing this book was to basically, you know, it's written for people who are starting into C++, you know,
and learning about C++ as a language,
and then advancing to some of the advanced features like data structures
or, you know, file manipulation or being able to leverage JDBC
or other popular ways of accessing databases and stuff.
The purpose here is for information being available cheaply.
And so the price of the book, I think it was marketed at $10,
and it's always been like that.
And the purpose of that is basically for it being available for people
who find it a little bit harder to be able to leverage more expensive titles out there.
And at that time, the world was a different place 10 years ago.
So internet and resources weren't as easily available.
So that was the idea behind it.
I think it did okay.
But I'm not sure if I would actually consider writing another book in the future
because it's a lot of work.
Sure, I would imagine.
It must be a lot of work, especially when you're still in university,
still studying.
Yeah, it was work, but it was exciting, and
I think it's good, and
I think I'm happy I did that because
I think other people don't have to go through the same
struggle, hopefully. Hopefully the book's good enough
for that purpose, so yeah.
Awesome. Well, anything
else you want to talk about on the show
before I let you go? Any maybe big Visual Studio announcements you want to make to the audience?
I think the biggest announcement that I think we have from the Visual C++ team is definitely the cross-platform story.
I think it's a very interesting space for C++ again and people who are using C++ just by the economics of what's
happened, you know, in the mobile platform. It just happens to be C++ is a core language on all
the different, you know, important platforms that are there in terms of mobile. And, you know, the
work that we're doing here is interesting for that perspective. So I'm excited as a C++ user to see
that. And, you know, I'll be more excited when people actually try out our experience and give
us feedback on things that we can improve
or features that we're missing.
If you're a CLion user now
or if you're an Eclipse user now
for C++, on things that we can
do for you to move you to Visual Studio
would be interesting. I think I would just
end with that probably, Rob.
Sure. Maybe one thing to point
out is all
of this is available in
Visual Studio 2015,
which you can currently download for free,
and will be available
in the Community Edition, right?
That's right. So it will be
available. We haven't backported this
work in the Visual Studio 2013 Community Edition,
but the cross-platform mobile
story will be available in the
VS 2015 Community Edition
for C++. That's true.
Very cool. Well, thank you
very much for joining me on the show, Ankit.
No, thank you. And again,
great to hear from you again. So I hope
I get a chance to talk to you guys
again. So thanks for the opportunity, Rob.
Thank you.
Thanks so much for listening as we chat about
C++. I'd love to hear what you think of the podcast. Please let me know if we're discussing
the stuff you're interested in, or if you have a suggestion for a topic, I'd love to hear that
also. You can email all your thoughts to feedback at cppcast.com. I'd also appreciate if you can
follow CppCast on Twitter and like CppCast on Facebook. And of course, you can follow cpp cast on twitter and like cpp cast on facebook and of
course you can find all that info and the show notes on the podcast website at cppcast.com