Category Archives: software development

The battle for the dominant Web API

Thought-provoking post from Joel Spolsky on web client APIs. He says that whoever has the best AJAX library will be the next Microsoft.

Spolsky dismisses “the p-code/Java model” (which would include Flash and Silverlight 1.1 as well as Java applets):

Sandboxes are penalty boxes; they’re slow and they suck, which is why Java Applets are dead, dead, dead. To build a sandbox you pretty much doom yourself to running at 1/10th the speed of the underlying platform, and you doom yourself to never supporting any of the cool features that show up on one of the platforms but not the others.

I don’t follow his logic here. First, “sandboxes” may be slow compared to true native code, but they are faster than any browser-hosted Javascript, at least until Tamarin comes along. Second, AJAX apps are generally as much or more hobbled than plug-in applets.

I’m not dismissing the idea of compiling to Javascript though. There are interesting projects that do this already. In addition, Spolsky seems to be thinking along the same lines as Microsoft’s Eric Meijer, who told me about the misleadingly-named “LINQ 2.0”. But I think plug-in based apps will be important as well, both as entire applications and as rich components within AJAX apps.

Personally I hope there will not be a “new Microsoft.” I’d like to see diversity based on web standards.

Scott Guthrie on .NET futures

I’ve posted my interview with Scott Guthrie, from the UK Mix07. It covers topics including LINQ, Silverlight, the work with Novell/Mono on Moonlight (Silverlight for Linux), ASP.NET futures including MVC, and offline web applications.

Guthrie is a General Manager at Microsoft, responsible for most of the development teams working on .NET. He did some excellent presentations at the UK Mix, intermingling live coding and demos with slides, talk, and dealing with ad-hoc questions – not an easy task.

There were several things I found interesting in his answers to my questions. On a technical level, the way Microsoft’s various implementations of the Common Language Runtime share code is intriguing. In particular, I was fascinated to learn that Silverlight and the desktop CLR are built from the same code tree. There is a second code tree for the CLR, but it is for the Compact Framework, not for Silverlight. The implication is that the performance of Silverlight and its compatibility with other .NET code should be pretty good.

How then is Silverlight much smaller than the desktop CLR? The reason is that most of the Framework library is missing. That’s the trade-off.

Another point of interest is the strength of Guthrie’s reaction when I asked about offline web applications, and Microsoft’s platform versus other approaches such as Google Gears and Adobe AIR. When a spokesperson takes the trouble to trash the competition, it is often a sign of concern.

CodeGear’s Ruby on Rails IDE is released

CodeGear has released its IDE for Ruby on Rails. Called 3rdRail, it installs an instant Ruby on Rails environment, and features code completion, project management, refactoring and integrated debugging. The Eclipse-based IDE runs on Windows, Mac and Linux, and a 30 day trial is available. I’m downloading it now.

Technorati tags: , , , ,

Want a job? Learn Silverlight, not WPF

I keep an occasional watch on technology trends in the UK by the haphazard technique of browsing to Jobserve.com, bashing in some developer platforms, and seeing how many vacancies come up. I last blogged about this in August 2006, and before that in January 2006, March 2005, and August 2004.

Real-world job vacancies trail the conversation we have about cutting-edge web platforms by some margin. To give you an idea, in March 2002, three months after the first official release of C#, Jobserve had just 153 vacancies for C# developers, compared to 1894 for VB and 2092 for Java. Today, C# has 2933, VB and VB.NET 1906, Java 3741.

But that’s not what caught my eye when I looked this morning. I searched first for WPF, and then for Silverlight. WPF went final in November 2006, at about the same time as Vista was released to manufacturing. That’s nine months ago, but Jobserve has only 28 jobs which specifically mention WPF.

Silverlight 1.0 was released earlier this month. It’s a great video player, but many developers are waiting for Silverlight 1.1, due sometime in 2008, which supports .NET programming as well as multimedia. Component vendor Infragistics told me at the UK Mix07 that it is not bothering to release components for Silverlight 1.0, but has lots in the pipeline for 1.1. Keen to work with Silverlight in the UK? Jobserve has just 30 jobs to choose from.

The numbers are tiny (thought let me note, even CodeGear’s long-established Delphi can only muster 93 jobs), but I’m intrigued that Silverlight is actually a hair ahead of WPF in this context. Tomorrow it may be different; but it accords with my own assessment. I like WPF; it’s a better API than Win32 for coding a GUI. But it is a hard sell to developers of those boring business apps that make up the bulk of software development today. Unless you are making big use of visualization, it’s likely you will be more productive with tried-and-tested Windows Forms, or native Win32 code.

Silverlight is different. It is an immediate win if you have desktop .NET apps which you would like to convert to web applications, or ASP.NET apps for which you would like a richer client. Why Silverlight and not WPF? For one thing, cross-platform, essential for public web applications and very useful internally as well, with all those Mac-using designers (and now the CEO wants a Mac too). For another thing, lightweight deployment. When you install or upgrade the .NET runtime on a Windows box, you hold your breath as it updates a gazillion system components and hope that no bizarre error code appears. When you install Silverlight, you just click OK to a browser dialog, and it works.

The contradiction in the title of this post is that both Silverlight and WPF use XAML, so in learning one you are to some extent learning the other. Nevertheless, I now believe that Silverlight will be a more significant platform than WPF, and I’ll be interested to see if future job vacancies back up that prediction.

Update: Ryan Stewart has some US figures which are more positive for WPF, though again the absolute numbers are small. Interesting to watch.

Transactional memory draws applause at Mix07 UK

Simon Peyton-Jones from Microsoft Research in Cambridge enthused about transactional memory during the “Sneak Peeks” session at Mix07 in the UK.

I have mentioned this before on this blog; it is also favoured by Herb Sutter as a better way to do concurrent programming.

Peyton-Jones says it will eliminate a whole class of bugs from our code; perhaps this was one reason for the warm reception for his presentation.

He is a Haskell fan, and says this is best way to experiment with transactional memory now. It is not something that can easily be introduced into other languages, but will require some radical re-engineering.

Technorati tags: , , , , ,

Microsoft to support PHP in Expression Web 2.0

The closing session of UK Mix07 was a “Sneak peeks” in which we were shown a variety of snippets of varying degrees of interest. One was a brief glimpse of Expression Web 2.0, Microsoft’s web design tool, showing “PHP script” on the File – New menu.

The extent of this support was not discussed. The minimum would be some level of syntax highlighting, which would be trivial to implement, so this may not amount to much. Still, it is interesting as a sign of the times. When I spoke to some folk from Zend a couple of months ago, they emphasised their IIS support and good relationship with Microsoft, so it looks as if both sides want to play nicely together.

Microsoft Silverlight vs Adobe Flex

I am at Mix07 in London. Having looked in some detail as Adobe Flex and AIR in recent weeks, it is interesting to compare and contrast. I am looking primarily at the developer aspect, rather than video or multimedia.

Silverlight is not a direct competitor to Adobe AIR, in that it does not run outside the browser (though I guess you could do something funky with an embedded browser control). It is a closer competitor to Flex, though there is no exact equivalent to Adobe LiveCycle, which is not needed for Silverlight. However, the two technologies do have a number of parallel features, including the following:

  • Cross-platform runtime – Windows, Mac and Linux (the last a recent Microsoft announcement)
  • XML language to define the GUI
  • Embedded video capability
  • Timeline for animations etc.
  • Strongly-typed, object-oriented language with just-in-time compilation
  • Easy access to XML web services
  • Dedicated design tools (Expression Blend for Silverlight, Flash IDE for Flex and AIR)
  • Dedicated developer tools (Visual Studio for Silverlight, FlexBuilder for Flex and AIR

So what are the differentiating factors? There are some obvious differences. For example, Flash 9.0, and therefore Flex, runs on Windows 98; Silverlight 1.1 will not. On the Silverlight side, there is the advantage of language choices: Silverlight allows Visual Basic, C#, Python or Ruby. Flex has only Actionscript 3.0.

The real difference

These technical differences are dwarfed by cultural factors. Microsoft’s advantage is the comfort factor of Silverlight for developers already familiar with Visual Studio and C#, and perhaps beginning to look at WPF. Microsoft does strong tools, and FlexBuilder does not currently come close. This will help establish Silverlight for enterprise development. With increasing numbers of Macs popping up incoveniently in Windows networks, Silverlight could soon find a role. Similarly, for ASP.NET developers who want to give users a richer client, Silverlight is a compelling option.

Adobe’s strength is that it already has a strong hold on the designer community. While the Expression products are being well received, they would have to be extraordinary to win substantial numbers of switchers from Flash, Dreamweaver, Photoshop and so on. Adobe also wins on deployment. Flash is well established, whereas Silverlight is new; it will be especially hard for Microsoft to place it on non-Windows mobile devices.

I don’t see either of these technologies failing. I suspect Microsoft is introducing Silverlight in time to stem a bleed of .NET developers to cross-platform development with Flex and perhaps AIR, but I would be surprised to see large numbers of defections from Adobe’s camp.

Interesting questions

A few questions to which I do not yet know the answer:

  • How does the performance of Microsoft’s IL + JIT compiler compare with Adobe’s Actionscript 3.0 + JIT compiler? On Windows and on other platforms?
  • Adobe’s AMF protocol is more efficient than XML for data delivered via web services. Is this a significant performance benefit?
  • MXML vs XAML. My impression is that WPF is more expressive, but I have not researched it sufficiently to back this up. I would be interested in comments.

As ever, your thoughts are welcome.

Silverlight at Mix07 UK

I’m at Mix07 in London and Developer Division General Manager Scott Guthrie is talking about how to code a Silverlight 1.1 application. For me, it follows detailed briefings from Adobe on Flex and AIR, so I’m interested in comparing and contrasting the two technologies – look out for a post on this soon. I’m not going to go over every detail of Silverlight here – there are other places where you can do that – but will pick out some details that struck me as interesting, from Guthrie’s two sessions today.

Guthrie’s approach was to run through Silverlight 1.1 features using sample code, live demos and the occasional foray into Expression Blend. He focused on the developer perspective and showed lots of C# code, so the session was of little help if you want to work with the current 1.0 release, which lacks .NET support. If you want to try Silverlight 1.1 today, you can download an alpha release, along with Visual Studio 2008 Beta 2 and Expression Blend 2 Preview. There is a fair amount missing in the current Silverlight 1.1 alpha, as we discovered.

Silverlight 1.1 will run on Mac, Windows and Linux, the last of these via a new partnership with Novell and Mono. On Linux, target browsers will include Konqueror, Firefox and Opera.

Guthrie showed how to put together a simple Silverlight app – pretty easy, if you have any web design experience. In essence, you define a GUI in XAML, and then write code in C#, VB, Python or Ruby. Code is compiled to .NET IL (Intermediate Language); XAML is parsed at runtime but can be embedded as a resource. Apparently Silverlight apps will be compressed into Zip files by default in the final release, which will improve download time and may help with firewall issues – some firewalls block DLL files.

Silverlight 1.1 controls and layout

The current Alpha has few controls, but this will change in the final release. Available controls will include:

  • TextBox
  • CheckBox, ComboBox, Radio Button
  • ListBox, GridView
  • Slider, ScrollBox

Some controls will be data-aware, and it will apparently be easy to bind something like a GridView to data on a remove server, with data delivered via web services.

I asked about rendering HTML in Silverlight. There is no HTML control, but you can overlay HTML rendered by the browser, and in addition some folk have been working on a custom XHTML control.

The current alpha does scaleable x y layout (a slightly confusing idea); but there will be layout managers in the final release, including a StackPanel and a Grid.

I asked about a licensing model for commercial controls. Guthrie says there will not be one initially, but Microsoft will explain how to roll your own – I got the impression this might use Silverlight’s DRM features.

Skinning

Another important forthcoming feature is skinning. Guthrie explained this as being like using an external CSS stylesheet (though it is not CSS). This is a designer-friendly approach and helps to reduce download size.

HTML interaction

Silverlight gives access to the browser DOM from managed code. In addition, a [Scriptable] attribute lets you access managed code from Javascript in the browser. Guthrie showed how this enables an interesting scenario: doing UI entirely in the browser, and using Silverlight as a non-visual control/library. The win here is that you can code in C# rather than Javascript, and get the benefit of just-in-time compilation as well as the Silverlight library functions.

Caching and cross-domain access

Silverlight relies on the browser to cache previously downloaded code and assets. Currently it can only access files from the application’s source domain, but there will be a way to do cross-domain access for controls and for web service calls – I believe this will use the concept of trusted domains, rather than being unrestricted. There will be limited local storage using the .NET isolated storage model, but this will be restricted to 1MB per store, and will reside in the browser cache, so it is not very dependable*.

Web service support and LINQ

Silverlight will support JSON, WCF and SOAP. It will also include LINQ, with the possibility of creating custom LINQ data providers – Guthrie mentioned possibilities like a LINQ provider for Amazon’s S3 service.

Async support and threading

Silverlight supports asynchronous calls to web services. It will also include a BackgroundWorker class for long running tasks.

Windows Mobile

A delegate asked when we will see Silverlight for Windows Mobile. Guthrie says this is planned, but said deployment was a greater challenge than technical implementation. The problem is dealing with several parties: device manufacturers, mobile operators, etc. It is hard to imagine Steve Jobs allowing Silverlight onto the iPhone; but I would have thought a Silverlight implementation for Enterprise deployment onto Windows Mobile devices would be feasible and useful. No timescale was given for a Windows Mobile implementation.

Quick reflection

This is a Microsoft-platform crowd and generally seem impressed with Silverlight, which gives them an easy route to browser-hosted, cross-platform .NET applications. If Microsoft hoped that an event like this would attract existing Flash developers interested in alternative platforms, let me just say that I do not see any evidence of this, even in the design-focused tracks. It will be a long haul.

As for Silverlight vs Adobe Flex and AIR (FLAIR?) – that is a subject for a separate post, which I hope to do shortly.

*Update: I’m not yet clear how isostorage works, despite talking to Scott Guthrie about it. Does it live in the browser cache or outside it? If it lives outside the cache, how is it that clearing the cache clears the store (Guthrie seems definite about this)? If you have two browsers, does a domain get two separate isostores, or one shared store? I’m trying to get more information about this.

Silverlight is released for Windows, promised for Linux

Microsoft’s Silverlight is now fully released. Scott Guthrie’s blog has all the details, including what to me is the biggest news: an official partnership with Novell and Mono to support Moonlight, an implementation of Silverlight for Linux. Microsoft will supply the media codecs, while Novell/Mono will do the rest.

This is a major step forward for Microsoft. I have been blogging for years about how Microsoft would benefit by giving official support to Mono, and therefore promoting the .NET platform. Of course it is a two-edged sword. Mono is a competitor, and helps companies switch from Windows to Linux. On the other hand, Silverlight has no chance of broad adoption unless it is taken seriously as a cross-platform runtime, and supporting Linux will help a great deal with that.

Silverlight 1.0 does video, multimedia and vector graphics, but does not include the .NET runtime. This is to follow in Silverlight 1.1, which will therefore be of more interest to developers.

I see quite a bit of misunderstanding of how Silverlight relates to the full version of .NET. As I understand it, even Silverlight 1.1 makes no use whatsoever of the full .NET runtime or WPF (Windows Presentation Foundation). It is entirely self-sufficient, so you can run Silverlight 1.0  or 1.1 on a Windows box which does not have .NET installed.

Technorati tags: , , ,