C# 4.0 goes dynamic

Anders Hejlsberg is explaining new features in C# 4.0, a future version, at Microsoft’s PDC. The big new feature, he says, is support for dynamic typing. Currently C# uses static typing, which means that when you call object members like methods and properties, the compiler checks that they exist or raises an error if they do not. By contrast, with dynamic typing you can call any old method or property, and they are not checked until runtime.

C# 4.0 will support dynamic typing through a new static type called “dynamic” (this raised a laugh at PDC). In other words, if you declare a variable as dynamic:

dynamic obj;

then you can call what you like as if it were a member of obj, and it will be resolved at runtime.

Hejsberg showed in his demonstration how this simplifies interop with other dynamic languages like JavaScript or Python.

Other new features are named parameters and optional parameters. This is a big win for COM interop – automating Microsoft Office, for example, from C# has always been painful because COM was designed to support optional parameters. C# got round this with an ugly hack “ref.missing”. All gone in C# 4.0.

Technorati tags: , ,

Hello Windows Azure

Ozzie has made his big announcement here at PDC 2008. Windows Azure is, he says, Windows for the cloud; a “web tier” offering that runs on Microsoft’s own datacenters. The basics: develop a web service in Visual Studio, deploy it to Azure. You can test and debug using a local Azure server. The client for Azure apps can be anything that can call a service – web app, Silverlight app, Windows app. Your Azure apps can call upon a set of other services many of which are already familiar. For example, the database is SQL Services, formerly called SQL Data Services. Workflow can be managed with Workflow Foundation (WF). For identity and access control, there will be an Active Directory connector, or other options (more on this later).

Note that Azure is a platform for hosted applications, written in .NET but eventually with an option for native code, rather than a VM running Windows in the manner of Amazon’s EC2 service. Thus, Azure has more in common with Google App Engine than with what Amazon is offering. Microsoft’s slides also show Sharepoint, Live Services, and Dynamics CRM as part of the Azure platform.

Microsoft will compete on things like the scope and ease of use of its platform. Integration with Visual Studio and Active Directory should make it relatively easy for Microsoft platform developers to start experimenting with enterprise apps hosted on Azure. Business model not spelt out yet, but the assumption is that Azure apps will scale seamlessly and on-demand.

Technorati tags: , ,

PDC 2008: Microsoft attempts to remake its image

There are two big themes at Microsoft’s Professional Developer’s Conference, just getting under way here in Los Angeles.

One is cloud computing. At this morning’s keynote, Ray Ozzie and others will present Microsoft’s cloud computing strategy. If it’s right that IT is moving inexorably into the cloud, this could be make-or-break for the company. Truth is, despite huge number of users for things like Hotmail and Live Messenger, Microsoft is not perceived as a web or on-demand computing company. That space belongs to others, like Google or Salesforce.com. Further, Microsoft has a problem that those companies do not have: how to keep its partners happy while embracing a computing model that may severely reduce their role.

The other is Windows itself. Vista’s image is tarnished: the wow started badly, and although the OS itself now works better than it did at the launch, its negative perception is beyond rescue. Windows 7 is Microsoft’s next opportunity to generate some consumer and user enthusiasm for Windows, and to stem the flow towards Apple. Tomorrow is Windows 7 day.

We’re also going to get insight into the future of key technologies like .NET, the next version of C# and Visual Studio, the Oslo modeling platform, Microsoft’s plans for identity management, and plenty more.

I’ll be blogging and tweeting as I can during PDC. I’m also keen to know what you think, whether or not you happen to be here in LA (the keynotes are being streamed over the Internet).

Technorati tags: , , ,