All posts by onlyconnect

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.

Windows Live: why doesn’t SkyDrive integrate with Office?

Dare Obasanjo blogs about Windows Live, and refers us to get.live.com where you can sign up for a number of free services.

I think Spaces is great, except that performance seems sluggish (though it’s getting better), and Live Writer is my blogging tool of choice. So there’s stuff here I like, but what is of most interest to me is Sky Drive. I’m a big fan of web storage, because it means you can work from several machines and everything stays up-to-date. It is also an effective off-site backup. Currently I use a subversion repository on my own site for this. I also use Amazon S3. Both are excellent, but saving and loading documents is not quite a seamless process. To see what I mean, consider the steps you would have to explain to a non-expert user. Then compare this to what most of us do every day: open a document, work on it, then hit save.

The puzzle is why Microsoft has not built this feature into Office. This is meant to be an advantage of the Microsoft platform: a single vendor stack in which everything plays nicely together (Apple does this better, of course).

One of the first things I did with SkyDrive was to copy an Excel file into it. That works fine, either through browser upload, or by drag-and-drop if you install the upload ActiveX control. Just for fun, I then went back to SkyDrive and “opened” the Excel document from it. What this really does is to download the file to a temporary location, and opens it from there. Everything seems fine until you hit save. Then you get:

Your changes could not be saved to ‘somesheet[1].xls’ because of a sharing violation. Try saving to a different file.

Click OK, and then I get a weird message about a file with a meaningless name having the wrong extension – because apparently Excel automatically saved to another temporary file without an extension. Bizarre behaviour.

Ok, I admit, I knew this would not work. But isn’t this how it ought to work? I think this would be a killer feature for Office and Windows Live: foolproof open and save from/to web storage.

I also think Office should cope better with what is, from the user’s perspective, a rather obvious sequence of steps.

Zoho has a plug-in that nearly works right, though it has two major flaws. One, it did not work properly for me at all, but just threw errors on saving. Two, it converts Office into Zoho’s online format. I understand why this is the correct thing for a Zoho plug-in to do, but I’d rather keep documents in their native format and forego true online editing.

ODF vs OOXML: A plague on both your houses

I’ve been writing a piece on Linux/Windows interoperability, and broached the tricky matter of file formats.

It struck me forcibly how much the situation has changed for the worse, for the average user who could not care one jot about XML or ISO for that matter.

Prior to Office 2007, at least a Microsoft Office user could email documents to a Linux Open Office user and they would most likely open OK. Now that’s no longer the case.

I guess Open Office users have always had to make allowance for Microsoft users by doing Save As or setting their defaults to compatible formats, when emailing documents the other way or sharing them on a network. That’s no better today. Open Office defaults to ODF which a default install of Microsoft Office will not open.

Both sides would probably say that this is the problem they are trying to solve. Nevertheless, from the user’s perspective we have gone backwards.

What a shame that Microsoft, IBM, Sun and so on were not willing to engage with each other to adopt a common standard acceptable to all parties, instead of treating document formats as a competitive weapon, never mind how much users suffer.

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: , , ,

Will Adobe’s tools ever run on Linux?

At an Adobe briefing last week I mainly ran Ubuntu Linux on my laptop. It seemed a good opportunity to ask Software Architect Kevin Lynch whether Adobe’s tools like Dreamweaver or the Flash IDE will ever support Linux:

We’re constantly looking at Linux as a platform for our applications. Our runtimes work on Linux; Flash Player runs on Linux; AIR will run on Linux. It may make sense to bring our tools there. There’s a relatively inexpensive way to bring tools to Linux called Wine. It’s not the best way to do it, but it kinda works. We’ve done that a couple of times with tools to see what the response is. Will people adopt them, do they care? We haven’t yet seen that momentum happen. But we’ll keep trying things occasionally, and if we start to see momentum, we’ll start investing more. Until then, we’ll stay at the runtime level.

Kevin Lynch

Kevin Lynch, Adobe Senior Vice President, Platform Business Unit and Chief Software Architect

My comment: considering the limited adoption of desktop Linux, and the free software culture among many Linux users, I doubt Adobe is losing many sales because of its Mac/Windows tools policy. That could change, and the answer I got from Lynch was more positive than I had expected – though don’t expect a CS3 Linux release any time soon.

Technorati tags: , , ,

Adobe AIR: 10 reasons to love it, 10 reasons to hate it.

I attended two days of briefings on Adobe’s developer-focused products, especially the forthcoming AIR (Adobe Integrated Runtime).

In essence, AIR is the Flash player supplemented by additional features to enable applications that are not browser-hosted, but installed as desktop applications. AIR is great for some scenarios, weak for others. Here’s 10 reasons to love it:

1. Fast execution. ActionScript 3.0 has a JIT (just-in-time) compiler, putting it on a par with Java or .NET for raw performance.

2. Cross-platform. AIR apps will run on Windows XP and Vista, Mac OS X (PowerPC and Intel), Linux (though not in the beta).

3. Easy conversion of existing Flex or HTML applications. It’s the same basic runtime. In the case of HTML, AIR apps rely on WebKit, the core component in Apple’s Safari web browser.

4. Easy installation. Provided the runtime has installed successfully, installing AIR applications is likely to be be trouble-free, since all the files go into the application directory.

5. SQLite. AIR applications have use of a fast local database.

6. Synchronization services provided you use LiveCycle. Synchronization is the difficult part of enabling offline support in occasionally connected applications.

7. Rich design and multimedia. This is Flash, so ideal for highly customized UIs, animation, sound and video. Adobe is proving the point by creating a media player built with AIR. Existing Flash developers can easily use their skills to build AIR applications.

8. Great for web vendors who want a desktop presence. For example, one of the demo applications is for buying on eBay. If eBay persuades you to install it, then it is no longer dependent on you firing up a web browser and navigating to its site. It is also a good way to disintermediate Google.

9. Declarative programming via FLEX. Declarative programming is the best way to code a GUI and consume components.

10. ActionScript 3.0 combines the flexibility of JavaScript with grown-up object orientation. Option for dynamic or strict typing according to developer preference.

So is AIR your next development platform? Maybe, but there are some downsides:

1. Limited extensibility. AIR apps have file access, clipboard access, support multiple windows, support drag and drop, and can trigger notifications (“toast” in Windows). If you app needs to interact with the desktop in other ways, the chances are that AIR is not suitable. For example, there’s no access to COM automation, and no way to execute external applications. The reason is to maintain cross-platform compatibility. That’s a worthy goal, but it would be good to have a way out of the sandbox. Unlike Java or .NET, you cannot extend AIR with custom native code libraries. Nor can you call operating system APIs.

2. Database access limited to SQLite or web services.

3. Enterprises need to roll out applications over the network in a controlled manner. AIR has no specific support for enterprise deployment. On Windows, AIR does not use the Windows Installer service. Either Adobe or 3rd parties will need to create deployment wrappers to overcome this.

4. Proprietary technology. AIR applications depend on Adobe’s runtime.

5. No threading support. Architect Kevin Lynch says this is a strong candidate for a future release.

6. No model for commercial components. It is not clear to me how a component vendor could sell an AIR component while protecting it from unlicensed deployment. This may limit the availability of 3rd party components, with a corresponding impact on productivity.

7. Schizophrenic development model. AIR supports either Flex development, or HTML applications which run in WebKit. The ugly side of this flexibility is that there are two SDKs, even two JavaScript virtual machines with different capabilities and characteristics. While it is nice to have a way to render HTML, I am not convinced that the web application model is worth it, given the complications it causes. After all, web applications run perfectly well in the browser.

8. Security concerns. AIR is close to the worst of both worlds, being tightly sandboxed from a developer perspective, but not particularly safe from the user’s perspective. Adobe says it will allow unsigned applications, which I think is a mistake.* AIR has the same access to the file system as the user, which in the case of users running on Windows XP with full admin rights is very extensive. Example bad scenarios would include downloading malware and placing it your startup folder, or searching your file system for bank details and uploading them to some internet location. That said, Adobe says there will be more security features, so conclusions are premature.

9. Synchronization service depends on LiveCycle, the server-side piece which runs on J2E application servers. This is one of the ways Adobe makes money out of AIR, with the other obvious one being design and development tools. A consequence of point 4 above.

10. Lack of UI standards may lead to annoying inconsistencies between AIR applications. We are used to this on the Web; now it is coming to the desktop as well.

*I was told that application signing is not required, but Daniel Dura comments below that this is not the case; however he says self-signed applications will be allowed. Perhaps this is one of the things under discussion. Personally I think the default should be to require applications signed by a trusted certificate, but to provide a way for developers to switch this off.

Technorati tags: , ,

Hands on with the iPhone

I am in San Francisco this week and got to play with an iPhone for the first time.

Very cool device, but I am not sure I could live with the keyboard (or lack of it). I typed a short message and found it painful; you simply cannot see which key you are pressing until the result appears, often not the one you wanted. It is fine for numbers, since the virtual keys are larger.

In mitigation, the iPhone has text recognition algorithms that take this into account. If you have faith, then quite often the word you wanted does appear, even though you mis-typed it. Fair enough, but I prefer a real keyboard which gives you tactile feedback. That said, I agree with the decision not to resort to a stylus, which is always a nuisance on a handheld device.

Omitting a physical keypad does mean the iPhone has a larger screen than most devices of its size, and as you would expect the multimedia is nicely done. Unfortunately I am a text-oriented user, so I would rather have a real keyboard and a smaller screen. And yes, I am a QWERTY user.

Could I learn to love the soft keyboard? Possibly, but there is also the price to consider. The iPhone seems extraordinarily expensive for a locked-down device. I’ll be interested to see what the UK pricing is like when it appears there in due course.

Technorati tags: ,

Ubuntu Linux on a Tablet PC

I am currently writing about Ubuntu Linux, and for convenience and interest decided to install it on my Toshiba M400 Tablet. I could have used Virtual PC, but although virtual PC and the like undoubtedly have their place, there is no substitute for a real install if you want to get the full flavour of an operating system.

What follows are a few notes on how the installation went, and a few comments on Ubuntu itself.

Install hassles

Ubuntu usually installs easily, but my scenario was a little unusual. One of the M400’s features is that you can remove the DVD drive and replace it with a second hard drive, and this is how I usually run it. I have Windows Vista installed on the primary drive, and Windows XP on the second drive. I can boot from either one by changing the boot priority in the BIOS.

I didn’t want to tinker with the main Vista drive, so I decided to put Ubuntu on the second drive. This means allowing the Unbuntu installer to repartition the disk, always an alarming prospect. A further complication is that Ubuntu is normally installed by booting from CD, not possible in my case because I had removed the DVD drive.

The solution was to boot from a USB drive. This proved surprisingly tricky. I created what I thought was a suitable installation on a USB stick, but all I got for my trouble was a winking cursor at top left of the screen. I tried again with a different configuration, but I still could not boot. Finally I tried a third USB stick, an old one with a measly 128MB space. It booted fine, so the first lesson is to pick the right pen drive. 

I selected a desktop install, and chose a partitioning scheme. It downloaded the required packages from the Internet and announced a successful installation. The installer offered to modify the boot record on my second (Windows XP drive) to enable booting into any of my three operating systems, and I let it do so.

Problem. After rebooting the laptop reported “Missing operating system”. Worse still, I could no longer boot from the USB stick, which reported Grub Error 22. Not good.

I was saved by a handy boot recovery tool called Super Grub Disk. This started nicely from USB and offered to fix my broken Grub (a Linux boot utility). I let it do its thing, following which I could boot into the Grub menu. Unfortunately the only option that worked was Windows Vista. If I tried to start XP or Ubuntu, I got “Drive does not exist”.

One of Grub’s features is that you can modify the startup parameters on the fly, or access a simple command line. I soon figured out the problem. The auto-generated menu.lst was trying to use a non-existent hd2. In reality, my drives are detected as hd0 and hd1. A few straightforward edits later, I was up and running. I can even boot Vista without fiddling with the BIOS, thanks to Grub’s map command which is able to reverse the drives on the fly.

Better than expected

Ubuntu on this Toshiba exceeded my expectations. Sure, there is no full Tablet functionality with handwriting recognition, although the Tablet pen works as a mouse, which is a good start. Otherwise, most things work. The OS is  stable. The wireless works, the touchpad works, the sound works, USB drives work (of course).

It’s not perfect. No Bluetooth. And the biggest irritant is suspend and resume. This worked once, but crashed on resume the next time I tried it. Hibernate failed too.

There is also something odd about cold booting. The Grub menu works, but you can’t actually see it; the laptop just shows a slightly corrupt Toshiba BIOS splash screen. Do a second, warm reboot, and the menu appears fine. Still, bearing in mind that this is an out-of-the-box install on a laptop designed only for Windows, I think it is a good effort.

Ubuntu vs Windows

Ubuntu is not as polished as Vista or even XP, let alone Mac OS X. The fonts look less good; the apps are (even) less consistent in look and feel, and some still come across as a bit home-made. Nevertheless, there are things that it does better than Windows. I like the Applications menu, which is sorted by type of app – Games, Graphics, Internet, Office, Programming – instead of jumbling everything together in one Programs group. And I love the way Add/Remove programs is integrated into the menu. I wanted to install Audacity, the sound editor. Type Audacity into the search box, check the box when it comes up in the list, click Apply, and seconds later, there it is. I guess this works best in a free software world, but there is no inherent reason why something equally easy cannot work with commercial software; it simply needs an extra step where you take payment, or installation of an upgradable trial version.

A related feature shows up in the command line. Type svn (for the Subversion client) and you get a message:

    The program ‘svn’ is currently not installed. You can install it by typing:
    sudo apt-get install subversion

It reminds me of the advertisement feature in Windows Installer, except that is for application features, whereas this is for entire applications. Further, it is much simpler and more reliable in Linux.

I was interested to note that Mono is installed by default, and MonoDevelop is listed in the package manager, making it easy to get up and running with .NET development if you feel so inclined.

What else is better? Notably, performance. Everything seems quicker. Another thing is workspaces, which let you switch between multiple desktops. I really don’t know why Windows does not surface this feature, which PC Tools for Windows did nicely all those years ago. Windows does have multiple desktops, but it is hidden except in the context of “Switch user”.

Linux is still geeky, but it is getting more user-friendly, especially in Ubuntu. I wish Microsoft had put equal focus on the user in Windows Vista versus XP. I like Vista better than XP, but it could and should be better than it is.

Technorati tags: , , , , ,