Tag Archives: .net

Microsoft lets go of IronPython and IronRuby

Visual Studio corporate VP Jason Zander has announced that IronPython and IronRuby, .NET implementations of popular dynamic languages, are to be handed over to the open source community. This includes add-ons that enable development in Visual Studio, IronPython Tools and IronRuby Tools. Of the two, IronPython is a more mature and usable project.

Why? Here’s a few reflections. For what it must cost Microsoft to maintain these projects, versus the goodwill it earns in the open source world, I would have thought they represent good value and I am surprised to see them abandoned.

On the other hand, it is easy to see that they are not commercial propositions. I’d guess that they were more valuable a few years back, before C# acquired dynamic features, and when dynamic languages were strongly in vogue and Microsoft was keen not to allow .NET to fall behind. To some extent dynamic languages are still in vogue, but we are now well past what is “the peak of inflated expectations” in the Gartner Hype Cycle, and few are likely to abandon .NET because it does not have an official Python or Ruby.

The other reason they are not commercial propositions is that Microsoft has under-invested in them. I recall Martin Fowler at ThoughtWorks telling me that JRuby, an implementation of Ruby for the Java Virtual Machine, is important to their work; it lets them work in a highly productive language, while giving clients the reassurance of running on a trusted and mature platform. JRuby performs very well, but IronRuby is a long way behind. Perhaps if Microsoft had really got behind them, one or both of these language could be equally significant in the .NET world.

The fact that F# rather than IronRuby or IronPython turned up as a fully supported language in Visual Studio 2010 is also significant. After talking to F# leader Don Syme – see the interview here – I understood how F# was important to some of Microsoft’s key customers in the financial world; and I’m guessing that neither Python nor Ruby had that kind of case made for them within the company.

Although it is a shame that Microsoft is withdrawing official support, the clarity of Zander’s statement is better than leaving the projects in limbo. The folk appointed as project leaders are also very capable – Mono guru Miguel de Icaza is on both teams and a great motivator, though it seems unlikely he will have much time to devote to them given his other commitments – and this may actually be good rather than bad news for the projects themselves.

Jim Hugunin, creator of both Jython (Python for Java) and IronPython, is leaving Microsoft for Google, and his farewell is worth a read. He says C# has evolved into a nicer language than Java, but notes:

I like to have a healthy relationship with Open Source code and communities, and I believe that the future lies in the cloud and the web. These things are all possible to do at Microsoft and IronPython is a testament to that. However, making that happen at Microsoft always felt like trying to fit a square peg into a round hole – which can be done but only at major cost to both the peg and the hole.

Can Microsoft repeat history and come from behind with Windows Phone 7?

This week is Windows Phone 7 week. Microsoft is announcing details of the launch devices and operators, and I shall be watching and reporting with interest on the joint press conference with CEO Steve Ballmer and AT&T’s Ralph de la Vega.

But how significant is this launch? I think it is of considerable significance. Mobile devices are changing the way we do computing. It is not only that more powerful SmartPhones and tablets are encroaching on territory that used to belong to laptop and desktop computers. We are also seeing new business models based on locked-down devices and over-the-air app stores, and new operating systems, or old ones re-purposed. It is a power shift.

Despite its long years of presence in mobile, it feels like a standing start for Microsoft. A recent, and excellent, free day of training on developing for Windows Phone 7 was only one-third full. Verizon will not be offering the phone, and its president Lowell McAdam suggests that the market belongs RIM, Google and Apple, and that Microsoft’s phones are not innovative or leading edge.

I disagree with McAdam’s assessment. Although I’ve not yet had a chance to try a device for myself, what I have seen so far suggests that it is innovative. While the touch UI does borrow ideas with which we have become familiar thanks to iPhone and Android, the dynamically updating tiles and the hub concept both strike me as distinctive. What McAdam really means is that the phone might not succeed in the market, and such views from someone in his position may be self-fulfilling.

The application development platform is distinctive too, being based on .NET, Silverlight and XNA. I have followed Microsoft’s .NET platform since its earliest days – which as it happens were on Windows Mobile, in the form of the Common Executable Format – and Silverlight seems to me the best incarnation yet of the .NET client. It is lightweight; it performs well; it has a powerful layout language that scales nicely, and it has all sorts of multimedia tricks and effects. Visual Studio and the C# language form a familiar and capable set of tools, supplemented by the admittedly challenging Expression Blend for design.

Still, having a decent product is not always enough. Palm’s webOS devices were widely admired on launch, but that was not enough to rescue the company, or to win more than a tiny market share.

Microsoft has resources that Palm lacked, and a reach that extends from cloud to desktop to device. It may be that Windows Phone 7 has better chances. The problem is that the company’s recent history does not demonstrate the success in coming from behind that characterised its earlier days:

  • Microsoft came from behind with a GUI operating system, even though Windows was inferior to the Mac’s GUI.
  • Microsoft came from behind with Excel versus Lotus 1-2-3.
  • Microsoft came from behind in desktop database managers with Access versus dBase.
  • Microsoft came from behind in networking and then directory services versus Novell and others.
  • Microsoft came from behind with .NET versus Java, which I judge a success even though Java has also prospered.

I am sure there are other examples. Recent efforts though have been less successful. Examples that come to mind include:

  • Internet Explorer – still the most popular web browser, but continues to lose market share, even though Microsoft has been working to regain its momentum since the release of IE7 in 2006.
  • Zune – now a well-liked portable music player, but never came close to catching Apple’s iPod.
  • Silverlight – despite energetic development and strong technology, has done little to disturb the momentum behind Adobe Flash.
  • Tablets – Microsoft was an innovator and evangelist for the slate format, but Apple’s iPad is the first device in this category that has caught on.
  • Numerous examples from Windows Live versus Google and others.

Now here comes Windows Phone 7, with attention to design and usability that is uncharacteristic of Microsoft other than perhaps in Xbox consoles (red light of death aside). In one sense Microsoft can afford for it to fail; it has strong businesses elsewhere. In another sense, if it cannot establish this new product in such a strategic market, it will confirm its declining influence. The upside for the company is that a success with Windows Phone 7 will do a lot to mend its tarnished image.

NuPack brings package management to Microsoft .NET

Microsoft has announced the beta release of NuPack, which is a package manager for .NET projects, mainly focused on open source libraries. NuPack itself is open source.

I downloaded NuPack and took a look. It installs as a Visual Studio extension, and I used it with Visual Studio 2010. Once installed, you get a new Add Package Reference option for any .NET project, which opens this dialog:

image

There seem to be around 40 projects currently available, including some familiar names:

  • Castle Inversion of Control
  • fbConnectAuth Facebook Connect authentication library
  • JQuery – though this already appears by default in many ASP.NET projects
  • log4net logging library
  • Moq mocking library
  • NHibernate object-relational mapper
  • NUnit unit-testing framework

Once you find the package you want to add, click install and it is automatically added to your project, complete with any necessary configuration changes. There is also a PowerShell-based console. In some cases it is better to use the console, as a package can add new commands which you can call from there.

NuPack strikes me as a great idea; one comment to Scott Hanselman’s post on the subject calls it GEM for .NET, GEM being the Ruby package manager. That said my quick go with NuPack has not been entirely smooth, and I got an error on my first attempt at adding NUnit to a project, fixed after restarting Visual Studio.

My main reservation is whether Microsoft will really get behind this and support it, or whether it will end up as another promising initiative that after a while is abandoned.

Latest job stats on technology adoption – Flash, Silverlight, iPhone, Android, C#, Java

It is all very well expressing opinions on which technologies are hot and which are struggling, but what is happening in the real world? It is hard to get an accurate picture – surveys tend to have sampling biases of one kind or another, and vendors rarely release sales figures. I’ve never been happy with the TIOBE approach, counting mentions on the Internet; it is a measure of what is discussed, not what is used.

Another approach is to look at job vacancies. This is not ideal either; the number of vacancies might not be proportionate to the numbers in work, keyword searches are arbitrary and can include false positives and omit relevant ads that happen not to mention the keywords. Still, it is a real-world metric and worth inspecting along with the others. The following table shows figures as of today at indeed.com (for the US) and itjobswatch (for the UK), both of which make it easy to get stats.

Update – for the UK I’ve added both permanent and contract jobs from itjobswatch. I’ve also added C, C++, Python and F#, (which hardly registers). For C I searched Indeed.com for “C programming”.

  Indeed.com (US) itjobswatch (UK permanent) itjobswatch (UK contract)
Java 97,890 17,844 6,919
Flash 52,616 2,288 723
C++ 48,816 8,440 2470
C# 46,708 18,345 5.674
Visual Basic 35,412 3,332 1,061
C 27,195 7,225 3,137
ASP.NET 25,613 10,353 2,628
Python 17,256 1,970 520
Ruby 9,757 968 157
iPhone 7,067 783 335
Silverlight 5,026 2,162 524
Android 4,755 585 164
WPF 4,441 3,088 857
Adobe Flex 2,920 1,143 579
Azure 892 76 5
F# 36 66 1

A few quick comments. First, don’t take the figures too seriously – it’s a quick snapshot of a couple of job sites and there could be all sorts of reasons why the figures are skewed.

Second, there are some surprising differences between the two sites in some cases, particularly for Flash – this may be because indeed.com covers design jobs but itjobswatch not really. The difference for Ruby surprises me, but it is a common word and may be over-stated at Indeed.com.

Third, I noticed that of 892 Azure jobs at Indeed.com, 442 of the vacancies are in Redmond.

Fourth, I struggled to search for Flex at Indeed.com. A search for Flex on its own pulls in plenty of jobs that have nothing to do with Adobe, while narrowing with a second word understates the figure.

The language stats probably mean more than the technology stats. There are plenty of ads that mention C# but don’t regard it as necessary to state “ASP.NET” or “WPF” – but that C# code must be running somewhere.

Conclusions? Well, Java is not dead. Silverlight is not unseating Flash, though it is on the map. iPhone and Android have come from nowhere to become significant platforms, especially in the USA. Beyond that I’m not sure, though I’ll aim to repeat the exercise in six months and see how it changes.

If you have better stats, let me know or comment below.

Microsoft’s Scott Guthrie: We have 200+ engineers working on Silverlight and WPF

Microsoft is countering rumours that WPF (Windows Presentation Foundation) or Silverlight, a cross-platform browser plug-in based on the same XAML markup language and .NET programming combination as WPF, are under any sort of threat from HTML 5.0.

We have 200+ engineers right now working on upcoming releases of SL and WPF – which is a heck of a lot.

says Corporate VP .NET Developer Platform Scott Guthrie in a Twitter post. Other comments include this one:

We are investing heavily in Silverlight and WPF

and this one:

We just shipped Silverlight for Windows Phone 7 last week, and WPF Ribbon about 30 days ago: http://bit.ly/aB6e6X

In addition, Microsoft has been showing off IIS Media Services 4.0 at the International Broadcasting Conference, which uses Silverlight as the multimedia client:

Key new features include sub-two-second low-latency streaming, transmuxing between H.264 file formats and integrated transcoding through Microsoft Expression Encoder 4. Microsoft will also show technology demonstrations of Silverlight Enhanced Movies, surround sound in Silverlight and live 3-D 1080p Internet broadcasting using IIS Smooth Streaming and Silverlight technologies.

No problem then? Well, Silverlight is great work from Microsoft, powerful, flexible, and surprisingly small and lightweight for what it can do. Combined with ASP.NET or Windows Azure it forms part of an excellent cloud-to-client .NET platform. Rumours of internal wrangling aside, the biggest issue is that Microsoft seems reluctant to grasp its cross-platform potential, leaving it as a Windows and desktop Mac solution just at the time when iPhone, iPad and Android devices are exploding in popularity. 

I will be interested to see if Microsoft announces Silverlight for Android this autumn, and if it does, how long it will take to deliver. The company could also give more visibility to its work on Silverlight for Symbian – maybe this will come more into the spotlight following the appointment of Stephen Elop, formerly of Microsoft, as Nokia CEO.

Apple is another matter. A neat solution I’ve seen proposed a few times is to create a Silverlight-to-JavaScript compiler along the lines of GWT (Google Web Toolkit) which converts Java to JavaScript. Of course it would also need to convert XAML layout to SVG. Incidentally, this could also be an interesting option for Adobe Flash applications.

As for WPF, I would be surprised if Microsoft is giving it anything like the attention being devoted to Silverlight, unless the Windows team has decided to embrace it within the OS itself. That said, WPF is already a mature framework. WPF will not go away, but I can readily believe that its future progress will be slow.

Decompiling Silverlight

A Silverlight application is a .NET application. Most developers will be aware of this; but it is worth noting that whereas ASP.NET code executes on the server and is not normally available for download, Silverlight code is downloaded to the client and can easily be decompiled. It is almost as easy to view as JavaScript code in the browser.

If you want to investigate this, the first thing to do is to find the .xap file which contains the Silverlight application. You will likely find this in your browser cache, or you can download it directly from the web site hosting the application. If you have out-of-browser Silverlight apps, they are usually located at:

C:\Users\[username]\AppData\LocalLow\Microsoft\Silverlight\OutOfBrowser

Copy the .xap file somewhere convenient, and rename it to have a .zip extension. Then extract the files. The result looks something like this:

image

Next, you need a .NET decompiler such as Redgate .NET Reflector. Run Reflector and open a .dll file containing application code. Select a method, and Reflector does its best to show you the code. It does a good job too:

image

The purpose of this post is not to encourage decompiling other people’s code, but rather to make the point that even though Silverlight code is “compiled”, it is trivial to read it – just in case anyone thought it was a bright idea to store passwords or other authentication secrets there.

The solution is to never to put anything security-critical in client-side code. Second, you can use an obsfuscator such as dotfuscator to make the decompiled code harder to read.

Where is phpinfo() for .NET?

I’m moving an ASP.NET project to a different ISP, and rather than grill the ISP about the setup I cast around for a .NET equivalent to phpinfo(), which generates a web page giving comprehensive information about the server configuration.

The closest I’ve found so far is this Codeplex project by Aarron K Jackson. I downloaded the source, compiled (I had to delete the private key included by the author) and ran it on the new server. It did in fact answer most of my questions. Information includes the Windows and .NET version, number of CPU cores, memory available and used, environmental variables, path to the web site, IIS version, trust level, and all the server variables; there is even a test email form.

image

According to Codeplex the project has fewer than 100 downloads so I thought it deserved a plug. One caveat: I suggest you password-protect it or delete after use, since the information could be valuable to hackers.

Ten years of Microsoft .NET – but what about the next ten?

Technology products have many birthdays – do you count from first announcement, or release to manufacturing, or general availability? Still, this week is a significant one for Microsoft .NET and the C# language, which was first unveiled to the world in detail at Tech-Ed Europe on July 7th, 2000. The timing was odd; July 7th was the last day of Tech-Ed, whereas news at such events is normally reserved to the first day or two – but the reason was to preview the announcement at the Professional Developers Conference in Orlando the following week. It was one of the few occasions when Europe got the exclusive, though as I recall most of the journalists had already gone home.

It is interesting to look back, and I wrote a piece for The Register on .NET hits and misses. However you spin it, it’s fair to say that the .NET platform has proved to be one of Microsoft’s better initiatives, and has delivered on at least some of its goals.

It is even more interesting to look forward. Will we still be using .NET in 2020?

There is no sign of Microsoft announcing a replacement for .NET; and little sign of .NET catching on in a big way outside the Microsoft platform, so in part the question is about how the company will fare over the coming decade. Still, it is worth noting that the role of the .NET framework  in that platform still seems to be increasing.

Most predictions are wrong; but the general trend right now is towards the cloud+device computing model. The proposition is that both applications and data belong in the cloud, whether public, private or hybrid. Further, it seems plausible that we will fall out of love with personal computers, with all their complexity and vulnerability to malware, and embrace devices that just work, where the operating system is locked down, data is just a synchronised local cache, and applications are lightweight clients for internet services. Smartphones are already like this, but by the end of this year when Apple’s iPad has been joined by other slates and small computers running Google Android, Google ChromeOS, Intel/Nokia MeeGo and HP WebOS, it may be obvious that traditional laptop and desktop computers will decline.

It turns out that the .NET Framework is well suited to this model, so much so that Microsoft has made it the development platform for Windows Phone 7. Why stop at Windows Phone 7 – what about larger devices that run only .NET applications, sandboxed from the underlying operating system and updated automatically over the Internet? Microsoft cannot do that for Windows as we know it, because we demand compatibility with existing applications, but it could extend the Windows Phone 7 OS and application model to a wider range of devices that take over some of the tasks for which we currently use a laptop.

In theory then, with Azure in the cloud and Silverlight on devices, the next ten years could be good ones for the .NET Framework.

That said, it is also easy to build the case against. Microsoft has it all to do with Windows Phone 7; the market is happily focused on Apple and Google Android devices at the high end. Microsoft’s hardware partners are showing signs of disloyalty, after years of disappointment with Windows Mobile, and HP has acquired Palm. If Windows Phone 7 fails to capture much of the market, as it may well do, then mobile .NET will likely fail with it. Put this together with a decline in traditional Windows machines, and the attraction of .NET as a cloud-to-client framework will diminish.

Although developer platform VP Scott Guthrie, C# architect Anders Hejlsberg and others are doing an excellent job of evolving the .NET framework, it is the success or failure of the wider Microsoft platform that will determine its future.

Big browser and RIA news: Canvas comes to Internet Explorer 9

I’ve just installed the third Internet Explorer Platform Preview (on a virtual machine just in case) and run through a few of the demos. One of the most impressive is Canvas Pad, which demonstrates the HTML 5 Canvas element.

image

Canvas is particularly interesting, since it provides a surface to which you can draw anything you like. Canvas support was not announced at Mix earlier this year, when IE9 was unveiled, and some of us speculated that Microsoft would omit it in order to preserve the value of its Silverlight plugin – though in doing so it would also help Adobe Flash. Well, apparently the IE9 team decided to risk it. Not only is canvas supported; it is also hardware-accelerated:

Like all of the graphics in IE9, canvas is hardware accelerated through Windows and the GPU. Hardware accelerated canvas support in IE9 illustrates the power of native HTML5 in a browser.

Is there still value in Silverlight and Flash? There is, for several reasons. A plug-in presents a predictable runtime, insulating the application from browser variations. A plugin will work on browsers that do not yet support Canvas. Further, Silverlight includes the .NET Framework with its rich library, and supports the .NET languages, whereas for HTML5 you have to use JavaScript – though don’t forget Google Web Toolkit, which compiles Java to JavaScript, and other similar projects.

Even so, once you have hardware-accelerated Canvas there will be few occasions when you absolutely have to use Flash, Silverlight or Java.

Microsoft is doing the right thing. Crippling IE for the sake of Silverlight would only push users to other browsers, so it would not achieve its goal.

A full list of what is new in IE9 is here. It is shaping up to be the most interesting new IE since version 4.0 back in 1997.

Java versus C/C++ performance – which is really faster?

Cliff Click of Azul Systems has an excellent post on Java vs C/C++ performance:

Is Java faster than C/C++?  The short answer is: it depends.

He then presents three categories of cases: the first C/C++ beats Java, the second where Java beats C/C++, and the third and longest, where C/C++ proponents claim Java is slower but in reality it is not.

My quick summary: there are few cases where Java (or C#) is so much slower that it matters, save for one big issue which Click mentions early on – start-up time:

Flash games beat Java games mostly because it took 30+sec to load the JVM from disk… and so now the web-game developer community has settled on Flash as the standard (and it still takes 10+sec to load the JVM).

Start-up time makes a big difference to usability, for reasons which I cannot entirely explain. Just for fun, I’ve been running Microsoft Office 95 in a virtual instance of Windows XP recently, and the fact that Word 95 loads in a blink makes it feel much faster than Word 2010, which takes 5-10 seconds on first load, even though the productivity difference must be negligible.

If I had to theorise about this, I’d say it is to do with the way humans learn from experience. We don’t like waiting, and if an application take a while to start then part of our brain tells us to avoid it in future. We override that instinct when it is an app we need to run, but it contributes to a negative impression.

The opposite is also true. If an application starts instantly – I mean to the point where we can use it, not just a splash screen – it contributes to a positive impression and we are more inclined to use it in future.

Incidentally, Click thinks that Java is generally faster than C#, though he adds that he is “not able to give C# a fair treatment” because he does not track it closely.