Tag Archives: visual studio

Silverlight versus HTML, Flash – Microsoft defends its role

Microsoft’s Brad Becker, Director of Product Management for Developer Platforms, has defended the role of Silverlight in the HTML 5 era. Arguing that it is natural for HTML to acquire some of the features previously provided by plug-ins – “because some of these features are so pervasive on the web that they are seen by users as fundamentally expected capabilities” – he goes on to identify three areas where Silverlight remains necessary. These are “premium” multimedia which merges video with application elements such as conferencing, picture in picture, DRM, analytics; consumers apps and games; and finally business/enterprise apps.

It is the last of these which interests me most. Becker’s statements come soon after the preview of Visual Studio LightSwitch, which is solely designed for data-driven business applications. Taking the two together, and bearing in mind that apps may run on the desktop as well as in browser, Silverlight is now encroaching on the territory which used to belong to Windows applications. With LightSwitch in particular, Microsoft is encouraging developers who might previously have built an app in Access or Visual Basic to consider Silverlight instead.

Why? Isn’t Microsoft better off if developers stick to Windows-only applications?

In one sense it is, as it gets the Windows lock-in – and yes, this is effective. I’m aware of businesses who are tied to Windows because of apps that they use, who might otherwise consider Macs for all or some of their business desktops. On the other hand, even Microsoft can see the direction in which we are travelling – cloud, mobile, diverse clients – and that Silverlight fits better with this model than Windows-only desktop clients.

Another consideration is that setup and deployment issues remain a pain-point for Windows apps. One issue is when it goes wrong, and Windows requires skilled surgery to get some app installed and working. Another issue is the constant energy drain of getting new computers and having to provision them with the apps you need. Microsoft has improved this no end for larger organisations, with standard system images and centralised application deployment, but Silverlight is still a welcome simplification; provided that the runtime is installed, it is pretty much the web model – just navigate to the URL and the app is there, right-click if you want to run on the desktop.

If Microsoft can also establish Windows Phone 7, which uses Silverlight as the runtime for custom apps, the platform then extends to mobile as well as desktop and browser.

The downside is that Silverlight apps have fewer capabilities than native Windows apps. Printing is tricky, for example, though Becker refers to “Virtualized printing” and I am not sure what exactly he means. He also highlights COM automation and group policy management, features that only work on Windows and which undermine Silverlight’s cross-platform promise. That said, via COM automation Silverlight has full access to the local machine giving developers a way of overcoming any limitations if they are willing to abandon cross-platform and browser-hosted deployment.

A winning strategy? Well, at least it is one that makes sense in the cloud era. On the other hand, Microsoft faces substantial difficulties in establishing Silverlight as a mainstream development platform. One is that Adobe was there first with Flash, which has a more widely deployed runtime, works on Android and soon other mobile devices, and is supported by the advanced design tools in Creative Suite. Another is the Apple factor, the popular iPhone and iPad devices which are a spear through the heart of cross-platform runtimes like Silverlight and Flash.

Finally, even within the Microsoft development community Silverlight is a hard sell for many developers. Some us recall how hard the company had to work to persuade Visual Basic 6 developers to move to .NET. The reason was not just stubborn individuals who dislike change – though there was certainly some of that – but also existing investment in code that could not easily be migrated. Both factors also apply to Silverlight. Further, it is a constrained platform, which means developers have to live with certain limitations. It is also managed code only, whereas some of the best developers for both desktop and mobile apps work in C/C++.

I suspect there is division even within Microsoft with regard to Silverlight. Clearly it has wide support and is considered a strategic area of development. At the same time, it is not helpful to the Windows team who will want to see apps that take advantage of new features in Windows 7 and beyond.

Yesterday Windows Phone 7 was released to manufacturing, which means the software is done. Another piece of the Silverlight platform is in place; and I guess over the next year or two we will see the extent to which Microsoft can make it a success.

Develop for Adobe Flash/Flex in Amethyst for Visual Studio

SapphireSteel Software is poised to release Amethyst, which lets you develop Flash and Flex applications with Microsoft’s Visual Studio 2008 or 2010.

Why bother? There’s two aspects to this. One is simply the comfort factor: if you are a .NET developer used to Visual Studio, but now working on Flash or Flex, this could be an easier way in than the Eclipse-based Flash Builder. There is a visual designer, a full-featured debugger, a property inspector with sections for properties, events, effects and styles, for example, and double-clicking an event generates an event handler as you would expect.

The other factor is areas where Amethyst can improve on what Flash Builder offers. One example is ActionScript refactoring, disappointing in Adobe’s product. Amethyst is not brilliant, but does have a few extras including Extract Method, Encapsulate Field and Extract Interface.

image

Another useful feature is that Amethyst can share projects with Flash or Flash Builder. Before you get excited, it does not do the magic you might want, Visual Studio editing of .fla files with embedded ActionScript. It does work reasonably seamlessly though: you can open .fla file in the Flash IDE by clicking within Amethyst.

This would have been even more interesting if Adobe had not added a measure of Flash Builder integration in Flash Professional CS5; and that is the challenge facing SapphireSteel – how to keep up with Adobe’s official development tools.

I’ve only played briefly with Amethyst but although I’ve been impressed with it in some ways, I also found myself missing features in Flash Builder, such as the Connect to Data wizards, and the view state management.

It is early days though; and I would be interested to hear from others who have tried Amethyst on what they do or do not like about it.

Price is not yet stated, but SapphireSteel also offer a Ruby product which is priced at $49 for a basic edition, or $199 for a professional version. Amethyst also comes in two editions so perhaps we will see something similar.

Ten things you need to know about Microsoft’s Visual Studio LightSwitch

Microsoft has announced a new edition of Visual Studio called LightSwitch, now available in beta, and it is among the most interesting development tools I’ve seen. That does not mean it will succeed; if anything it is too radical and might fail for that reason, though it deserves better. Here’s some of the things you need to know.

1. LightSwitch builds Silverlight apps. In typical Microsoft style, it does not make the best of Silverlight’s cross-platform potential, at least in the beta. Publish a LightSwitch app, and by default you get a Windows click-once installation file for an out-of-browser Silverlight app. Still, there is also an option for a browser-hosted deployment, and in principle I should think the apps will run on the Mac (this is stated in one of the introductory videos) and maybe on Linux via Moonlight. Microsoft does include an “Export to Excel” button on out-of-browser deployments that only appears on Windows, thanks to the lack of COM support on other platforms.

I still find this interesting, particularly since LightSwitch is presented as a tool for business applications without a hint of bling – in fact, adding bling is challenging. You have to create a custom control in Silverlight and add it to a screen.

Microsoft should highlight the cross-platform capability of LightSwitch and make sure that Mac deployment is easy. What’s the betting it hardly gets a mention? Of course, there is also the iPhone/iPad problem to think about. Maybe ASP.NET and clever JavaScript would have been a better idea after all.

2. There is no visual form designer – at least, not in the traditional Microsoft style we have become used to. Here’s a screen in the designer:

image

Now, on one level this is ugly compared to a nice visual designer that looks roughly like what you will get at runtime. I can imagine some VB or Access developers will find this a difficult adjustment.

On the positive side though, it does relieve the developer of the most tedious part of building this type of forms application – designing the form. LightSwitch does it all for you, including validation, and you can write little snippets of code on top as needed.

I think this is a bold decision – it may harm LightSwitch adoption but it does make sense.

3. LightSwitch has runtime form customization. Actually it is not quite “runtime”, but only works when running in the debugger. When you run a screen, you get a “Customize Screen” button at top right:

image

which opens the current screen in Customization Mode, with the field list, property editor, and a preview of the screen.

image

It is still not a visual form designer, but mitigates its absence a little.

4. LightSwitch is model driven. When you create a LightSwitch application you are writing out XAML, not the XAML you know that defines a WPF layout, but XAML to define an application. The key file seems to be ApplicationDefinition.lsml, which starts like this:

image

Microsoft has invested hugely in modelling over the years with not that much to show for it. The great thing about modelling in LightSwitch is that you do not know you are doing it. It might just catch on.

Let’s say everyone loves LightSwitch, but nobody wants Silverlight apps. Could you add an option to generate HTML and JavaScript instead? I don’t see why not.

5. LightSwitch uses business data types, not just programmer data types. I mean types like EmailAddress, Image, Money and PhoneNumber:

image

I like this. Arguably Microsoft should have gone further. Do we really need Int16, Int32 and Int64? Why not “Whole number” and “Floating point number”? Or hide the techie choices in an “Advanced” list?

6. LightSwitch is another go at an intractable problem: how to get non-professional developers to write properly designed relational database applications. I think Microsoft has done a great job here. Partly there are the data types as mentioned above. Beyond that though, there is a relationship builder that is genuinely easy to use, but which still handles tricky things like many-to-many relationships and cascading deletes. I like the plain English explanations in the too, like “When a Patient is deleted, remove all related Appointment instances” when you select Cascade delete.

image

Now, does this mean that a capable professional in a non-IT field – such as a dentist, shopkeeper, small business owner, departmental worker – can now pick up LightSwitch and and write a well-designed application to handle their customers, or inventory, or appointments? That is an open question. Real-world databases soon get complex and it is easy to mess up. Still, I reckon LightSwitch is the best effort I’ve seen – more disciplined than FileMaker, for example, (though I admit I’ve not looked at FileMaker for a while), and well ahead of Access.

This does raise the question of who is really the target developer for LightSwitch? It is being presented as a low-end tool, but in reality it is a different approach to application building that could be used at almost any level. Some features of LightSwitch will only make sense to IT specialists – in fact, as soon as you step into the code editor, it is a daunting tool.

7. LightSwitch is a database application builder that does not use SQL. The query designer is entirely visual, and behind the scenes Linq (Language Integrated Query) is everywhere. Like the absence of a visual designer, this is a somewhat risky move; SQL is familiar to everyone. Linq has advantages, but it is not so easy to use that a beginner can express a complex query in moments. When using the Query designer I would personally like a “View and edit SQL” or even a “View and edit Linq” option.

8. LightSwitch will be released as the cheapest member of the paid-for Visual Studio range. In other words, it will not be free (like Express), but will be cheaper than Visual Studio Professional.

9. LightSwitch applications are cloud-ready. In the final release (but not the beta) you will be able to publish to Windows Azure. Even in the beta, LightSwitch apps always use WCF RIA Services, which means they are web-oriented applications. Data sources supported in the beta are SQL Server, SharePoint and generic WCF RIA Services. Apparently in the final release Access will be added.

10. Speculation – LightSwitch will one day target Windows Phone 7. I don’t know this for sure yet. But why else would Microsoft make this a Silverlight tool? This makes so much sense: an application builder using the web services model for authentication and data access, firmly aimed at business users. The first release of Windows Phone 7 targets consumers, but if Microsoft has any sense, it will have LightSwitch for Windows Phone Professional (or whatever) lined up for the release of the business-oriented Windows Phone.

Rethinking netbook vs laptop

I’m at Intel’s software conference in Barcelona, and I’ve not taken a laptop with me – well, not unless you count this little Toshiba NB300 Netbook. And you should. A netbook like this one is not different in kind from a laptop; it simply represents a different blend of the usual ingredients: processor speed, battery life, screen size, features.

With hindsight, it was inevitable. Until relatively recently, vendors assumed – partly because it was to their advantage to do so – that as technology improved, we would want more powerful laptops but with similar size and battery life and at a relatively high price. In reality that was misjudged; many of us would willingly trade some performance and features in favour of longer battery life, and a smaller size is more convenient for travelling. The performance issue is nebulous anyway; although we think of a netbook as low-end, in reality it performs as well as a high-end laptop a few years back, and which did not seem under powered at the time.

The cycle was broken by Asus with the original Eee PC running Linux, which proved immediately that there was a ready market for this kind of compromise. Next came Windows 7, which was the first Windows release to have lower real-world system requirements that its predecessor. Stick Windows 7 on a netbook, and you have a decent little portable. In honour of its launch yesterday, I installed Visual Studio 2010 on mine:

image

Granted it’s a little slow, and the 1024 x 600 screen not ideal, but it works. Give it a couple of years; the netbook of 2012 will probably run this stuff rather well, if you can think of a reason to do it.

Personally I think smaller, lighter and longer battery life are all big features and make a “netbook” a better choice than a laptop for many uses. Apple’s iPad is another twist on the same theme, making portable computing more convenient.

Why F# rather than IronPython in Visual Studio 2010?

Dynamic languages are all the rage; and after JavaScript, Python is perhaps the dynamic language of the day, loved by Google and gaining increasing attention. IronPython, built on .NET, is stable and at version 2.6. Now Visual Studio 2010 turns up with an additional language in the box, but it is not IronPython; rather it is a little-known language out of Microsoft Research called F#.

Now, F# is very interesting and brings real diversity to Visual Studio; it is great for mathematics and for parallel programming. But wouldn’t IronPython have sparked more immediate interest from the .NET community? Judging by this feature request, with 500 votes, it would. It’s is a little embarrassing for Microsoft that the favoured IDE for IronPython work is SharpDevelop. Plenty of IronPython enthusiasts are pressing for Visual Studio support.

Here’s what IronPython MVP Jeff Hardy says:

I think I can safely say that adding full, high-quality support for IronPython to Visual Studio would require at least a couple of man-years of work. The rabbit hole goes pretty deep when you consider all of the functionality that VS offers, not to mention the difficulty of doing IntelliSense well. I estimate they’d have to at least double the IronPython team to get full support into VS11. IronRuby would require the same commitment.

Hardy is hopeful for VS 2012.

I still find it odd. Official Visual Studio integration would do a lot to raise awareness and usage of IronPython; and make Microsoft’s commitment to dynamic languages more visible – though I guess F# supporters will be happy with Microsoft’s priorities here.

Windows Presentation Foundation now ready, too late

The immortal film The Railway Children has a scene in which a band plays during an award presentation. Unfortunately a series of false starts delay the performance, until finally it all comes together and the music begins. The camera pans – the audience has already departed.

Is it like that for WPF (Windows Presentation Foundation), Microsoft’s user interface framework which is built on .NET and DirectX and was intended to replace the ancient GDI (Graphics Device Interface) and GDI+?

In this new post I make the case that with WPF 4.0 is the framework is now truly ready to use, not least because Microsoft itself is using it in Visual Studio and the interaction between these two teams has solved a number of problems in WPF.

But who now wants to develop just for Windows? Well, it makes sense in some contexts, though I note that in the Thoughtworks paper on emerging technology and trends about which I wrote yesterday, neither Windows nor WPF gets a mention. Nor for that matter does the Mac, Linux, or OS X, though iPhone and Android feature strongly. The only emerging desktop technology that interests Thoughtworks is the browser.