JavaScript, The Web, Mobile and the Rise of the New Virtual Machines with Scott Hanselman at Developer Week 2016

Scott came from the open source world to Microsoft and he works now in open source at Microsoft. Check out his podcasts Hanselminutes and This Developer’s Life, and the project March is for Makers.

What has changed in the industry?

The cloud and the browser. Let’s juxtapose those two ideas. How would we teach someone about today’s internet? To someone who learned computer science but skipped 20 years of internet. What if this someone went to sleep and just woke up 20 years later?

I think there is a world market for maybe 5 computers.

– Thomas J. Watson

What did Thomas Watson mean? This was back in the days when the computers filled the entire room.

What do we mean when we say the cloud?

It’s the concept of virtual machines.

What are the characteristics of the Operating System? It has memory managements and so on but it sits on top of hardware.

When you have a virtual machine, it gives you portability. This is when revolution began. You can take it from one provider to another provider. You also have the ability to choose, like to run Linux in Azure. Microsoft doesn’t care if you are on Windows or Linux or what language you write your code in. Microsoft’s new business is the for-loop, getting money per second.

Virtual machines let you do anything. They let you run anything. The problem is they are free like a puppy. But you have to water the puppy and walk the puppy. You have to keep it alive. You have to maintain it.

The cloud is more than just lift and shift, like moving the virtual machine to the cloud.

You don’t want to do virtual machines. You want to do web sites. Web sites let you run fewer things.

The layers of abstractions are built on top of virtual machines. We used to be the cloud, we scaled it out manually by ourselves. Now it’s just a slider bar! It’s exciting because it’s a solved problem. Server farms, firewalls. and so on. The stuff that we learned the hard way in the last 10 years are now checkboxes or a simple command in the cloud system.

What just happened? Magic!

Use whatever cloud that makes you happy.

Use the cloud that doesn’t care about your language choice. Use the language that makes you happy. A good cloud doesn’t care. The SDKs for your cloud should be open source, so you can see the source. It’s a higher level of abstraction.

You want to have a dashboard that shows you all the amazing high level business things that you need.

It’s platform as a service.

Adrian Cockcroft, Chief Architect of Netflix, did a talk about how Netflix scaled out to Europe and how they moved to SSDs. A kid said to him that SSDs are unreliable and Netflix is built on a House of Cards. No pun intended. 🙂

Adrian: That’s not my problem, I am renting them!

It doesn’t matter if SSDs fail!

What other problems can we solve on a higher level of abstraction?

You think about the business problem. You try to fix a problem like parallelism so you can be able to fix the actual problem. The Yak Shaving. What if you could raise the layer of abstraction? Parallelism is a solved problem. A layer of abstraction that is above virtual machines and web apps. That’s the cloud. Still we insist on maintaining virtual machines.

What about the browser?

The internet is an infinite book, a bunch of pages. The first webpage was The page still works. Then Java happened. And Silverlight. And Flash. We were doing it because we wanted an application platform and we could only do it with a plugin. A Plugin Virtual Machine. We taught our users that that’s OK. It’s a little VM in a box.

Microsoft didn’t kill Silverlight. The internet killed Silverlight.

So JavaScript happens.

When did you first realize that JavaScript is no longer a toy? Validation on the client side!

So what crazy stuff can we do with JavaScript?

People are creating amazing applications in JavaScript. Like this complete implementation of Linux and Pentium processor implemented in JavaScript: Compiling a C application in a JavaScript virtual machine running in a browser running on Windows. Or inside an iPhone emulator on a Windows machine. Or Unity Unreal engines written in JavaScript.

But then we also get questions like: Does this work with JavaScript disabled? No! How about cookies?

We have another OS that is running in the browser.

JavaScript has all the characteristics of a complete OS, even more so of a virtual machine with an abstraction layer. Does this mean that everything will be written in JavaScript?

Any application that can be written in JavaScript, will eventually be written in JavaScript.

Atwood’s Law

But Zuckerberg said that their biggest mistake was betting too much on HTML5, native is better.

“The avalanche has already started. It is too late for the pebbles to vote.”

The avalanche is HTML5 and JavaScript. The mountain is coming down and the pebbles are still discussing if it’s a good idea.

When you say HTML5 application you mean HTML5, CSS and JavaScript. HTML tables were the most advanced thing, long long time ago. Then came rowspan. HTML is simpler now. CSS provides all the style. And then you use JavaScript as the glue for everything else. It’s extremely easy. You don’t even need to learn the bad parts. [Insert irony here 🙂 ]

Why is there a picture of a samurai on the book Secrets of the JavaScript Ninja by John Resig? John: Because JavaScript is loosely typed.

“JavaScript is the Assembly Language of the Web”

– Scott Hanselman

The Web is getting a WebAssembly.

This is a joint effort among Google, Microsoft, Mozilla, and others.

CoffeeScript. TypeScript.

Both languages compile to the same JavaScript. You can transform into idiomatic JavaScript.

Don’t let layers hide too much complexity. Don’t use a library you don’t understand. No one writes JavaScript anymore. They write jQuery. Consider using plain VanillaJS. Find the right balance!

The pieces fit together correct now.

Things got OK once we got rid of IE 7-10.

You can use the cloud for massive scale and elasticity and with your choice of language. The browser is powerful with accelerated graphics, rich style and integrated virtual machine.

You have unlimited virtual machines in the cloud. Your user has powerful virtual machine with the browser.

Call to action: put the user’s virtual machines to work.