071 JSJ JavaScript Strategies at Microsoft with Scott Hanselman

by woody2shoes on August 16, 2013

Panel

Discussion

01:14 – Scott Hanselman Introduction

03:17 – Microsoft and JavaScript

13:40 – The Cost of Web Development

18:17 – Libraries and Frameworks

24:14 – Innovation in Software

29:48 – Apps Supporting JavaScript

34:14 – Windows and Internet Explorer

40:42 – Microsoft’s Attitude Towards JavaScript

45:58 – Open Source

49:12 – asm.js

52:05 – Angle Brackets Conference

Picks

Next Week

Screencasting: Sharing What You Know Through Video

Transcript

[Hosting and bandwidth provided by the Blue Box Group. Check them out at BlueBox.net.] 

[This episode is sponsored by Component One, makers of Wijmo. If you need stunning UI elements or awesome graphs and charts, then go to Wijmo.com and check them out.] 

[This podcast is sponsored by JetBrains, makers of WebStorm. Whether you’re working with Node.js or building the front end of your web application, WebStorm is the tool for you. It has great code quality and code exploration tools and works with HTML5, Node, TypeScript, CoffeeScript, Harmony, LESS, Sass, Jade, JSLint, JSHint, and the Google Closure Compiler. Check it out at JetBrains.com/WebStorm.]

CHUCKHey everybody and welcome to Episode 71 the JavaScript Jabber show. This week on our panel, we have Joe Eames.

JOE:  Hey.

CHUCK:  Aaron Frost.

AARON:  Hello.

CHUCK:  I’m Charles Max Wood from DevChat.TV. And we have a special guest that is Scott Hanselman.

SCOTT:  Hello.

CHUCK:  Since you’re new to the show, do you want to introduce yourself really quickly?

SCOTT:  My name is Scott Hanselman. You can learn more about me on the internet by googling for Scott. I’m in an epic battle right now with the Scott toilet paper people. You’ll find me just below Scott toilet tissue. I’ve been blogging for ten years. More than ten years, 13 years. I work at Microsoft right now. Before that I worked in finance at a company called Corillian that is now Fiserv. I’ve been building big systems on the web for as long as the web’s been around.

CHUCK:  Wow. What do you do at Microsoft?

SCOTT:  I work in Azure and Web Tools. I’m a program manager. I’m in charge of the experience from file new project until deployment. I call myself the PM of miscellaneous. I spend time going through that experience making sure that it doesn’t suck. My focus is on web tools but also ASP.NET Runtime and what the experience is when you deploy something into Azure. That might be everything from what’s it like editing JavaScript in Visual Studio and I’ll find some issue and go and work with the guys that own that, or it might be someone’s trying to do something in Node on Azure and that experience is not good. I’m like an ombudsman or a customer liaison. But the simplest way would be to say I’m the community PM, community program manager, for web tools at Microsoft.

CHUCK:  Okay.

AARON:  Cool.

CHUCK:  So, is JavaScript your primary focus?

SCOTT:  I would say that my primary focus is just anything that makes the web better and moves the web forward. While I work for ASP.NET and most of my work is in C#, because applications have a foot on the server and a foot on the client, I’ve been doing a lot of talks and thinking about where JavaScript fits into the world going forward. Are we in the middle of some epic shift where JavaScript’s going to do all the work and the server is just going to return JSON? Or is there a reason to render html on the server?

JOE:  I’d love to hear your thoughts about that very topic. I’ve been thinking about that same thing a lot, so I’d love to hear your thoughts. I was a C# primarily developer and over the last few years I switched to be pretty much 100% frontend because I have some pretty strong thoughts about what is going to be happening in the next five years. I’ve love to hear your thoughts about that, Scott.

SCOTT:  Sure. Well I gave a talk at Build, which is our big developer conference. It’s the one this year that we announced Windows 8.1. At that talk, I did a thing called angle brackets and curly braces. It was basically a discussion of where is the virtual machine, where is the CPU workload right now?

I hear a lot of people say, “Hey, we run a web farm and we’ve got about ten machines in the farm and it just can’t handle the load. We’re going to need to buy an 11th machine.” Then you talk to them and they’ll say something like, “Well we’ve got 10,000 people hitting the site,” and I’ll think to myself, “Okay, you’ve got 10 machines in the farm and you have 10,000 people hitting the sites. All those people have quad processors, even if they have a phone. Are those processors really working hard? You’ve got 40,000 unused processors just sitting there and they’re waiting for your 10 processors to give them angle brackets. What if you gave them curly braces and let them do the work?”

It’s amazing how often people will send angle brackets back and forth across the web even to do something basic like a sort of a filter. I think we have a lot more virtual machines available to us than we are actually using.

JOE:  That’s such a cool way to put that.

AARON:  Yeah. I like the thought behind the distributed computing using your client’s CPU. That’s a good paradigm.

CHUCK:  Are there paradigms though where you would want the logic or some other function on the backend server?

SCOTT:  Well I think that it comes down to what your client is able to handle and what it’s able to manipulate comfortably. Five years ago, maybe six years ago, it would be very common to see someone make a query, do a postback, and then have a bunch of data sent across as html then hit a header of that table, do another postback and then sort that data. That was because JavaScript wasn’t sophisticated enough and browsers were not sophisticated enough and there was a little bit of a question about how powerful the user’s machine was to do something like a sort. But today, you could send a quarter million records across the wire as JSON and sort that comfortably.

CHUCK:  The only other question I have related to what you may or may not want to run on the frontend on JavaScript is security. If there’s some algorithm that you want to keep proprietary or anything like that, is there concern about putting that into JavaScript and shipping it up to the browser?

SCOTT:  I think yes and no. Even as recently as four years ago, we saw things like Actiontec routers to their password hashing on the client side and send the hash across the wire. I think that there are algorithms that are security related that one could do, but it is true though that if you put your stuff out, if you put your intellectual property out as JavaScript, minified or not, there is certainly no expectation of privacy or expectation of intellectual property protection. So yeah, that’s a good opportunity to use a web service and make the backend a black box.

CHUCK:  Those are really the only things that I could think of that are reasons that you might want to do the work on the backend. I’m a little bit curious then, does Microsoft in ASP.NET or some of the other frameworks provide good ways of doing this? I know that some of my friends who do a lot of .NET web development tend to use built-in widgets or whatever that abstract away a lot of this. I’m just wondering how Microsoft handles that.

SCOTT:  Okay. So for people who are not familiar, I’ll give you the two-minute history of what we’re doing and the direction that things are moving. The thing is, sometimes if you say something as simple as ten years ago you’ll lose some of your audience, right?

CHUCK:  [Chuckles]

SCOTT:  For some JavaScript developers, ten years ago they were 15. Ten years ago or 12 years ago, when ASP.NET first came out, the state of the art for software development was dragging a button from a toolbox onto a design surface. You would pull a button over and drop it onto a design surface and you double click on the button and you would get a button.click. That kind of event-driven programming with components abstracting away complexity was how you did things in Visual Basic. ASP.NET Web Forms, whether it be appreciated or not appreciated or maligned or not maligned, moved the web forward by bringing the web to a whole chunk of people who simply couldn’t have done what it wanted to do. It added a layer of abstraction where it took stateless http and turned it into a stateful event model. That was revolutionary and crazy and out of this world and productive in 2002.

Fast forward to today, it may not be appropriate and it certainly is a layer of information hiding that’s not appreciated. So then ASP.NET MVC came out, which is like .NET Rails and that hides nothing, it embraces http and it lets people do whatever they want at whatever level they choose to. Now ASP.NET developers can pick from a line of business, corporate, component event-driven model with Web Forms or a down on the metal, low-level, model-view-controller style with MVC. But then moving forward even more to do client side development, what you really need is a way to get JSON across the wire really, really fast. So our JSON serializer sucked for a number of years. It’s a serializer that turned C# into JSON.

Around the time when we open sourced most of ASP.NET and right now ASP.NET MVC, Web API, our identity stuff, it’s all open sourced and you can go and watch the Git commits and check it out. Around the time that we open sourced all that stuff, we swapped out our JSON serializer for a thing called Json.NET, so it’s an open source JSON serializer from a guy named James Newton-King. This is also around the time when we started shipping jQuery, jQuery UI, Modernizr, and then even now we’re going to ship Bootstrap. There’s a lot of open source in MVC and ASP.NET itself is open source. So then we made a thing called ASP.NET Web API. This takes you even lower level.

You can imagine us going from high-level abstracted web forms, moving down a level, MVC, going down a level even further to Web API and you’re getting faster and faster and faster as you’re doing this. You’re getting lighter and lighter weight. You’re making your server do more and more work and you’re pushing more and more of that work over to the client. If you were going to go and return some JSON from the server to the client, you could do it in Web Forms, you could do it with a control but you wouldn’t want to do that. It’s way too much overhead. Just get the JSON across the wire and handle your business. Web API pushes all that historical system.web, ASP.NET emotional baggage out of the way.

We’ve even got it set up where you could do what’s called self-hosting, just like in Node, where you don’t need Apache. Node will return the JSON itself. Or if you want to have a Windows service, return the JSON without IIS being involved at all. You can do that too. We’re continuing to move lower and lower down. We want to have a slider bar where someone can decide how much information and how much architecture do they want to hide from themselves. It’s a balance between raw power at the low level and raw productivity and line up business-type applications at the high level. Does that make sense?

CHUCK:  Yeah, that does make sense. One question I do have about the approach though is that I found that at certain, because I’ve worked at various levels, I’m a Ruby developer mostly so I’ve worked at different levels, Rails, and Rails has a lot of that deep stack that you’re talking about.

SCOTT:  Exactly.

CHUCK:  Then you can move over to Sinatra with has less stack. You could go all the way down to Rack, which is just basic return web response stuff.

SCOTT:  Yes, yes. Let me pause you right there. You’re exactly right. So Rails is like MVC. That’s the big framework. Then Sinatra is like Web API. And we also have a Sinatra clone called Nancy, as in Nancy Sinatra. And then Rack on your side, we have a thing called OWIN. This is just like computer science. There’s some cloning going on. Obviously, Nancy is just like Sinatra. But this is the way that things are moving industry-wide, not just Rails and MVC, but you can find corollaries to all this in other technologies.

CHUCK:  Yeah. It’s basically how much of a factory do you need, I guess.

SCOTT:  Yeah. People crap on Web Forms, but if your job is to get a grid of data up and get some charts and graphs and make a dashboard for your boss and he wants it done in a week, Web Forms like it or not is ridiculously productive.

CHUCK:  Yeah.

JOE:  So Scott and Charles, at one point you’d said, talk about security and talk about maybe that’s the only other reason you could think of to do things on the server-side, and Scott when I’d asked…

SCOTT:  Oh no, I can think of others.

JOE:  [Chuckles]

CHUCK:  Yes, I can too.

JOE:  Scott, you were talking about sending brackets versus curly braces, right? Angles brackets versus curly braces and stuff. I was asking you about the direction of the web, the way that it’s heading. One of the things that have been on my mind a lot basically has been, and that you just talked about it, it’s the cost of web development. Server-side web development has just always been a lot cheaper, overall, usually cheaper to get out the door and then cheaper to maintain over time. So when we see JavaScript and the role that JavaScript has had in the web over the last ten years, 15 years, as it has come from doing little tiny things to now people are building full entire applications. I don’t know if you’ve heard before, but here at Domo, we’ve got an application with 100,000 lines of JavaScript code and no server-side html.

SCOTT:  Oh, yeah.

JOE:  It’s par for the course nowadays. So I was curious what your thoughts are about the costs of doing development on the client-side and how that’s changing and how that might change in the future through better tooling and stuff.

SCOTT:  I think that there’s education first. There are people who have been doing that work for the last five years. So if someone is a new developer and you’ve got five years’ experience, except their five years’ experience is only with client-side stuff, they’re probably going to be really productive, because they don’t have the emotional baggage of the previous 15 years.

JOE:  [Chuckles] Emotional baggage. I like that.

SCOTT:  They’re not like you and me. They’re not thinking of the psychic weight of tables and they’re not going to obviously go and make div-itis and have divs and spans and just a mess because that’s just simple not how they did stuff. They’re not even going to think about a table with a one pixel transparent gif as a solution because it never existed in their world. So there’s an education factor. There’s a [inaudible]. I think there are a lot of corporate developers. I call them dark matter developers, because they make up a large part of the universe but we can’t prove that they exist.

JOE:  Awesome.

SCOTT:  And dark matter developers, they’re not on Twitter, they’re not on Facebook. They work at the Nebraska Department of Forestry and they maintain an Access database and an ASP.NET app. And all the startup people in the Bay area think that they either don’t exist or that they suck, but when they got and they pay their power bill or their water bill, they’re talking to one of these apps made by one of these developers. They might be thinking, well why don’t they just upgrade? Well, they have an app that works. They’re very productive in that environment. There’s an education factor. But then to Joe’s point, there’s also the tooling. And there isn’t yet, I think, a perfect integrated seamless experience. I don’t know about you guys, but I spend a lot of time in Chrome tools. I spend a lot of time editing CSS and getting everything right in Chrome tools. And then I wish that I could push that back from the live DOM in Chrome tools into my CSS. But I don’t. I have to go and copy-paste it from the property window back and forth. That’s just one example. I’ll do debugging and get the JavaScript just right or I’ll go and do a bunch of stuff inside of an immediate window and then wonder how am I going to get that back over into the JavaScript in my IDE. Right now, we’re building applications in a very decoupled way with a bunch of collections of applets and tools that we find useful. I think we are all as an industry moving in a direction, but is that direction one IDE to rule them all, or is it everyone doing all their work in vim and tmux, or is it everyone doing their work in the browser inside of Cloud9?

AARON:  That’s a good question.

JOE:  Yeah.

SCOTT:  Yeah, I don’t know. I have Sublime Text pinned to my taskbar and next to it is Visual Studio, because there are things you can do in one that you can’t do in the other. I don’t believe in religious zealotry. I believe in getting stuff done. I want to get it done in whatever tool is available to get me done. If that’s Brackets or Sublime or Visual Studio, I’ll use the tool I want to get [inaudible] is.

JOE:  What about the role of the libraries and frameworks. Specifically, Microsoft has made a few choices already to promote certain libraries, JavaScript-specific libraries and frameworks, and they’ve picked a couple of horses that are only one of the horses in the race, right?

SCOTT:  Like what?

JOE:  For example, they’re delivering Knockout.

SCOTT:  We deliver Knockout in the SPA stuff, single page applications, but Knockout’s super lightweight and we don’t use it by default. There’s no tooling or requirement that one has to use it. We’ve picked Knockout in one example because it has an MVVM way of thinking. That’s not as a way to promote JavaScript or force JavaScript developers to use Knockout, but that’s a way to make Silverlight developers who don’t have an option necessarily on the web if it doesn’t include Silverlight to move their knowledge of the model-view-view-model framework over to the best, if not the only, JavaScript framework that really thinks about things in terms of MVVM rather than MVC.

JOE:  So that brings up another interesting question then. Is Microsoft doing anything with other frameworks? MVC frameworks are obviously a big rage going on right now. You’ve got Backbone that’s been around forever, in web terms of course.

SCOTT:  Yeah, sure.

JOE:  And Knockout came on the scene and did the first real mainstream two-way binding. Then now Ember and Angular are duking it out. Then there are a million others on top of that. Is Microsoft doing anything besides just delivering Knockout or are they just observing the MVC race and trying to be as compliant, as integratable as possible?

SCOTT:  I’m speaking for me. I’m not a spokesman of Microsoft.

JOE:  Sure.

SCOTT:  I’m just a guy with a microphone. I’m sure someone could tell me that I’m lying. But here’s what I think. That sounds like you didn’t see the keynote at Build this year.

JOE:  I didn’t.

SCOTT:  But I used Ember to build and app on stage at the keynote. Then we’ve also build AngularJS Intellisense into both Visual Studio 2012 and 2013. So you can type ng-[inaudible] intellisense for all the stuff in Angular. We’re not going to pick one unless an MVC framework on the client-side comes out and wins with the kind of decisive victory of like a jQuery. The MooTools guys can complain or not, but jQuery won, right?

JOE:  Yeah.

AARON:  Yeah.

SCOTT:  They won like Oprah won.

[Chuckles]

SCOTT:  Maury Povich can complain that maybe he’s a valid option as well, but he’s just not because Oprah won. That has not happened in MVC yet.

JOE:  Right.

SCOTT:  There’s Angular, there’s Ember, there’s Backbone and on and on and on. But it’s still a couple three or four horse race. Until there’s a decisive victor, I think that it’s better for Microsoft to support the web and let the web decide. I don’t think it’s appropriate for us to throw our weight behind one. We threw our “weight” behind Modernizr because it solved a problem unlike anything else. We threw our weight behind jQuery because it won.

JOE:  So I’m not going to ask you which one you would think, but do you think there will be an MVC winner or do you think we’ll continue to see the large number of MCV frameworks in JavaScript, in your perspective?

SCOTT:  Let me tell you a story.

CHUCK:  [Chuckles]

SCOTT:  I was working at this finance company. I was a chief architect of a company that does retail online banking software. This was about nine or ten years ago. As the chief architect, I had to make decisions about company direction from a technical perspective and make sure that it fits within my architectural values. There was a young man who didn’t like that the calendar control that came with ASP.NET. He says, “I really want to use this other calendar control,” and I said, “Well okay. What is it you’re planning on doing?” He says, “I’m going to write a way better calendar control.” I said, “Okay. So your job right now is to set it up so that people can transfer money from point A to point B for retail online banks all over the world, but you want to make a calendar control.” He says, “Yeah.” I said, “Have you looked at any third-party options?” “Well there’s this one you can buy for $400.” I said, “Okay, you have four hours to write the greatest calendar control in the world, because you’re $100 an hour and you told me that you can buy one for $400 so you have four hours. If you can solve this problem in four hours, great. Otherwise we’re going to buy a widget.”

And that was insensitive of me and it shut the argument down very quickly. But later on, a month later, I realized that building new kinds of plumbing and inventing new kinds of plumbing is way more fun than being a plumber. Joe asks, is there going to be a winner or not. Well if the focus of the web was on productivity, yes there would be a winner. We would pick the most productive one and we would all use it. But if the focus of the web is building crazy stuff for no other reason than because we can do it, and if building and inventing new stuff is more fun than snapping Lego pieces together, then no, we’re never going to have an answer because some 25-year-old is always going to have a better idea.

JOE:  That was a great story and great moral. I love that, absolutely.

CHUCK: Yeah. One thing I do wonder about a little bit though is that if we all pick the one tool and went with it, doesn’t that make it hard to innovate new solutions?

SCOTT:  But see, that’s where it comes down to what is innovation? If you think about it from an economics perspective, innovation and software exist in order to make money and move business forward. I don’t say that in an evil capitalist way, but just talking about economic theory. Sometimes I think developers of all ages forget why they’re making software. I think there are basically three kinds of software. There’s software that makes the business happen, there’s academic software like scientific software that’s like, “I’m trying to figure out a new way to sequence the genome because I’m a scientist,” and then there’s because it’s crazy. If you have programming languages like Befunge that have no academic value of any kind but it’s awesome just because it’s awesome, that’s great.

But when you sit down and you write some software, you have to ask yourself what kind of problem am I trying to solve here? When DHH and friends wrote Rails, they had a business problem and that problem was make Basecamp better and make it so that they could productively iterate on Basecamp. Was Basecamp a toy? No, it was a product that they were making money on. He races Formula 1 racecars because he’s rich, because he made money. People didn’t hand him money for making Rails. He used Rails and made stuff and made money.

My point here is that when you are trying to write software, if it’s the next great JavaScript framework or the next great calendar controller, you have to ask yourself, does this move my goal forward? Is it saving babies from cancer or supporting this doctor because I’m writing the backend system for that thing? You have to then control your urge to go and do the crazy, write the new calendar widget and instead write the most productive high-quality testable software that that person is going to need. Software people are support engineers. I think we often lose sight of supporting the business.

JOE:  That’s a great, great point. I would say that when you said it first, do people, do programmers forget why they’re programming? My response to that would be, no we all think we’re programming for fun, which [inaudible] disagree with our employers.

CHUCK:  [Chuckles]

SCOTT:  I think more importantly, we think that we are programming for the intellectual stimulation of it.

JOE:  Absolutely. Doesn’t this seem to attract inventors? So when we are not inventing, I think a lot of us feel like, “Oh, I’m not doing what is my passion. I want to be inventing.”

SCOTT:  Right. I think people will say, because people who are listening might say, “Oh, well this is just like the big evil Microsoft capitalist person that is going to say something like that.” This isn’t a Microsoft perspective or a Scott Hanselman perspective. This is just the reality of why we make the widgets we make. That doesn’t mean we should stop innovating. It just means we should know why we’re making what we’re making when we’re making it. This is why I do corporate work to try to move the web forward during the day but I’ve got crazy stuff that I do at night and on the side and this is why we do open source, to throw code spaghetti at the wall and see what will stick.

JOE:  [Chuckles] I like that, code spaghetti.

CHUCK:  As opposed to spaghetti code?

JOE:  Right.

SCOTT:  Yeah.

JOE:  That’s awesome.

CHUCK:  Makes a lot of sense.

JOE:  Yeah, absolutely. I agree with you. We all want our jobs to be all about inventing and innovating, but innovation is often about how to put things together well and maintenance. I’m [bringing] the engineering practices, test-driven development and pair programming and stuff and not necessarily every developer embraces those practices. For me, that’s all about, I want to do what’s right for the company.

SCOTT:  And remember that innovation is not just inventing something that no one’s ever thought about or putting things together in a way that no one’s thought about, but it’s also bringing concepts to people in a new way that they’ve never thought about. Bringing TDD and Scrum to someone even in 2013 can completely revolutionize their business.

JOE:  Right. Totally true.

SCOTT:  That is a kind of innovation as well. You could innovate the way that they do trucking or warehousing. I think also there’s innovation being done that is low-level. For example, we’re doing some stuff for an asynchronous JavaScript debugging that isn’t sexy or fun to talk about. But if you look at the comments on some of the new Visual Studio 2013 stuff, there are basically two different kinds of people. There are the ones that are like, “2013? I just got 2012. How is this innovation? This sucks. You guys are just making me pay again.” Then someone else says, “Oh my goodness, there’s asynchronous JavaScript debugging in 2013? And the call stacks understand multiple threads and promises? Holy crap, you’ve changed my life. Thank you, thank you, thank you.” That one feature though, completely revolutionized someone’s business because that’s what they needed. That was the small feature, the happy little feature, that changed it for them.

JOE:  Yeah. That brings an interesting point. The migration of Visual Studio to support JavaScript has been a fairly interesting one, I think.

SCOTT:  Yeah. I think it’s weird. I don’t know if I totally buy into the whole write Windows apps in JavaScript, but the mail application and the calendar app on Windows 8, they’re native apps. By native, I mean they really are native. They run and they can call native APIs and they are real apps that happen to be written in JavaScript. They did that so that web developers that know JavaScript could go and say, “Oh I want to write an app and I want to put it into the app store,” and not in a PhoneGap kind of a way where it’s like, “Oh it’s just a native frame around Internet Explorer,” kind of a way, but a real app that can call any native API. I don’t know if that’s what I want from the web, but I think it’s the ability to make native apps in Windows that has them cause, the Windows folks, to fix the underlying engines.

So just like Node uses V8, Windows 8 uses Chakra, the Internet Explorer JavaScript engine. They’ve done so much tooling to make that multicore and support jitting and all sorts of really cool asynchronous debugging stuff. That work they did internally has bubbled up, which means now the web developers can do really cool debugging with JavaScript in Visual Studio, that has features that aren’t available in debugging JavaScript in other ways.

CHUCK:  So when you write an application, a native application like you’re talking about, for Windows in JavaScript, is it effectively then running on that JavaScript interpreter so it’s still interpreted but it has API capabilities to reach into the regular runtime and do things that the other native apps can do?

SCOTT:  Yeah. It’s like when you have the JavaScript engine that’s running in Internet Explorer. It has one kind of sandbox. It’s the, “I’m running on the web and I’m downloading code from the web and I live in that security context,” just like V8 and just like Chakra, they live inside of the browser and they live in a web context. They communicate with a surface which is rendering html. When you’re running a native app on Windows that happens to be written in JavaScript, it can access the microphone and the GPS and the gyrometer and talk to the file system and do stuff like any other app, like a C++ app or a C# app. It’s running in a slightly different security context. It can make declarations about what it wants to talk to.

But it’s using JavaScript API, so just like you can write a web app on the web in Chrome that says, “I want to see your location.” And then Chrome will say, “This website wants to know your location.” And you hit allow, that same kind of thing can happen in JavaScript in Windows 8 where it says, “I want to use the camera.” And then the operation system will say, “This guy wants to use the camera. Are you okay with that?” And you hit okay and he’s calling the same kind of low-level win32 or what they call WinRT, Windows Runtime, APIs that a C++ or a C# app can write.

CHUCK:  Nice. That’s really cool.  Where is the documentation for that kind of stuff?

SCOTT:  If you search for WinJS or if you go and download the free how to build Windows apps in JavaScript Visual Studio Edition, I think it’s called Visual Studio Express for Windows, you just go File > New Project and they’ll make you one. All the layout is done in responsive design, so it’s all CSS. If you have different-sized screens or if you’re snapping your Windows app from side to side, it’s all html and CSS. It’s pretty weird, which is weird for me because I’m a web guy and I like to make web apps, but when I want my native apps, I write them in C#. I still emotionally struggling with the, what does it mean to write a native app in html? Just like the guys at Mozilla have the Firefox OS. It’s very similar, where the native code you write is JavaScript and you talk to native services with JavaScript. It’s a tough thing you get your hear around.

AARON:  So Scott, people have wondered about how coupled Windows is to the browser, to Internet Explorer. Is Window 8 less coupled to IE or more coupled to the browser? Some people are hoping that the Windows platform will move away from coupling to the browser. It sounds like they’re almost embracing it more now than they were in the past. Can you tell us a little bit about that?

SCOTT:  Okay, that’s a complicated thing. The whole thing with the legal stuff back in the day with Internet Explorer was pretty complicated, and I’m not a lawyer. But the idea is this. When you looked at Help, when you hit F1 in Windows and saw help, the help was delivered in a way that was rendered like html, but it was rendered inside a native application. Who’s going to render that html? Is it Gecko? Is it Chromium? Those things didn’t exist 15 years ago, almost 20 years ago, in Windows 95. So Internet Explorer was made as a component. So there’s the Internet Explorer app and then there’s the html renderer component. It’s called Trident. So you get Trident, Gecko, Chromium, things like that. Those components didn’t exist in a reusable way, so they put one into Windows. I think it’s MSHTML32.dll.

When an app in Windows wants to render a little bit of html, they use that widget. When you upgrade Internet Explorer, you get an updated version of that widget. That’s a low-level system piece of functionality to render as html, to render some chunk of information as html. Now it’s easy to say, “Oh well, now that there are other things like the Chromium browser controls and Gecko, you should be able to swap that out.” But the technical challenge of making it so that Windows itself could render html in Quicken and QuickBooks and all the other native apps out there is complicated, to make it so that you could literally swap out a fundamental part of the brain and make it optional. Like, “I want Adobe Creative Cloud to render its html with Gecko.” That would imply that there is a shared interface and there’s a shared contract and that would be possible.

So yes, there’s Internet Explorer aspects like the rendering of html baked in, but it’s as a component. Chakra, the JavaScript engine is part of Windows. But the browser you could see is still being upgraded. IE 9, IE 10, IE 11 have all come out with that engine and things still work. I can’t give you an answer like yes or no. I can just tell you that every operating system, whether it be Safari on a Mac or whether it’s Ubuntu, has some html rendering subsystem. And on Windows, for rendering html that’s not inside Firefox or Chrome, yes it’s part of IE. It’s one of the services IE provides. Does that answer your question?

AARON:  Yeah, kind of. It kind of does. I was more approaching it from just the support that the browser [inaudible] eventually going to get cut, that the operating system is eventually going to get support killed for it and then that OS won’t get any more IE updates as well, because the IE updates is synonymous to operating system updates.

SCOTT:  Let me think about that. For example, XP is going to lose support in 2014. I think it’s June of 2014. No, April of 2014. Windows XP loses support. That means that when support is ended, there will be no new stuff coming out for XP. That doesn’t mean that there won’t be any new apps, but as far as security updates and browsers and stuff, it’s just not going to happen. But that’s a 12-year-old operating system. That’s just how it’s done. Same thing if I’m running Dapper, am I still supported? It depends on whether I have the long-term support version of Dapper or the short-term one. Every operating system has an end of life. I don’t think that I’m going to get Chrome 15 support today.

AARON:  Yeah. My question is more to say, is Windows 8 as coupled to the browser? It sounds like it’s the similar paradigm.

SCOTT:  It’s the same, I think. I’m not quite sure I understand the question. Windows 8 is no more coupled to the browser than OS X is coupled to Safari, or the html renderer in Ubuntu is coupled. Yeah, you could pull it out, but then html wouldn’t render in applications that require that service.

JOE:  I think the meat of Aaron’s question might be in say 2026, Windows 8 gets sunsetted. Are the users that are still on Windows 8 going to capped at IE or maybe by that point it’s IE 40 or maybe it’s IE 20, whatever, are they going to be capped and have to either move to a different browser to get whatever the latest web stuff is or is Microsoft thinking of any strategy in place to say, well the browser itself can continue to be upgraded even though the operating system has been cut off?

SCOTT:  I don’t know. I don’t speak for Microsoft. I don’t speak for Windows. I don’t speak for IE. And I neither work for Windows nor do I work for IE. I work for ASP.NET on the server-side. That said, will Microsoft keep innovating a browser on a 12-year-old operating system? Probably no more than anyone else will. Just like my Mac mini is stuck on Snow Leopard and I can’t upgrade because it’s stuck on Snow Leopard and I can’t upgrade, because they end-of-lifed it. That’s just how it is. So no, I don’ think that 10 or 20-year-old operating systems are going to get new browsers.

JOE:  Okay. I’ve got another question about Microsoft’s attitude toward JavaScript. I said it was very interesting that Microsoft went through a ton of effort to make Node work on Windows.

SCOTT:  It wasn’t a ton of effort, but yeah, there was work put into it.

JOE:  Certainly, yeah. A ton’s a relative term. So they went through a bunch of effort to make sure that Node worked on Windows at a time when I think a lot of people were surprised that Microsoft said, “Hey, here’s this web server that we didn’t build that can theoretically compete with us. We’re going to make sure it works for us.” I’m wondering if you have any particular insights about what that’s about at Microsoft. Was that representative of a paradigm shift? Was it a natural thing for them to do?

SCOTT:  First, Node isn’t a web server. But people wanted to run Node on Windows and they were being very vocal about it. People wanted to run Node in the cloud in Azure and they were being very vocal about it. We’ve got a really, really good, extremely performant web server in IIS, but it couldn’t run Node. So we could certainly use Azure to spin up a bunch of Linux VMs and run it under Apache, but if you wanted to run 100 web servers on an Azure instance and 50 of them are Node, it’d be nice if you were running them all managed under the same thing. So yeah, we worked with the Node guys and we worked with Microsoft OpenTech, which is the open source arm of Microsoft. It’s another whole company. Microsoft Open Technologies. They worked with the Node guys and they’re doing it. They’re actually going to be doing a hackathon later this fall to get people getting it even better on Node. Node works great on Windows and iisnode makes Node run great on IIS. Was it a paradigm shift? Eh. I don’t know. I feel like you’re digging for something that you’re not going to find. There’s not like a bunch of people sitting around going, “Nyehehe. Now if we can only get Node to run on Windows, we control the world.”

CHUCK:  [Laughter]

SCOTT:  We’re not nearly as evil as you think we are because we’re not that organized. Being evil requires incredible amounts of organization.

JOE:  That’s hilarious.

SCOTT:  We’re just simply not that organized. A bunch of people at Microsoft notice that a bunch of people in the world wanted Node to work on Windows. So we made it work on Windows. If you want something else to work, we can do that too. I can get Node, PHP, Razor, ASP.NET, Classic ASP, all running in the same instance of IIS and up on the cloud in five minutes. I can show you how to do it. It’s really easy. That was an example of because it was awesome. And if you want to run, go and look at my talk from NodePDX, I live in Portland and PDX is the airport code, for Node. Search for Hanselman NodePDX and you can see my talk where I spun up a bunch of Node instances and explained how it works. I did the work on a Mac, but when Node is running in Azure, it’s running in Windows. Even if you’re running Linux in Azure, you’re still running on Windows.

CHUCK:  I think it’s interesting that you, talking about Microsoft not being the evil empire that I think a lot of open source organizations try and make it out to be.

SCOTT:  No, there are evil parts, but not my part.

[Chuckles]

CHUCK:  And there are definitely pieces to Windows that are close source because it’s a company and they want to make money on their software. I also find it interesting. I think that was part of a battle that was waged by other open source products or projects that competed with certain Microsoft projects.

SCOTT:  I think there was a time that Microsoft, a couple of years ago, maybe five years ago when I was just getting there and Phil Haack was getting there, where we would see an open source project and then feel the need to write the Microsoft version of that thing. Now, we’ve done all the work. We’ve done the legal work. When the JSON serializer thing happened, we’re like, “You know, our JSON serializer’s not cutting it.” We could like, “Well, we’re going to need to make it better,” I’m like, “Well no. Let’s just use the better one.” I have said this a thousand times on stage and I’ll say it again, that I want people to go File > New Project and pick what makes them happy and hit OK and use the framework that makes them happy and I don’t care.

I don’t care if it’s not Entity Framework. If you want to use NHibernate or RavenDB or CouchDB, dude, knock yourself out. But ultimately, the dirty little secret about Microsoft is they want you to run on Windows. Okay, well you don’t run Windows. You guys run Macs. Okay. But maybe you’ll discover that Azure is actually a pretty kickass cloud service and you’ll run your stuff on Azure, which is Windows. But do you feel the emotional pain that it causes you to find that your code is running on Windows? Ultimately, if you’re a business person you’ll notice it runs really well and you won’t really care.

CHUCK:  Yeah.

JOE:  So Scott, I want to be a little bit clear here that I kind of was digging for something in the question about Node support and maybe this is only true from the outside,

SCOTT:  Dig on then, brother, dig on.

CHUCK:  [Laughter]

JOE:  But I do think that from the outside, I have seen a paradigm shift, as I said before. I’m a .NET developer by history. It’s only been last year that I haven’t been actively paid to do .NET development.

SCOTT:  That’s cool. I’m non-denominational.

[Laughter]

JOE:  I think there has been, at least from the outside, a paradigm shift at Microsoft that has basically said the open source community or the world, the open source world and tools there have a lot of really great stuff that’s going to make Microsoft developers’ jobs better if they have access to that. That’s what I see. I think that that Node thing was, and maybe that’s not true. You said you work at ASP.NET so you might know at least what people talk about in meeting rooms. But it seems from the outside that that’s true, that that’s happened, that Microsoft has basically given its .NET developers a lot more access to open source, more encouragement to use open source tools to enhance what they’re doing in ASP.NET. Personally, I was really happy when that happened. [I loved it.] I think that that was a wise choice. But I don’t know. Maybe it wasn’t a choice that was consciously made. It was just something that happened naturally.

SCOTT:  I don’t think it happened naturally. But Phil Haack came and worked on MVC and he pushed, along with myself and Glenn Block and Mads Kristensen and a whole list of people who got to Microsoft about five years ago. You know the whole story about how you boil a frog?

JOE:  Yeah.

SCOTT:  You boil a frog by turning the heat up really slowly and that frog doesn’t notice it. But if you throw a frog in really quickly, the frog is going to jump out and go, “What the heck’s going on?” So all these people showed up five, six years ago in this really hot pot and we’re just like, “Whoa, this is not okay. Why are we doing this and why are we doing that?” So we rejected it. We jumped out of the pot. People like Phil and Glenn and Mads and myself and Scott Hunter and Scott Guthrie, there’s a list that goes on and on and on, all came together at about the same time and started pushing hard. We pushed hard on legal. We pushed hard on Scott Guthrie.

We didn’t just say, “We should do open source because it’s cool,” or, “We should do open source because it’s morally right,” we said, “Because it makes people happy and because it makes the products better and because it makes our jobs easier,” and just all the other reasons about open source that are rational. And Guthrie and the presidents and vice presidents said, “Okay. Let’s try to see what we can do.” And over the last five years, it’s actually working. I’m sure that if you asked a president or a vice president type they would tell you it was a master plan. I’m sure if you ask someone at the rank and file, they would tell you that it was an organic thing that happened. The truth is probably somewhere in the middle. But I know that I came to work on open source at Microsoft and that’s why I came here. When it stops working, I will leave.

JOE:  That’s awesome. I love that. That’s a great, great answer. I have another question that I really want to get asked and we might be running short on time here, so I want to kick it in here. Asm.js. Right now it’s really essentially from what I understand, it has to be written in C++ so anything that can get to C++ can essentially write asm. I’m just curious if we might in the future see a way to take C# and turn it into asm without going through a whole bunch of rigmarole.

SCOTT:  The philosophical issues around how asm.js works, and for those that aren’t familiar, the idea is, and you can actually go and see my talk about this. I would encourage people to check it out. It’s actually a talk I’m really proud of. I show asm.js in the talk at Build where the idea is that JavaScript itself is a pervasive virtual machine now that doesn’t require a plugin. So all of the things that we attempted to do when we brought Java and Silverlight and Flash to the browser have now been solved in that we have this great runtime that is available everywhere and has speed comparable to native code. So then asm is this low-level subset of JavaScript that I can compile to with other tools.

So I could take something, I could take a certain kind of C++, not just any old C++, but it has to be C++ that’s targeting a certain, it has to be CPU-intensive. For example, if I were going to take a ray tracing engine or I think the guys that took Unreal, ported their stuff over into asm in three or four days, but to say I could port C#, you probably won’t be able to ever take idiomatic C#. But there are things like Script# that can already make JavaScript from C#. There are certainly transpilers that can take C# and turn it into JavaScript. But the problem isn’t the idiomatic transpiling from one language to another, or from one abstract syntax tree to another, it’s the underlying libraries. If I’ve got C# that’s doing ray tracing, yeah probably. I could totally see that. If I’ve got C# that’s doing data grid manipulation or talking to some internal win32 library, well I can translate the language but I can’t translate the calls into the native code.

I think you’re going to see more stuff like TypeScript where TypeScript is what JavaScript would look like if a C# developer designed it, just like CoffeeScript is what JavaScript would look like if a Ruby person designed it. Type annotations in JavaScript are more interesting to me than C# compiling into JavaScript. Does that make sense?

JOE:  Yeah, absolutely. Absolutely, very interesting.

CHUCK:  Alright.

SCOTT:  Let me put in one plug. I’ve got a new conference that I’m doing called Angle Brackets in Vegas in October at AngleBrackets.org. Go and check it out. Douglas Crockford is going to be our keynote and I’ll be there and there’ll be lots of great people talking about JavaScript. So I would really encourage people to come and hang out with us in Vegas this October. AngleBrackets.org.

AARON:  Cool.

CHUCK:  Awesome. Alright. Well I think we’re pretty close to the end of our time. But thanks for coming. We’ll go ahead and do the picks and then we’ll wrap up the show. Joe, do you want to start us off with the picks?

JOE:  Yeah, you bet. I’m going to make two picks. It’s actually one and a half. The first one’s only half a pick. I went and saw The Wolverine the movie and I liked it. I didn’t love it, but I liked it. So I’m going to half pick it.

[Laughter]

JOE:  My other pick,

SCOTT:  I liked it.

JOE:  Did you?

SCOTT:  I liked it. I liked it.

JOE:  Good. Well that’s good.

[Chuckles]

JOE:  It was not my favorite movie, but I did enjoy watching it and I don’t regret the money that I spent.

SCOTT:  There you go. Well said.

JOE:  Yeah. My other pick is going to be the same thing I picked last week. That is ng-conf. We’ve been doing a lot of work organizing ng-conf here, Merrick and Aaron and I, and it’s coming along nicely. We’re really excited and the buzz and excitement over the web seems to be just phenomenal. There are so many people that have expressed interest in attending. We’re really excited. The Angular team is excited for it. Scott, I actually want to issue an official invitation to come and attend ng-conf. It should be lots of fun. We definitely want to appeal to the Microsoft types. I’ve got a reserved seat for you, front row.

SCOTT:  Oh, cool. January 16th in Salt Lake City. I hope that you’re going to show all the new Angular support in Visual Studio.

JOE:  [Chuckles] That would be something that would

AARON:  That actually might be something we need to show.

JOE:  Yeah, that’s a great point. Absolutely. So that’s my picks.

CHUCK:  Awesome. Aaron, what are your picks?

AARON:  So, I got back from Cancun last night. I’m going to pick Cancun and it was awesome. Chichen Itza was insane. So I’m going to pick Cancun. Joe took my second pick, which is ng-conf, because it’s going to be a really fun conference I think for a lot of reasons. It’s the same weekend as the Sundance Film Festival. If anyone’s interested about ng-conf or getting updates on it, head over to the website, ng-conf.org and you can put your email address in and get updates. But also, I’m going to pick the ng-conf Twitter handle which is something that we just brought up this week, @ngconf. That’s where a lot of our updates will come out and where the conference speakers will go and stuff like that.

CHUCK:  Awesome. I’ll go ahead and jump in with a few picks. I don’t know if I picked these last week. I guess I can double check. Anyway, I’m going to pick them again just in case. I’ve been putting together this Ruby on Rails mentorship thing. It’s a course, so there is instruction and things along with the coaching and stuff. It’s called Rails Ramp Up. One of the tools that I am putting the videos up with is called Wistia. It’s got a lot of terrific features. It tells you how far in people have watched. It also allows you to put a call to action so people can sign up for your newsletter off of the video. The other thing is since these are paid private access videos, I can set them up so that they’re not public and they just mount or embed into the course software that I’m using. I’m really, really liking Wistia. I think that’s pretty much all I have this week. Scott, what are your picks?

SCOTT:  I didn’t know I was supposed to have picks.

CHUCK:  Oh, you didn’t?

SCOTT:  But since we’re supposed to have picks, I will make up picks. My first pick is the new Mumford and Sons video featuring Jason Bateman, Ed Helms, Jason Sudeikis and Will Forte. I would encourage you to check that out. My second pick is, I don’t know if you guys heard, but Beyoncé cut her hair so I’m freaking out.

CHUCK:  [Chuckles] Okay.

SCOTT:  She did. She cut her hair. It’s short now. This is the hair that defined a generation, people. And it’s been cut. She has a pixie cut now. I don’t know what I’m going to do with myself today. I may have to just punch out.

CHUCK:  Okay.

[Laughter]

SCOTT:  And you guys have no idea what to do with that. I love that it’s complete silence. This is how we’re going to end this talk. In a very uncomfortable silence, which I think is okay.

CHUCK:  Yeah, I guess we will end it here. We’ll catch you all next week.

12 comments
G_Martin
G_Martin

Greatly enjoyed your having Scott on to discuss various aspects of JavaScript as they pertain to the Microsoft Web Development.  I think you'll find many Microsoft Dark Matter developers who are eager to learn and use JavaScript more heavily.  ...Afraid I have to say that JavaScript Jabber might also be a little guilty of turning a cold shoulder to us.  I think I recall one JJB Podcast talking about Development Environments, and there wasn't one developer representing how to work efficiently in JavaScript on Windows.  I think I recall someone saying, "I went to a Mac, and never looked back".  ...While that's all well and good and while I personally do own a Macbook Pro, many of us are looking to use JavaScript on our primary development machine which is Windows.  I thought it was very poor representation, and it made me seek other Podcasts where my development environment, situation, and constraints would be taken into consideration.  ...Hope JJB will reach out more to Microsoft developers as they definitely did by having Hanselman on.  

joshmouch
joshmouch

To add to my quarter million rows comment.  If you take KO out of the picture, this amount of data would still cause the IPAD 1 to crash.

joshmouch
joshmouch

First, the praise:

I think the most important thing I got out of this podcast was your defining of us older, less social developers as "dark matter" developers (or something similar... I forget). I love it! And moreover, it adds credence to my suspicions that I'm not the only developer in the world who is resistant to this new focus on client-side-centric development for enterprise applications.  We've been bitten by the javascript-spaghetti-code bug in our infant years, and want to wait until the tooling is perfect before we jump on board.

Do you talk about this "dark matter" developer concept elsewhere? I'm interested to read more.


Second, the criticism:

You cannot send a quarter million rows of JSON to the client and have them render in a table using Knockout with even the simplest KO branching/logic.  You can barely even render 100 rows with a handful of KO logic statements without a large delay.  I've tried.  In IE8, 1000 rows can take 60 seconds to render with about 5-10 KO statements in the template.  I had to switch from KO templates to jQuery tmpl templates and bend over backwards to do as much computation on the server as possible before sending JSON, but the best I could do with 1000 rows is about 15 seconds to render.

johnny_reilly
johnny_reilly

Fantastic show - really glad you had Scott Hanselman on.  I've always found him a fantastic and helpful guy.  As well as that he's definitely one of the people I would point to to demonstrate that Microsoft these days is not "the big bad" that it perhaps may have appeared to be.  

root@107.23.219.75
root@107.23.219.75

@scott: Actually chrome has source maps which MS tool never had :p But its a nice talk btw.

Everybody seems so quiet in the podcast. Less comments and I feel like the panels where keeping their comments not to hurt scott :D

apewhogotlucky
apewhogotlucky

The whole quote about "sorting tables on the client / you don't need no stinkin' servers!" rubbed me the wrong way.  First off, a lot of developers were using client-side data sorting 10+ years ago in PHP and Classic ASP.  Second, it's not just as simple as running a table sorting algorithm in client-side Javascript, especially when you're dealing with multiple pages of data and it doesn't make sense to send "a quarter of a million rows across the wire as JSON".  Sure on a simple 1-page table of data, client side sorting makes sense, but if you have multiple pages of data then sorting it on the client will not give you the expected data (without re-running the query with the correct sort order on the server).  There is an argument to be made for constructing HTML on the client as opposed to the server, but as many real-world examples have shown, this has adverse affects on both server and client performance.  Here's one example from Twitter: https://blog.twitter.com/2012/improving-performance-twittercom

Yuhong Bao
Yuhong Bao

 FYI, the current policy on IE seems to be that they end major upgrades when a version of Windows enters Extended Support (April 2009 in the case of XP) and they support all versions of IE ever released for a version of Windows with security updates until that version of Windows exits Extended Support (the infamous April 2014 date in case of XP). I hope this will change for Win7.

nazargargol
nazargargol

I don't know why, but I had a feeling that this show came out with slight feeling of tension, all the stuff you talked about was great, but it felt a bit strange.

Rickenhacker
Rickenhacker

@joshmouch re: the 250k rows thing, no one does that, because no user ever wants to sit and read through 250,000 rows. You virtualise the scrolling area, you download the data you need to show the first couple of pages and then if the user moves the scroll bar, you get more data on the fly. It takes milliseconds. I've found this very easy to do with pure knockout.

Nbinman
Nbinman

I agree. I love listening to Scott, he's a great teacher, but it seemed like he was put up as a Microsoft spokesman trying to defend things he never had a direct part in. I can imagine the guy is probably tired of having to do this. In any case, the content was great. Was a good show!

Previous post:

Next post: