Category Archives: .net

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.

The end of Code Access Security in Microsoft .NET

In the early days of .NET I remember being hugely impressed by Code Access Security. It gave administrators total control over what .NET code was permitted to run. It’s true that the configuration tool was a little intimidating, but there were even wizards to adjust .NET security, trust an assembly, or fix an application – great idea, that last one.

image

Well, now the truth is out. Code Access Security was too complex for humans to configure. Buried deep in the documentation for .NET Framework 4.0 you can find Microsoft’s confession, under the heading Security Policy Simplification:

In the .NET Framework 4 Beta 2, the common language runtime (CLR) is moving away from providing security policy for computers. Historically, the .NET Framework has provided code access security (CAS) policy as a mechanism to tightly control and configure the capabilities of managed code. Although CAS policy is powerful, it can be complicated and restrictive. Furthermore, CAS policy does not apply to native applications, so its security guarantees are limited. System administrators should look to operating system-level solutions such as Windows Software Restriction Policies (SRP) as a replacement for CAS policy, because SRP policies provide simple trust mechanisms that apply to both managed and native code. As a security policy solution, SRP is simpler and provides better security guarantees than CAS.

The section below, headed Obsolete Permission Requests, is even more damning of the old system:

Runtime support has been removed for enforcing the Deny, RequestMinimum, RequestOptional, and RequestRefuse permission requests. In general, these requests were not well understood and presented the potential for security vulnerabilities when they were not used properly.

It goes on to explain why they did not work, with explanations like this one for RequestOptional:

RequestOptional was confusing and often used incorrectly with unexpected results. Developers could easily omit permissions from the list without realizing that doing so implicitly refused the omitted permissions.

The new .NET Framework 4.0 no longer enforces these obsolete permissions.

Microsoft is right. As far as I’m aware, few used the .NET Configuration tool, and I cannot even find it in Windows 7, even though Visual Studio and all the versions of the .NET Framework are installed. Developers feared, with justification, that tinkering with the settings would simply cause mysterious exceptions that were hard to resolve.

I recall though that Code Access Security was considered a highly strategic feature when .NET was first released. One of the promises of .NET was that applications would be more secure and malware less prevalent. The fine-grained permissions were a selling point versus Java.

The painful lesson is that simplicity is a feature. Of course some things are inherently complex; but technology succeeds when it simplifies rather than complicates the tasks that we face.

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.

Technology trends: Silverlight, Flex little use says Thoughtworks as it Goes Google

Today Martin Fowler at Thoughtworks tweeted a link to the just-published Thoughtworks Technology Radar [pdf] paper, which aims to “help decision makers understand emerging technologies and trends that affect the market today”.

It is a good read, as you would expect from Thoughtworks, a software development company with a bias towards Agile methodology and a formidable reputation.

The authors divide technology into four segments, from Hold – which means steer clear for the time being – to Adopt, ready for prime time. In between are Assess and Trial.

I was interested to see that Thoughtworks is ready to stop supporting IE6 and that ASP.NET MVC is regarded as ready to use now. So is Apple iPhone as a client platform, with Android not far behind (Trial).

Thoughtworks is also now contemplating Java language end of life (Assess), but remains enthusiastic about the JVM as a platform (Adopt), and about Javascript as a first class language (also Adopt). C# 4.0 wins praise for its new dynamic features and pace of development in general.

Losers? I was struck by how cool Thoughtworks is towards Rich Internet Applications (Adobe Flash and Microsoft Silverlight):

Our position on Rich Internet Applications has changed over the past year. Experience has shown that platforms such as Silverlight, Flex and JavaFX may be useful for rich visualizations of data but provide few benefits over simpler web applications.

The team has even less interest in Microsoft’s Internet Explorer – even IE8 is a concern with regard to web standards – whereas Firefox lies at the heart of the Adopt bullet.

In the tools area, Thoughtworks is moving away from Subversion and towards distributed version control systems (Git, Mercurial).

Finally, Thoughtworks is Going Google:

At the start of October, ThoughtWorks became a customer of Google Apps. Although we have heard a wide range of opinions about the user experience offered by Google Mail, Calendar and Documents, the general consensus is that our largely consultant workforce is happy with the move. The next step that we as a company are looking to embrace is Google as a corporate platform beyond the standard Google Apps; in particular we are evaluating the use of Google App Engine for a number of internal systems initiatives.

A thought-provoking paper which makes more sense to me than the innumerable Gartner Magic Quadrants; I’d encourage you to read the whole paper (only 8 pages) and not to be content with my highlights.

A year of blogging: another crazy year in tech

At this time of year I allow myself a little introspection. Why do I write this blog? In part because I enjoy it; in part because it lets me write what I want to write, rather than what someone will commission; in part because I need to be visible on the Internet as an individual, not just as an author writing for various publications; in part because I highly value the feedback I get here.

Running a blog has its frustrations. Adding content here has to take a back seat to paying work at times. I also realise that the site is desperately in need of redesign; I’ve played around with some tweaks in an offline version but I’m cautious about making changes because the current format just about works and I don’t want to make it worse. I am a writer and developer, but not a designer.

One company actually offered to redesign the blog for me, but I held back for fear that a sense of obligation would prevent me from writing objectively. That said, I have considered doing something like Adobe’s Serge Jespers and offering a prize for a redesign; if you would like to supply such a prize, in return for a little publicity, let me know. One of my goals is to make use of WordPress widgets to add more interactivity and a degree of future-proofing. I hope 2010 will be the year of a new-look ITWriitng.com.

So what are you reading? Looking at the stats for the year proves something I was already aware of: that the most-read posts are not news stories but how-to articles that solve common problems. The readers are not subscribers, but individuals searching for a solution to their problem. For the record, the top five in order:

Annoying Word 2007 problem- can’t select text – when Office breaks

Cannot open the Outlook window – what sort of error message is that? – when Office breaks again

Visual Studio 6 on Vista – VB 6 just won’t die

Why Outlook 2007 is slow- Microsoft’s official answer – when Office frustrates

Outlook 2007 is slow, RSS broken – when Office still frustrates

The most popular news posts on ITWriting.com:

London Stock Exchange migrating from .NET to Oracle/UNIX platform -  case study becomes PR disaster

Parallel Programming: five reasons for caution. Reflections from Intel’s Parallel Studio briefing – a contrarian view

Apple Snow Leopard and Exchange- the real story – hyped new feature disappoints

Software development trends in emerging markets – are they what you expect?

QCon London 2009 – the best developer conference in the UK

and a few others that I’d like to highlight:

The end of Sun’s bold open source experiment – Sun is taken over by Oracle, though the deal has been subject to long delays thanks to EU scrutiny

Is Silverlight the problem with ITV Player- Microsoft, you have a problem – prophetic insofar as ITV later switched to Adobe Flash; it’s not as good as BBC iPlayer but it is better than before

Google Chrome OS – astonishing – a real first reaction written during the press briefing; my views have not changed much though many commentators don’t get its significance for some reason

Farewell to Personal Computer World- 30 years of personal computing – worth reading the comments if you have any affection for this gone-but-not-forgotten publication

Is high-resolution audio (like SACD) audibly better than than CD – still a question that fascinates me

When the unthinkable happens: Microsoft/Danger loses customer data – as a company Microsoft is not entirely dysfunctional but for some parts there is no better word

Adobe’s chameleon Flash shows its enterprise colours – some interesting comments on this Flash for the Enterprise story

Silverlight 4 ticks all the boxes, questions remain – in 2010 we should get some idea of Silverlight’s significance, now that Microsoft has fixed the most pressing technical issues

and finally HAPPY NEW YEAR

Moonlight 2 released; no Microsoft codecs unless you get it from Novell

The Mono Project has released Moonlight 2, its implementation of Silverlight for Linux. I tried my own database application and was pleased to find that it works fine; better than it did with the earlier release.

Note the right-click menu which offers some handy debugging features as well as the invitation to “Install Microsoft Media Pack”. If you choose this, you get a dialog offering the Microsoft codecs which are downloaded from Microsoft, not from Mono servers. You have to agree a EULA that restricts use to Moonlight running in a web browser.

That last bit is intriguing; it seems Microsoft is trying to prevent desktop or out-of-browser Moonlight (or Mono) from taking advantage of its codecs.

So what is in Moonlight 2? Miguel de Icaza explains:

Moonlight 2 is a superset of Silverlight 2. It contains everything that is part of Silverlight 2 but already ships with various features from Silverlight 3.

Those additional features include the pluggable pipeline, easing animation support, writeable bitmaps, and partial out-of-browser support. Further, de Icaza says:

We are moving quickly to complete our 3 support. Microsoft is not only providing us with test suites for Moonlight but also assisting us in making sure that flagship Silverlight applications work with Moonlight.

There is also a new patent covenant that:

ensures that other third party distributions can distribute Moonlight without their users fearing of getting sued over patent infringement by Microsoft

That said, the media pack is a source of friction. Only the Novell Moonlight distribution will raise the above dialog to install the Microsoft codecs; others will have to make their own arrangements; at least that is how I understand de Icaza’s post.

It seems an odd restriction, and means that most users should download from Novell.

Reflections on Microsoft PDC 2009

Microsoft’s Professional Developers Conference has long been a key event in the company’s calendar. CEO Steve Ballmer and his colleagues are famous for their belief that developers make or break a platform, and PDC is where the most committed of those developers learn as much as Microsoft is willing to share of its long-term plans. There have been good – for example, 2000 C# and .NET launch, 2008 Windows 7 – and bad – for example, 2001 Hailstorm, 2003 Longhorn – PDCs but they have all been interesting, at least the ones I have attended.

So how was PDC 2009? While there was a ton of good content there, and an impressive launch for Silverlight 4, there was a noticeable lack of direction; maybe that was why Ballmer decided not to show up. It should have been the Windows Azure PDC, but as I have just written elsewhere, Microsoft has little excitement about its cloud. Chief Software Architect Ray Ozzie gave almost exactly the same keynote this year that he gave last year; and the body language, as it were, is more about avoiding the cloud than embracing it. Cross-platform clients, commodity pricing, throw away your servers: from Microsoft’s point of view, what’s not to hate?

In theory, mobile computing could have been another big story at the PDC, but Microsoft’s slow progress in Mobile is well known.

My instinct is that Microsoft needs to change but does not know how: the wheels continue to turn and we will get new versions of Windows, ever more complex iterations of Windows Server, Exchange, SharePoint, and feature after feature added to Microsoft Office – does it really need to become PhotoShop – but in the end this is more of the same.

The mitigating factors are the high quality of Windows 7, which will drive a lot of new PC sales for a quarter or two, and the strong products coming out of the developer division. Visual Studio 2010 plus Silverlight is an interesting platform, and ASP.NET MVC is in my opinion a big advance from Web Forms.

That’s not enough though; and we still await a convincing strategic discussion of how Microsoft intends to flourish in the next decade.

Technorati Tags: ,,

COM automation in Silverlight 4 is not an “edge case”

I wrote a piece for The Register about the arrival of Windows-specific features in Silverlight, which attracted some comments both on the Reg and also on Slashdot. Plenty of people said it was just what they expected from Microsoft, some of them misunderstanding the point that this only applies to out-of-browser applications that are trusted: the user has to pass a dialog box granting the application permission to access the local system. A few defended Microsoft’s decision; and this Slashdot comment on COM automation in Silverlight 4 strikes me as a good encapsulation of the official line:

This is a fairly obscure feature, and I’m fairly surprised that it was included at all, but doubt it’ll be of use to the vast majority of current and future Silverlight developers out there. Like the html control, it’s a crutch, to allow developers that want to use Silverlight a way to leverage existing investments. The mantra I’ve heard out of the Silverlight team is to focus on unblocking customer scenarios (scenarios they cannot unblock themselves) without compromising the overall feature goals (like keeping the runtime download small) … it’s an edge case feature that doesn’t affect Silverlight’s over all "Cross-Platforminess".

The idea that COM automation is merely an “edge case” surprises me, even though I also recall it being described like that at PDC. Access to COM automation gives a Silverlight desktop application on Windows substantial extra capability. At PDC program manager Joe Stegman showed how Silverlight 4 can integrate with Office, sending data into an Excel spreadsheet: an example with obvious value for real applications. I also heard developers at PDC discussing how they might wrap up a Silverlight application with a COM DLL, creating an application which in effect has full access to the local operating system. Although Silverlight cannot access the Windows API directly, there are no such restrictions on the COM DLL, so the combination means that pretty much anything is possible.

Let’s also bear in mind that Microsoft’s Brad Becker is on record saying that one day WPF and Silverlight might simply become different .NET profiles. He told me this at Mix earlier this year; and said a similar thing to Mary Jo Foley at PDC:

Some day — Microsoft won’t say exactly when — Silverlight and WPF are going to merge into one Web programming and app delivery model that, most likely, will be known as Silverlight, Brad Becker, Director of Product Management for Microsoft’s Rich Client Platforms, told me this week

If Microsoft is contemplating such a thing, then clearly full access to the native features of Windows will have to be possible.

I am not entirely negative about this prospect. Even if you are only targeting Windows, Silverlight has a lot to commend it: a small runtime, easy setup, and options for browser-hosted or desktop deployment. If you have ever wrestled with the Windows installer or tackled a failed .NET runtime installation you will like the simplicity of running a Silverlight application.

Nevertheless, with version 4.0 Microsoft is changing its Silverlight story. It is no longer a pure cross-platform play; rather, it is a runtime where some features are cross-platform, and others Windows only. Microsoft calls this developer choice; I see it as evolving into the inverse of Sun’s aim with Java. Sun tried strenuously to guide developers towards cross-platform, but provided a way out – via Java Native Interface – if absolutely necessary. Microsoft will provide cross-platform where we really need it, but make it easy to slip into Windows-only development in order to get some nice feature like a location API, or Office integration.

I see this as an advantage for Flash, because developers know that Adobe has no incentive to prefer one operating system over another – except to the extent that minority platforms (like desktop Linux) tend to receive less investment.

Personally I think Microsoft should at least provide a way for Mac users to get similar benefits – perhaps by implementing something like the native process API in Adobe AIR 2.

I also think Microsoft will have to get real about Linux support. It is wrong that Microsoft will cheerfully state:

Silverlight 4 runs across all platforms and major browsers

as it does in the “Fact sheet” handed out at PDC; while leaving Linux implementation to a third-party process uncertain in both features and timing. Here is the reality of cross-platform Silverlight, in a screenshot taken seconds ago from Linux:

Right now it is a two-platform play – admittedly, the two platforms that matter most, especially in a Western world business context, but never forget that Google Chrome OS is coming.

Silverlight 4 ticks all the boxes, questions remain

Microsoft has announced Silverlight 4 here at PDC in Los Angeles. The gist of it I was expecting – device support, an option for fuller system access out of the browser – but the extent of the new features is remarkable. Here’s a few highlights:

  • Improved Just-in-time compilation gives 30% faster start-up, up to 100% performance increase
  • COM automation support on Windows when out of browser with full trust
  • Access to local file system, cross-site Internet access, custom window chrome when in full trust out of browser
  • Notification pop-up support even when sandboxed
  • Drag and drop target even when sandboxed
  • HTML control (only works out of browser), supports plug-ins
  • Rich text control with right-to-left text support
  • Printing support
  • Clipboard, right-click and mouse wheel support
  • Web cam and microphone support

Of course there are a few unanswered questions, such as what level of HTML support is available, or how Microsoft is protecting users from malicious Silverlight applets; I’ll be exploring these later today.

It’s clear though that Microsoft wants to compete fully with Adobe AIR, and that its energetic Silverlight development is continuing at full pace.

The beta is available now; full release is promised for the first half of 2010.

So where is Microsoft going with this? Why would anyone develop for WPF and Windows, if good enough features, cross-platform, and zero install is available through Silverlight?

Interesting times for .NET developers.

Technorati Tags: ,,,

Miguel de Icaza on eight years of Mono, its future, and the Silverlight desktop

Mono founder Miguel de Icaza spoke at the Monospace conference – 250 enthusiasts in Austin, Texas – on the past and future of the project. I wasn’t there but enjoyed listening to the keynote as posted by Redmonk’s Michael Coté.

“Never ask for permission, ask for forgiveness – that’s how we’ve done a lot of things in the Mono world,” said de Icaza, who also remarked that in the beginning “we thought it would be a walk in the park, we thought it would up and running in 6 months.” His motivation: “We think that .net is a fantastic development platform – we were envious when Microsoft came out with it.”

Eight years on and the Mono team is now around 35 people at Novell, plus 30-70 external contributors. “We don’t dictate the direction of mono, it’s mandated by the direction of the community,” says de Icaza. He talks about MonoDevelop, the Mono IDE, which is now licensed under LGPL allowing commercial plug-ins; about MonoTouch which lets you develop for Apple’s iPhone and “will expand towards Android”; and about XNATouch, a Mono game framework for iPhone.

The task of keeping up with Microsoft – insofar as Mono succeeds – has become easier thanks to open source. “In the last couple of years Microsoft has become very open-source friendly in some areas,” says de Icaza. “For example ASP.NET MVC, we don’t have to do anything, it just runs on our ASP.NET implementation.”

Someone asked about Mono’s plans for WPF, which is becoming more important on Windows, and this led to some intriguing comments on Moonlight/Silverlight and its future. “I think Silverlight has more potential than WPF has, because it runs on the Mac, it runs on Linux, it runs on Windows, and Silverlight is easier to learn than WPF is. We like the Silverlight model but we don’t like that it is limited to a sandbox on the browser,” he said.

“Moonlight can be used in two modes. One of them is moonlight in the plug-in, like you do with Microsoft, and you can out-of-browser if you want, but you are still restricted by the sandbox. We also offer the same graphical engine that we use for Silverlight [Moonlight] but with the .NET 4.0 APIs. You have full access to .NET 4.0 with the Silverlight UI. Isn’t that awesome?”

“WPF is interesting but a lot of work, and we don’t have the bandwidth and the resources. Our best possible option is to use Silverlight with the .NET 4.0 APIs. Our wish is to bring this expanded Silverlight to Windows and Mac OS. Maybe we’ll gently push Microsoft in that direction.”

One of his team is working on “the whole desktop rendered by Silverlight.”

In general I agree that Silverlight is more significant than WPF, particularly if Microsoft keeps up its current energetic level of development. I will be surprised if we don’t hear from Microsoft about an enhanced desktop Silverlight at the forthcoming PDC and Mix conferences.

There is another side to this though: if you can do your cross-platform .NET development in Microsoft Silverlight, do you still need Mono? Particularly if official ports to Linux start appearing?

Of course there is more to Mono than Moonlight. Running ASP.NET on Linux web servers is an attractive proposition, though historically its performance and reliability hasn’t matched that of Microsoft .NET – not surprising given its relatively small resources. Eight years on, and Mono has done more than just survived, yet has not quite tipped over into a platform popular enough to attract the level of contributions it needs.