149 iPS Xamarin and The Evolution of Interactive C# with Miguel de Icaza

00:00 0:39:44
Download MP3

This episode was recorded live from The Microsoft Build Conference 2016. In this episode we chatted with Miguel de Icaza of Xamarin and the evolution of Interactive C#. You can follow him on Twitter, see what he’s done over on GitHub, or visit his blog.


**[This episode is sponsored by Hired.com. Every week on Hired, they run an auction where over a thousand tech companies in San Francisco, New York and L.A. bid on iOS developers, providing them with salary and equity upfront. The average iOS developer gets an average of 5-15 introductory offers and an average salary offer of $130,000 a year. Users can either accept an offer and go right into interviewing with a company or deny them without any continuing obligations. It’s totally free for users, and when you're hired they also give you a $2,000 signing bonus as a thank you for using them. But if you use the iPhreaks link, you’ll get a $4,000 bonus instead. Finally, if you're not looking for a job but know someone who is, you can refer them to Hired and get a $1,337 bonus as thanks after the job. Go sign up at Hired.com/iphreaks]****JAIM: Today on our panel we have Andrew Madsen. ANDREW: Hello from Microsoft Build in San Francisco. JAIM: My name is Jaim Zuber. I’m also from San Francisco. Today we’ve got a special guest. We’ve got Miguel de Icaza. You want to say hello to our listeners? MIGUEL: Hello everybody. This is Miguel de Icaza and I’m visiting San Francisco for the Build Conference. JAIM: Okay. ANDREW: Why don’t you tell us a little bit about yourself, Miguel? I think a lot people know who you are. MIGUEL:**Okay. Well, lately I’ve been doing tools for [inaudible] developers to target iOS and Android. iOS is really where my heart is— just for guys— for those that don’t know. But before I used to be a Linux contributor I worked in the GNOME desktop, working on the—the mythical Linux desktop for many years. I always said the Linux desktop is around the corner but you have a Linux desktop, it’s a running joke in the community. So that didn’t happen but very good technologies came out of this. One of those was this cross platform .net runtime, Mono, and that is what powers our product .net on Android and .net on iOS. This week at built— it’s got gone three. First, keeping [inaudible] wait for free to everybody and second, he open sourced it. So for the last couple of years, I abandoned my roots of an open source guy and I was doing for proprietary work. Now, it all goes back to the open source world.JAIM: It’s quite the arc from a person to know – “nome” or “gnome”? MIGUEL:[Crosstalk] Well, in Spanish, they say “gnomé”.**ANDREW: It’s good news. So GNOME, right? MIGUEL: Right. Exactly! ANDREW: That’s quite the arc from the open source to Linux desktop stuff in the 90’s to being a part of Microsoft right now. MIGUEL: That— yeah— that’s right. I used to see them— the board of the three software foundation. So yeah— it’s a little bit of a tour. ANDREW: Well, I have a lot that I want to talk you about. I think the first question that comes up when I hear your history is, “Why as a Linux guy, somebody who’s working on GNOME and free software and just Linux in general, why was C# – why was .net something that was interesting to you? MIGUEL: That is a great question. So what happened was we were building— we built the GNOME desktop and the GNOME desktop was built in C and the challenge that we faced was C is a low level language. You spent a lot of time chasing memory bugs and memory corruption problems and leaks. The productivity is very low. So very early in this history of the GNOME Project, we were influenced a lot by who at that time was the Messiah of Scripting Languages, John Ousterhout. This is before JavaScript is even a thing. So he said, “What we need to do is erase the programming level.” He had a scripting language called Tcl. I don’t know if you guys remember this Tcl— JAIM:**Yeah [crosstalk].**MIGUEL: —and had a UI interface called Tk. People built apps in Tcl Tk. The productivity unit was amazing! So we always believe in this vision of raising the programming level, write less code, be more effective but the problem when we’re writing Linux desktop is this is happening the year 1999; 1997 is when the project starts; 1998, I don’t even remember the machines that existed at that time. They were not that powerful. ANDREW: No. MIGUEL: A beefy machine, a beefy desktop at that time had 16 megabytes of RAM— JAIM:**Yeah. Pentium three [crosstalk]. That kind of [inaudible].**MIGUEL: Exactly! So C really was what you had to use back in the day. You could use other things but then that was the only process that you could run. ANDREW: Right. MIGUEL:**You would run the clock in your desktop and then that’s it. You’re running a clock. So what we’re looking was a blend of erasing the programming level but also keeping the performance of the system in place. This is where things like Java wasn’t quite there. It was very good but it wasn’t quite there; .net was coming off and they had essentially fixed a few issues with Java. Now, the problem that Java had at that time for open source was that there was a free implementation that some give away for free but the open source community fundamentally couldn’t adopt it because it wasn’t open source. And because there was this thing available for free, there was no motive or desire to rebuild it from the ground up. So we had no viable free open source Java implementation because there was a propriety free version. So essentially as an open source movement, we were left in a place where Java fulfilled their needs but didn’t have a viable option as a full open source stack. So .net comes at this point in time; they’re coming and say, “We fixed some design mistakes in Java, you get the higher level of productivity, just raising the productivity level that Ousterhout had been advocating for years.” Also, it’s very fast; we’re legit [inaudible]. It’s going to be very good. So that’s where we started building; it was purely based on our needs, on years of pain, debugging crashes, memory corruptions, leaks, just frustration.**ANDREW:**Okay [crosstalk].**MIGUEL: That’s what we did. JAIM:**Yeah, definitely [crosstalk]. That was a desktop developer doing C++ apps for years and just going to C#— wow! I don’t have to deal with all these things that memory [crosstalk], things like that.**MIGUEL:**Yeah. And life is too short [crosstalk]. Life is too short to be [inaudible] these stuff, right?**JAIM: Yeah. MIGUEL: There’s a time and a moment – it’s just not for general purpose computing. ANDREW: I think it’s interesting that you— so I didn’t know any of this history. I didn’t know that project went back that far and the fact that you— Java didn’t work for these reasons you’ve explained is interesting. One thing that’s funny to me is that, especially in the early days, Java was sold as a cross platform solution. That was part of the magic of Java. You build your app, you compile at once and then it would run on any system that had a Java VM. C# works similarly. You have that the .net run time and CLR and whatever but it really has not been a cross play. It was not a cross platform language; it was Microsoft’s language until Mono and Xamarin came along. MIGUEL:**Right. We started Mono project in 2001. We had a Git compiler within a year. So we had a self-hosting system within a year and that included a seizure compiler written from the ground up in C#. We’re very proud because I think that the first build when we only had an interpreter, our seizure compiler would take 5 or 6 minutes to build itself? It was 10,000 lines of codes and within a year we got it down to 3 seconds. So the compiler— the C# compiler would [inaudible] itself, compile itself and generate itself in three seconds.**ANDREW: Wow! JAIM: Crazy, yeah. MIGUEL:**Now it’s down to one second. Of course, it’s mostly harder to that [laughs].**JAIM: But she’s gotten faster. MIGUEL:**Yeah. She has gotten faster but [crosstalk].**ANDREW:**It’s impressive [crosstalk].**MIGUEL: It’s a— so it did deliver on the promise. The JIT was one of the design decisions that Microsoft made was the instruction set actually had things that you could leverage to make a faster JIT. So we did that. It was amazing that we, a team that never built a compiler before— I’ve never written a compiler before. The people that were helping me and the team, we used to lay out dialogue boxes. That was our thing but did GNOME and it’s like, “Well, this okay button should be maybe to the right and this. The proportions are wrong. The function bigger and next thing you know we’re building GCs and JIT compilers. So it was amazing because you could build that in a year. ANDREW: Well that— yeah. So you may not have done it before but you were smart. You have— you had a smart team. MIGUEL: I guess that’s— well, we were – I don’t know, I like to say that a lot of it is just putting the effort into it so what more of a – we stick over applications on that. ANDREW:**Right [crosstalk].**MIGUEL: So we can have had to deliver. ANDREW: So it’s either do this or flame out. MIGUEL:**Yeah [crosstalk]. Oh yeah you have a big mouth so we’re going to do it. It was, I think, that was the main driver.**JAIM: So one thing— so in .net they have got— the implementation of the observer pattern is an event. What’s involved to taking that and making it one of Linux? That type of thing? MIGUEL:   Well, that was interesting. The way that we— at first the .net framework back then was a lot smaller. Also, Microsoft had submitted the basics to a standard particle, ECMA then it became an ISO standard but we had to work from the specs. We had to work from the public specifications. So whatever wasn’t the documentations, what we implemented and it was mostly okay until you realize quickly that the documentation doesn’t always necessarily reflect the implementation. So a lot of Mono was developed through docs but also through bug reports. So people would say, “This is broken.” “Well now, we do what the specs says.” It’s like the specs is wrong. So it’s basically clean room implementation about that from the ground up. There’s always been this historical differences between Mono and .net because our implementation was based on the docs. Whatever Microsoft showed in blogs, there was a period in history when— where everybody blog – and I remember this time, the era that 2003, 2007, blogs were big and we derive so much value out of people blogging. Blogging has taken a hit in recent years. But there was the Golden Years of blogging. There was so much public information about every element of .net that you could learn about and that’s how we built it so it was documentations, blogs and bug reports. JAIM: So is the code C++? MIGUEL: C#. The runtime or the virtual machine is written in C, only C. JAIM: Okay. MIGUEL: We had a fundamental C++. JAIM:**You love it or you hate it [crosstalk].**MIGUEL: Yeah. JAIM: A lot of people hate it. MIGUEL:**I’ll use C++. Now I think that there’s better idioms, practices and things like that that runs C++ but I just felt always that C++ was a very large and complex language and not a lot of the complexity was easy to understand for newcomers. So we went with C for the run time because it was a language that everybody could understand. It was very easy to pick up. There is really nothing happening behind the scenes. When you see a statement—that is what it is. There’s really no magic going on there. So if there’s magic, you can see it. This is how we do the magic and it’s in line. It’s not— [crosstalk].**JAIM:**You knew exactly what’s happening, yeah [crosstalk]?**MIGUEL: Exactly. So we write— we wrote the VM in C and everything else is C#. JAIM:**Okay. So low level stuff VM [inaudible] C. I’ve heard C being called C++, the good parts.MIGUEL:[Laughs] Yeah. I have to say, to be fair I think C++ has evolved tremendously. It’s a more complex language but at least they’ve surfaced now new idioms that do not require you to go down to this ugly currencies, ugly neighborhoods of C++. So at least it’s a nicer language developed with [inaudible]. I even enjoy writing a little bit of C++.**ANDREW:**It has certainly gotten better [crosstalk.]**MIGUEL: Yes. ANDREW: I want to get to— so our audiences are mostly iOS developers. MIGUEL:**Yes [crosstalk].**ANDREW: And a lot of— certainly all of the announcements yesterday were around cross platform development for iOS and Android. So you’ve been— this is what Xamarin’s been about for a long time? MIGUEL: Yeah. ANDREW: But I’m curious to know what you think the Microsoft acquisition and the announcements that were made yesterday. What are the changes – good changes – that are in store for mobile developers because of those? MIGUEL:**Well, so to me the most interesting thing is Xamarin was a great technology because— I know that I sound terrible saying that my proto was great but it was a great technology because it allowed to people to focus on the problem. Garbage collection to me has always been something that solves problems for people. Strong typing which also an iOS has now with Swift. I’ve always been a very strong advocate of strong typing of generics, strong collections, all these things. When we surfaced iOS APIs to C#, we strongly type every single one of them. So our value was we’re not going to give you just iOS. We’re not going to surface NS dictionaries. We have an implicit conversion that gives you that if you want but we weren’t going to give you strongly typed things. So when you configure [inaudible] of some system with AV foundation, you don’t pass the dictionary and you don’t have to figure out the magic keys and the magic values for each one of those. We’ll give you a strongly typed object that says, “The number of hertz, it’s going to be afloat.” It’s a property that you said and you get code completion. You don’t have to look up anything in documentation. We did [inaudible] before Swift did it. We did all these things that we thought were a projection of iOS into the stronger, stricter typing system of C# and F#. So that was our value and we made a lot of people happy. I was happy to use this API. I always preferred it more than the loosely typed APIs that iOS had. So that was our value.**JAIM:**We should probably step back a little bit because you went from Mono which is the desktop technology [crosstalk].**MIGUEL:**Yes [crosstalk].**JAIM:**Maybe a website [crosstalk] and now it’s running on the iPhone which was [inaudible] things. We can’t – most for audience probably knows what’s happened but that was a big step. You’re getting things [crosstalk].**MIGUEL:**Yeah [crosstalk]. We turned .net into a static compiler which nobody had done before. So we make .net effectively create static binaries with no JIT compiler for iOS. So essentially it still use C# but what you end up with is native code. And if I— you can use a fast development mode where you still use Mono’s code generator, or you can use a slower but high quality optimizer in LVM. So we just hand out the code to LVM the same way that Objective-C does. So you get to use high level APIs and it still goes through LVM and you end up essentially with the same performance.**JAIM: And when was – Xamarin now, it was MonoTouch. When did MonoTouch come out? MIGUEL: Mono touch— we launched the product in 2009. JAIM: Okay. This was around the time of iOS 3? ANDREW: Yeah. iOS 3 came out in 2009. MIGUEL:**It’s NOW a little blur. It’s a blur when they came out but [crosstalk] it sounds about right.**ANDREW: iOS 2 is the first one with an STK in 2008, then 2009, iOS 3. MIGUEL: Yeah. We launched in September 2009 so whatever was the thing around that time is what we added. JAIM:**But thinking it like C# is language compared to what Objective-C was back then? Objective-C’s grown a lot over the past [crosstalk]**MIGUEL: They even add a generics recently – last year so we’re very happy with this. ANDREW: That was before Objective-C had arc so it was manual reference counting. MIGUEL:**Yes [crosstalk].**ANDREW:**Properties [inaudible].**MIGUEL:**Well, that’s right. That’s right. We have all this things but to me, what is important about— but one thing that happened is we were a startup and we were self-funded. When we launched the project, there’s a hole in the acquisition. They took a private, complicated matter but essentially we licensed the technology from [inaudible] in 2011 and we are self-funded. It’s me and Nat are paying the bills for these. We’re trying to keep the team from falling apart because [inaudible] laid the whole team off. So we’re trying to keep them together, trying to get a few contracts to bootstrap the company. What happen is that we had a viable product but it was a very expensive product. Pricing— that was a complaint for years. Xamarin is a great technology but it cost a thousand dollars of platform for the professional version. We had a lighter version for 200 dollars. So Xamarin was a great technology but always a niche technology because only people that said, “You know what, I’m going to take this very seriously. I’m going to put down the money. I’m going to go all in with Xamarin, would pay those kinds of bills.” It’s about thousand dollars per developer. I have 10 ten developers. It’s 10,000 dollars a year. So as a startup, we were doing – we couldn’t afford to not charge and we did very well. We grew the company from just me and Nat to, I think in the time of the acquisition, 370 people roughly?**ANDREW: Oh, wow! MIGUEL:**Plus QA that I’m not even counting. So we’ll outsource QA that we have. But we have to charge. We have to charge for the proxy. So it was essentially a niche product. People that could afford it are banks and insurance company then all these people with a lot of money could pay for the product but more of the indie guys always struggle with this thing both on Android and on iOS and we do the same thing with [inaudible] by the way giving strong types and all these things. So yesterday’s announcement – going back to your question, yesterday’s announcement to me is huge because I’ve always struggled with how do we make this accessible to more people but pay the bills? Now that we’re part of Microsoft – Microsoft essentially wants more developers using their tools and they’re able to afford to give this away for free. Not only to give it away for free but to open source it. So that’s all my stuff is going open source in the next couple of weeks. That’s all of it.**ANDREW:**That’s the crazy thing is that this new Microsoft that does open source. Here comes open source Linux guy joins Microsoft. [Laughs] Microsoft is the one that gets it— that makes it so you can open source your stuff.**MIGUEL:**That’s right [crosstalk]. [Inaudible] told me that. It’s like – he came to me and he said – and you know, with what [inaudible] has gone through, his [inaudible] is blurred. It was like, “[Inaudible] can’t afford it. You’ve been pushing us to do open source for years and there you go. You build this proprietary thing then we have to buy it from you to open source it.**ANDREW: So I watched the Keynote yesterday and I thought your demo was, as an iOS developer, you’re demo was my favorite part of the Keynote. MIGUEL: Oh, thank you. ANDREW: Even just seeing somebody build an iOS app on a Windows machine at a Microsoft Conference in a Microsoft Keynote was pretty incredible. I think some of the stuff you showed was really cool and I wanted to ask you about it. One was you now have – in Visual Studio, you now have the iOS stimulator. MIGUEL: Yes. ANDREW: I think being reflected from a room. MIGUEL: That is correct. Yes. ANDREW:**But you even have some things about that simulator experience that are better than what you get on a Mac [crosstalk] in some way.**MIGUEL:**Yeah [crosstalk]. It got a little better. I have to show the one thing that we’re better which is the touch support [crosstalk].**ANDREW:**Talk about it because I had a radar for multi-touch support in the iOS simulator for 5 years or something. [Crosstalk] I don’t know.**MIGUEL:**Right [crosstalk]. Exactly, so because we’re running in a surface and you’re shipping machines with touch screens, you can actually adjust your fingers to this. I would love it if Apple had touch screens because that’s my main desktop. I’ll show you my laptop is right there. It’s— I use a Mac, that’s my main machine and every once in a while, I would like to picture the screen. I use an iPod.**JAIM:**I do it all the time [crosstalk].**MIGUEL: I would like my Mac to behave like my iPod. JAIM:**It’s not like [Inaudible] my Macbook Pro like, “What am I doing?”**MIGUEL:**Right. So when we put this step – when we wrote the simulator to be forward it from the Mac to Windows, it was – on Windows, it’s becoming ubiquitous having touch screens. There are pro’s you have touch screens. The con is you have fingers everywhere. Greasy fingers on the screens but as much as yeah— but that was one of the things that we surfaced. We’re able to do that and we’re proxying all kinds of other sensors as well to the simulator.  So we can send the location back to the [crosstalk].**ANDREW:**That’s cool [crosstalk]. So you must— I want to ask a little about how you do this. The iOS simulator on the Mac does support multi-touch; it’s just not with your fingers.**MIGUEL:**Yeah. [Crosstalk]**ANDREW:**So you must be maybe [crosstalk].**MIGUEL:**I would love to tell you but I don’t know how it works. I have a team of very talented engineers that work on this. I would love to take credit for that but it’s Alex [inaudible], it’s Alan McGovern, it’s Eric Muffin. My contribution, to be honest, has been that I can [inaudible] a little bit too strong to the right. So I would like take credit but I don’t know exactly how—I know sometimes I participate in discussions about how we make it faster and right now we’re trying to tweak how we send the frames back to Windows or basically sending a bunch of images. We tried h264, the lightest to that so now we’re using jpegs. You don’t get the artifacts when you lose a frame. So right now we’re trying to optimize that because for small simulators it’s great but iPod Pro—**ANDREW:**Yeah. That’s a little difficult [crosstalk].**MIGUEL:**That’s not so great because that thing is huge. We’re looking at the [inaudible] sending that much regions and how do you optimize? Maybe you send lower resolution, poorly encoded on a first frame when it’s animating and when you stop changes, you send high quality. So we’re trying to tune that and I would like to take credit for helping a little bit there. Throwing ideas but [crosstalk].**JAIM: So how is the simulator developed? Is that actually running a Windows app on the simulator? MIGUEL: Well it’s a WPF app on Windows. It’s connected through SSH to the Mac. We’re actually running the iOS simulator on the Mac. ANDREW:**Okay. So you have to [crosstalk] have to have a Mac?**MIGUEL: It’s just forwarded. Yeah, you have to have a Mac and you have to have the Xcode installed and that’s a real— we’re forward and we’re just forwarding your screen over there and we make it transparent. That’s all. The magic of how we— how they do it, I don’t know the details. JAIM:**Okay [crosstalk].**MIGUEL: But I can look them up. JAIM: That’s been a case for a while. If you do Xamarin, you can develop on to your Windows box Visual Studio but there’s a Mac somewhere. MIGUEL:**There’s always a Mac [crosstalk] Even the designer; when you’re using the designer it’s also connected to [inaudible].**ANDREW:**I’m interested [crosstalk].**MIGUEL: Because what we do is we run – the designer’s actually running in the simulator because what we allow is we allow you not only to add regular controls, UI views and all the Operating System controls into the surface but we allow you to write your own subclasses. For example, you’ll create the “My color label” which is a subclass of UI label and it appears in your toolbox and you can drag “My color label” into the design surface and it shows. And you can change the property of life and it will be reflected. In fact, we showed this at our conference a couple of years ago then Apple took the idea. So I’m happy to say that Apple took one idea from us. ANDREW: That’s cool. JAIM: Now what if – most of our listeners are probably not running Windows boxes. How do you develop in C# on a Mac? MIGUEL: Oh, on a Mac we use— we have this—  that’s what I do by the way, I develop everything on a Mac. In fact, if you went to my session yesterday was all Mac. JAIM: We noticed. MIGUEL: Except the time when I had to bring on of my engineers to bring his Windows PC to show the Windows side of the house. But you use an IDE called Xamarin Studio. Xamarin Studio is really— it’s the Mono developed open source IDE which is written in C#. We’ve added the Android and iOS extensions. So it’s— so we contribute to Mono developed; it’s an open source IDE. We just add this two proprietary pieces— Android and iOS. So it’s the thing that connects the simulators, builds Xcodes all that stuff. So it’s just the open source stuff. ANDREW:**You’ve also— part of the announcement yesterday was that Xamarin Studio for the Mac. The community addition is free, completely free [crosstalk]?**MIGUEL: That’s right. Yup. ANDREW: And I think now can build for iOS and Android, right? MIGUEL: That’s right. It’s always been able to do iOS and Android. ANDREW: Okay. MIGUEL: On a Mac, you can do iOS and Android. You’ve always been able to. ANDREW:**Okay [crosstalk].**JAIM: So what are the limitations with the community edition? MIGUEL:**Okay. Let me see what I can remember. Due to Microsoft’s—I don’t know everything exactly right. Community edition is an edition that can be used for education, open source, training, or small companies. So I think that there’s a very small company and make less than some millions of dollars per year, you can just [inaudible]. But if you’re a company that is making more than some— I don’t know how many. I don’t know what the number is. Then you have to buy it professionally.**JAIM: Okay. Is it limited some way? MIGUEL:**No [crosstalk]. It’s a EULA. It’s a gentlemen’s agreement enforcement.**JAIM:**Okay. So there’s no limit on your app size. There’s no [crosstalk].**MIGUEL:**No [crosstalk]. Well yeah. Those are things that we did as a startup that were [crosstalk].**JAIM: Okay. MIGUEL: Just as a startup, life is rough, I have to say. JAIM: You got to pay the bills? MIGUEL: It’s very rough. I have to say, it was five years of fear. You wake up every morning in fear about customers. Did the customer switch? Is the customer happy? Do we have a problem? Is there a security attack on the wild that you need to patch? Running is terribly—it’s a lot of stress and they were dancing with giants. You got Facebook over there, Microsoft and Apple and Google. So you’re a little ant and these elephants are in the room moving. Then they’re going to step on you at some point. So it’s very stressful guys. ANDREW: Well it worked out. MIGUEL: Oh, it did work out. Yes. So I have to say I’m living calmer now. JAIM: W ith the new pricing, this opens up Xamarin for a lot of smaller companies and startups. MIGUEL: Right. JAIM: Now, one of the programs Microsoft does is it fuel – their technology is this part. MIGUEL: Yeah. JAIM: So if you’re startup and you’ve got a small team, you can get Microsoft tools for a year. Is that what included in that? MIGUEL:**Yes, it’s included in that. So Microsoft has a bunch of programs and we even participate in some of those before we joined. There was a joint agreement pricing very complicated structure but we have one for students and they have this thing for students called Ring Spark, I think, something like that. So we have that program with them. There’s this other student bundle that is given to universities. We’re also part of that. Then there’s base part which is you essentially, not only get the [inaudible] but you get the full feature enterprise, everything – thing as a startup. We’re also part of that.**JAIM: That’s cool. MIGUEL: That’s where we always struggle with them because when we include Xamarin in our edition like, “Sure just the license.” And like, “Oh, no we want you guys to pay the bills.” “No, no, can’t do that.” But now they can. JAIM: Ironically, I got into an iOS development with a startup doing Xamarin so I was a .net person for years and years. MIGUEL: Oh really? Okay. JAIM:**And I got tired on. I thought I want just some backend work for them, further [inaudible] iPhone app and I’ll buy an app. I’ll buy a Mac if you let me work on the iPhone app. They’re like, “Okay.”**MIGUEL:**Wow [crosstalk]! Okay.**JAIM:**That’s how I got into iOS development five or six years ago. But so [crosstalk].**MIGUEL:**So I got chained into iOS development [crosstalk].**JAIM: You personally? MIGUEL:**Well this is a very [inaudible].**JAIM: This was— this is right before – you’re still part of Novell? MIGUEL: Yes. JAIM:**I remember at that time if you want to integrate with a native library, there’s no way to do it. [Inaudible] and I found a script that one of your teammates sent them. Some of the Novell gave a script and I found it on a forum [crosstalk].**MIGUEL:**It was probably [crosstalk] I know who probably did it. It was Jeff Norton who’s an amazing developer. He is now at Sony.**JAIM: Okay. MIGUEL: Computer corporation, computer entertainment or something but yeah okay. Wow! JAIM: That was very cool. MIGUEL:**That is very nice [crosstalk].Very nice to know.**JAIM:**Yeah. So doing— not having to learn Objective-C was pretty useful because coming from [inaudible] like Windows desktop [crosstalk].**MIGUEL:**Of course [crosstalk].**JAIM: Backend stuff and learning just to framework stuff is hard enough. MIGUEL: Oh! What a great story. I can’t believe that. Okay. JAIM: I already knew C# and I was a decent C# developer. I’m learning this all – what’s a view controller thing? MIGUEL: Yeah. JAIM: What are these views that are nibs interface builder? What is this stuff? That’s one of the things I see. A lot of excitement especially in the .net community, “Oh, I don’t have to learn Objective-C.” MIGUEL: Yeah. JAIM:**There’s fear of brackets and a lot of developers [inaudible].**MIGUEL: I don’t know that it’s scary. It’s just cumbersome. It’s like going back to C++, “Heavy files, why do I have to type these twice? This is— it’s 2016. There’s got to be something better. Luckily Swift does that stuff like that. It’s a modern language but yeah it’s 2016. Like I said C++ is better but still it’s 2016. ANDREW: Yeah. MIGUEL:**Yeah. It’s come on [crosstalk].**JAIM: When I started doing native element, I was pretty taken aback by how much stuff was not in the language that I used to. MIGUEL: Yeah. JAIM: C# like query this stuff, iterate on things, maps, lists and stuff like that. MIGUEL: Yeah. This is cold work stuff. The cold war is over. JAIM: Yeah. MIGUEL:**We deserve better [laughs] languages.**ANDREW: Yeah. JAIM:**That was the point [crosstalk]. Now with Swift, we have a lot of those things that I was missing in Objective-C.**MIGUEL: Yeah. ANDREW: So why is C# still important in the Swift world? MIGUEL: Well the most important thing— well there’s two pieces. One, you have existing code and Microsoft have a lot of existing customers. They want to reach other platforms. So there’s certainly that angle. The other one is that— although Swift has great, great ideas that I love. I love many of those ideas. It’s still a language that is evolving. In fact, I would say that if you look at the history of C#, when C# came out they launched the beta in 2000? Or late 2000 of .net. ANDREW:**Yeah [crosstalk].**MIGUEL: And they had that thing brewing in public for about four years. It didn’t become .net 1.0 in 2003 or 2004. So there were four years of the development public where they broke APIs. They change the language. They made updates because you can get a system of this complexity right on the get go. So C# 1, when it came out, it was stable and they kept it stable and the API stable up until now. With Swift, they took a different approach. They launched the language and they called it 1.0. ANDREW: Yeah. MIGUEL: Then 2.0, 2.1, 2.2 and 3.0. ANDREW: It breaks things. MIGUEL:**Right, so I think marketing wise it was a good move but the reality is that when they launched C# first, it was ‘hey, here’s a preview’. This is not 1.0. We’re going to be breaking things until [crosstalk] it’s a 1.0.**ANDREW: Yeah. So in some sense, right now Swift is not even quite 2 years old yet and its where C# was in its evolution in 2002, 2003. MIGUEL:**Right. So that’s one element. We have existing customer and you want to bring them to iOS or people would experience C# and you want to reach out to iOS. The second thing is you want a share code across platforms. There’re many ways of sharing code. You can use JavaScript. That’s a very viable option. People do that for [inaudible] email surfing. You can use C or C++, Dropbox or Facebook or somebody wrote a big blog post, “Here’s how we share code; C++ then we plug UIs everywhere.” Also very viable. Or you share with C#. So it’s really a matter of what language do you want to use to share code across platforms. Different things will work for different people. I’m sorry for the guys that have to use C++ because we already [inaudible] that horse but if that works for you, that works for you. So this is for the group of people that chosen C# and I am still terribly excited about C# not only because of what it has but because it’s a language that hasn’t stood still. I think this is a new trended language design. It’s not limited to C#. I think Swift has it; I think [inaudible] has it. I think that we’re all now in this new mentality like C and Python were frozen for so many years that we thought that languages were static. Now, this new generation of languages are revised constantly.**JAIM: Yeah. It’s almost like we can’t just learn one language. MIGUEL: That’s right. So you get generics, you got iterators, this state machines that the compiler injects state machines. They got dynamic and then they got— C# got async programming which I think is a gift of the gods. When you can await operations and the compiler rewrites your code behind your back so that it becomes a state machine. Then you know don’t ever have blocking code. You don’t ever have to do call box. You don’t ever have to— this call back hell thing. ANDREW:**When I talk to C# developers and I say, “What’s your favorite thing about C#?” Async/Await is some [inaudible] bring up all the time.**MIGUEL: And I have to say, Async/Await is destined to be on every language. JAIM: Let’s explain what that is. Most of our listeners are not going to know what this feature is. MIGUEL: That’s right. JAIM: So what is Async/Await? MIGUEL: So Async/Awiat, the way to explain it very simply is imagine that you have a blocking operation. So let’s say that you want to download some data from the network. The user types in his log in and password and presses some button or – no, that’s not a good idea. The user pulls to refresh. What you want to do is download the data then update the user interface. Now, usually what you do when this situations is you spawn a thread or a background activity to download the data so that the UI doesn’t block. So what you want to do is immediately return control to the main look. So the user pull to refresh, you invoke a method and you say, “Okay. I’m going to start a thread to download this stuff.” When it’s done, I‘m going to involve this call back. In the meantime, you can still deal with your UI. So that’s a way that you program it. It’s very simple. In this scenario it just one call back. Now, in more complicated scenarios, you have one call back followed by another call back as you chain these operations that you don’t to ever block, right? ANDREW: Right. MIGUEL: It’s very probably – note that you have this things where you program to the right. You keep programming towards the right as you have call backs. So what I think Await does is that instead of writing your code in a way where you provide call backs, when you have this pull to refresh, for example, you just say, “Await the download.” Then you immediately you say, “No, parse the data, then populate the data.” So you write code very linearly the way that you did before UI programming coming to Bing like in the good old days of Basic. Then print, “Hello 20 go to 10.” ANDREW: Yeah. MIGUEL: It’s linear programming. Every time the user – the Await keyword, what the compiler does is it rewrites your code into a state machine where it fires off the background operation. When it completes the call back, resumes execution at the next instructions. So every time you have Await, you have to think this method suspends, returns control to the caller and when this operation completes, you will resume operation here. ANDREW: Cool. MIGUEL: So you spring Await to your code. You still can reason about your code. You can have for loops. You can download multiple feeds in a fore loop and you just await them. ANDREW: Yeah. MIGUEL:**You can handle errors, you can do try patches. You can patch exceptions. You can gracefully handle errors in a natural way. You can see if this error happens [inaudible] as oppose to call back over there. You handle the error then you set some state so you can bubble the error up or bubble the error down.**ANDREW:**Yeah [crosstalk].**MIGUEL:**You have to control flow by managing call backs and things. If you go to [inaudible] era. So await basically removes this whole thing of a call back. So you eliminate them. They’re gone. You program linearly.**JAIM: So that’s very powerful. For app developers, we’re always getting things off UI thread. MIGUEL: Yeah. ANDREW: Think about how many times you’ve programmed to the right with Grand Central Dispatch. MIGUEL: Right. No, the good news about Async/Await and the existing C# today – but Async/Await will come in to every platform. They’re coming to every language. JavaScript is getting that, C++ is getting it so it’s a matter of time for these new— now we understand, as the language community, now we know how to do it and we’re going to get it everywhere. ANDREW:**Yeah. I know [crosstalk].**MIGUEL: But it was pioneered by C#. ANDREW:**I know for Swift, they have said they don’t— they’re not ready to nail down the async model until Swift 4 or something. [Crosstalk]**MIGUEL:**Yeah [crosstalk].**ANDREW: It’s going to come but it’s not yet. MIGUEL: It needs some thinking. Also, C# is learning from Swift. There is a lot of very nice features from Swift that are getting added to the language. It’s like, “Oh, topples. Well maybe we should have that as better syntax for that.” So the new version that they just launched here has that feature. They’re adding pattern matching. F# always had it and now the— C# was always like, “Nah. I don’t know about that.” Then Swift showed, “This is how you do it elegantly,” so C# stole the design. So it’s just that convenient way of sharing code. There is a way of keeping your existing code, your existing expertise, your tools, your things and I personally love C#. I think that the language team is evolving it a nice way. I wanted to see it everywhere. So I’m going to keep pushing this puppy as long as I can. ANDREW:**I think we keep talking here forever because I’ve got a lot more questions. But we have another [crosstalk]**MIGUEL: Understood. ANDREW: Another person in line up and I think you probably have other things to do, too. MIGUEL: It’s a pleasure talking to you guys. ANDREW: Is there anything else we should cover? MIGUEL: No, I think that’s it. I think it’s a good chat. JAIM:**So if— so I ask questions from [inaudible] people like, “Hey I’ve got going Miguel on the show; what should I ask him?”**MIGUEL: Yeah. ANDREW: One thing they want to know if you’re currently a subscriber. Do you get to do anything? Do you get the free version? MIGUEL:**Yes, because there was – it was released in two stages because we— they had announcement on the first day and the second day and we’re part of the second day announcement. All you have to do is [inaudible] your Xamarin update. So in Visual Studio, Xamarin tools, Options, Xamarin update. You’ll get this or if you install Visual Studio Fresh today or you do repair installations, it will update to this edition.**JAIM: Okay. Great! Well, let’s get to the picks. So for the build shows we’re not doing our own picks. So we’ll just say do you have a pick for us? MIGUEL:**Oh, well, very personally I like to play with my kids [laughs]. But if I had to personal I think that I could recommend – I love going to King Kong. I really like King Kong as a vacation destination.**ANDREW:**The thing I get from that is don’t spend all your time programming [crosstalk]. Take time play with your kids.**MIGUEL:**Which is the beauty of high level languages like C# [inaudible]. Spend more time with your family [laugh].**JAIM:Now we’re talking [inaudible] issues, you’re play with [inaudible] on the swing or [inaudible] some pointer problem.ANDREW: Okay. Well, great. MIGUEL: Thank you very much guys. JAIM: Thanks. MIGUEL: Alright. I appreciate it JAIM: Thanks for coming unto the show. [Hosting and bandwidth provided by the Blue Box Group. Check them out at BlueBox.net.]**[Bandwidth for this segment is provided by CacheFly, the world’s fastest CDN. Deliver your content fast with CacheFly. Visit cachefly.com to learn more]

Sign up for the Newsletter

Join our newsletter and get updates in your inbox. We won’t spam you and we respect your privacy.