.NET Zone is brought to you in partnership with:

Sasha Goldshtein is a Senior Consultant for Sela Group, an Israeli company specializing in training, consulting and outsourcing to local and international customers.Sasha's work is divided across these three primary disciplines. He consults for clients on architecture, development, debugging and performance issues; he actively develops code using the latest bits of technology from Microsoft; and he conducts training classes on a variety of topics, from Windows Internals to .NET Performance. You can read more about Sasha's work and his latest ventures at his blog: http://blogs.microsoft.co.il/blogs/sasha. Sasha writes from Herzliya, Israel. Sasha is a DZone MVB and is not an employee of DZone and has posted 197 posts at DZone. You can read more from them at their website. View Full User Profile

BUILD Day 3: My Summary

11.04.2012
| 4868 views |
  • submit to reddit

No keynote today, but Scott Hanselman’s 8:30AM talk was a great replacement – he himself called it an “unkeynote”. Also, before the talk Scott looped some hilarious videos, such as MacBook Wheel from The Onion.

Scott Hanselman – One ASP.NET and the Cloud    
This was really keynote material in that Scott highlighted some of the recent developments in what the cloud means for developers. He started by showing the Azure PowerShell cmdlets, which give you provisioning of websites or virtual machines by virtue of a few keystrokes. These are the “five computers” somewhere in the world – Azure, Amazon, and other cloud providers – which provide infinite compute capacity at your fingertips.

image

The next point Scott made is that the browser itself is a virtual machine – running JavaScript – which provides a plugin-less experience for very complex software: Commodore 64 and x86 emulators being a notable example of how the browser becomes a virtual machine.

image 
Screenshot of the JSLinux effort, which runs a Linux system on top of an x86 emulator implemented entirely in JavaScript.

Instead of treating browsers like dumb terminals that wait for HTML to pour down from a powerful server, we can leverage the power of the user’s multiprocessor device with hardware-accelerated graphics if we run code inside the browser’s virtual machine. Some pretty cool demos with the D3 visualization and graphics library really drove the point home.

Scott couldn’t not mention the VanillaJS effort, which you should definitely check out. This is a 0 bytes download, giving you exceptional performance and a slew of great features ;-)

Some notable quotes from the talk:

“Furiously Googling with Bing”

“JavaScript is the assembly language of the web”

“JavaScript is an operating system”

Anders Hejlsberg – TypeScript     

This talk was very educational although I already had a chance to fool around with TypeScript a little bit. The big problem TypeScript is designed to address is that of developing large-scale JavaScript applications. With the lack of modules, classes, clean inheritance and strong static typing, JavaScript makes large-scale development exceptionally hard, and tools can’t help with auto-completion, refactoring, compile-time errors and other goodies.image

Unlike other efforts (such as Google’s Dart), TypeScript starts from pure JavaScript and adds support for arrow functions (lambdas), static typing, interfaces, classes, and modules. The whole thing is compiled down to readable JavaScript code that you can debug and inspect using the standard developer tools in any browser.

TypeScript source:     

class Player {      
  constructor(public name: string, public id: number = 0) {       
  }       
  play(game: string) {       
  document.write(this.name + " is playing " + game);       
  }       
}       
var p = new Player("Sasha");      
p.play("Diablo");       

JavaScript produced by the TypeScript compiler:      

var Player = (function () {      
  function Player(name, id) {       
  if (typeof id === "undefined") { id = 0; }       
  this.name = name;       
  this.id = id;       
  }       
  Player.prototype.play = function (game) {       
  document.write(this.name + " is playing " + game);       
  };       
  return Player;       
})();       
var p = new Player("Sasha");       
p.play("Diablo");

With this static typing comes the power of the tools – in-browser playground or Visual Studio, you get auto-completion, error squigglies at compile-time, and refactoring support letting you keep your sanity when working on large JavaScript code bases (to quote: “at some point, JavaScript turns into write-only code”). Anders drove this point home by demonstrating a refactoring of the TypeScript compiler, which is itself written in TypeScript!

Anders then showed a bunch of TypeScript features, including classes, modules, interfaces, type inference, optional properties, accessor functions, static methods, default parameter values, inheritance, and many others. This is really not the same JavaScript you learned to hate!

import connect = module('connect');        
import express = module('express');

var app = express.createServer();

app.get('/echo/:message', (req, res) => {        
  res.end('Your message: ' + req.params.message);         
});

var port = process.env.port || 8080;        
app.listen(port); 
Using modules and arrow functions in Node 

Finally, you don’t have to write TypeScript declarations for standard libraries. The TypeScript installation ships with type declarations for libraries like jQuery and jQuery UI, whereas WinRT type declarations are automatically generated from WinMD files.

If you haven’t tried TypeScript yet, there’s nothing to download to get started: head on to www.typescriptlang.org and start fooling around in the online playground.

Nathan Totten – JavaScript from Client to Cloud      This was a Node talk, and I didn’t expect to learn anything new but mostly to see how Microsoft perceives Node and its accompanying Azure support. Nathan provided a quick overview of Node, the single-threaded event loop model, and discussed some scenarios in which to use Node, such as lightweight server-side applications and web services. Perhaps more importantly, Nathan discussed when to not use Node – for CRUD solutions over data (Rails or ASP.NET are better), and for CPU-bound processing (because of the single-threaded model). To conclude the overview part of the talk, Nathan mentioned iisnode, which is what the Azure Web Sites infrastructure uses to host Node.js apps on Azure. iisnode can scale node.exe processors to multicore machines, and now has also WebSockets support with Windows Server 2012.Then, Nathan turned to the demo. In the demo, he started with a local website that uses socket.io for WebSockets, mentioned some developer tools like node-supervisor and node-inspector, and then uploaded the Node app to Azure and developed a simple Windows 8 JavaScript app connected to the same server. At the very end of the talk, he even managed to squeeze in a quick demo of the azure Node module, which he used to access Azure Storage from the on-premises Node app.

All in all, this has been a nice overview of Node and Windows Azure in just sixty minutes. I will definitely be applying some lessons from this talk to my own presentations ;-)

I am posting short updates and links on Twitter as well as on this blog. You can follow me: @goldshtn

Published at DZone with permission of Sasha Goldshtein, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)