Category Archives: .net

Measuring start-up time for .NET, Java, C++

A comment here points me to this comparison by Decebal Mihailescu of start-up times for processes on Windows using different runtimes: .NET in several versions, Java 1.6, Mono 2.6.4, and Visual C++ 2010 (native code).

image

It is notable that native code is much faster than the runtimes, and that .NET is ahead of Java – to be expected, perhaps, since Windows is its native environment.

The test application is tiny and when we are talking about a time of less than a tenth of a second, users are unlikely to care much. I would like to see tests based on a larger application; on the other hand it becomes increasingly difficult to make a fair comparison.

It’s a shame Embarcadero Delphi was not included, though I’d expect similar figures to those for Visual C++.

Start-up time is critical to perceived performance. One reason I use an ancient version of Paint Shop Pro for simple image manipulation is that I can double-click an image and be editing it instantly, whereas alternatives like Adobe PhotoShop or the free paint.net make me wait. Unless I need the extra features these provide, I stick with fast and simple.

New Delphi, RAD Studio XE announced

Embarcadero has announced RAD Studio XE and will be showing a number of “sneak peaks” during August prior to release in “early September”. You can see the previews and further information here.

The suite includes Delphi XE, C++Builder XE, Delphi Prism XE (Delphi for Visual Studio and .NET) and RadPHP XE.

The first preview focuses on integrated Subversion support, a nice feature but hardly a game changer – most IDEs have had this for years, though this looks comprehensive with differencing, file history and so on within the IDE.

image

There’s also a look at RadPHP, which is a new version of Delphi for PHP. It is reminiscent of ASP.NET Web Forms, in that it gives a drag-and-drop visual designer and lets you quickly hook up code to event handlers such as a button click. There’s also a component model and the ability to set breakpoints for debugging. We even get the old listbox and editbox demo which I recall from Delphi 1 days.

image

Embarcadero’s Mike Rozlog blogs about the new product here.

I am a big fan of Delphi and C++ Builder, but my initial reaction is that developers are going to say, where is cross-platform for Mac and Linux that was talked about last year, where is 64-bit Delphi? None of this looks remotely cutting-edge.

The published Roadmap is short on dates, but I’m guessing some of this may come next year.

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.

Developing for Windows Phone 7

I spent some time today watching parts one and two of Windows Phone 7 Jump Start presented by Rob Miles and Andy Wigley. After a slow start there were clear demos of basic coding for Microsoft’s new phone; and I’d guess that most Microsoft platform developers would be reassured that if they can code for Silverlight, or do games in XNA, they will not have any problem coding for Windows Phone 7. The further implication is that it will be relatively easy, with the proviso that complex applications with good performance and excellent design are never easy. There is also the challenge of learning Expression Blend, if needed.

All participants were asked to state what other mobile platforms they had developed for; and while we were not shown the results of these polls there was a comment to the effect that “Windows mobile and None are neck and neck”, which I found interesting. It suggests that iPhone and Android developers are in no hurry to learn about Microsoft’s phone. If Microsoft gets enough customers they may then take an interest. Competing with Apple was always a given; but it is the rise of Google Android which must be most troubling to Microsoft, since it has given the non-Apple phone vendors what they need.

Still, the combination of Visual Studio plus Windows Phone 7 does make sense for .NET developers.

An early slide presented the Windows 7 hardware, which is worth reviewing as it is a reasonable specification. Supposedly Microsoft is taking a hard line with OEMs to keep the spec at or better than this minimum:

Display

480×800 QVGA
320×480 HVGA

Capacitive touch

4 or more contact points

Sensors

A-GPS, Accelerometer, Compass, Light

Camera

5 mega pixels or more

Hardware buttons

Start, Search, Back

Memory

256 MB RAM or more

8GB Flash storage or more

GPU

DirectX 9 acceleration

Dysfunctional Microsoft?

Microsoft watchers have been scrutinising the fascinating Mini-Microsoft post on the Kin smartphone debacle and what it says about the company. If it is even slightly accurate, it is pretty bad; and it must be somewhat accurate since we know that the hopeless Kin launch happened and that the product was killed shortly afterwards. Of course it would have been better to kill the project before rather than after the launch; the negative PR impact has affected the strategically important Windows Phone 7 launch.

Handsome profits from Windows and Office have enabled Microsoft to survive and even prosper despite mistakes like Kin, or the Xbox 360 “red ring of death”, or the Vista reset and related problems – mistakes on a scale that would sink many companies.

I see frequent complaints about excessively bureaucratic management with too many layers, and a tendency towards perplexing, ineffective but expensive advertising campaigns.

There are also questions about CEO Steve Ballmer’s suitability for the task. He nearly indulged in a disastrously over-priced takeover of Yahoo, saved only by the obstinacy of the target company’s leadership. He habitually dismisses the competition, such as Apple’s iPhone, and is proved wrong by the market. He failed to see the importance of cloud computing, and even now that the company is at least partially converted he does not set the right tone on the subject. I watched his keynote at the Worldwide Partner Conference (WPC) where he sounded as if he were trying unsuccessfully to imitate Salesforce CEO Marc Benioff from ten years’ ago. Microsoft needs to present a nuanced message about its cloud initiative, not someone shouting “oh cloud oh cloud oh cloud”.

Microsoft is also copying its competition as never before. Bing has a few innovations, but is essentially a recognition that Google got it right and an attempt to muscle in with a copy of its business model – search, advertising and data mining. Windows Phone 7 occupies a similar position with respect to Apple’s iPhone and App Store. Windows 8 also seems to borrow ideas from Apple.

Nevertheless, Microsoft is not yet a dying company, and it would be a mistake to base too much analysis of the company on something like comments to Mini-Microsoft’s blog – good though it is – since it is a magnet for disaffected employees.

While Ballmer’s effort at the WPC was poor, he was followed by Bob Muglia, president of server and tools, who was excellent. Windows Azure has come on remarkably since its half-hearted preview at PDC 2008; and Muglia comes over as someone who knows what he is trying to achieve and how he intends to get there. The Azure “Appliance” idea, shipping a pre-baked cloud infrastructure to Enterprise customers, is a clever way to exploit the demand for a cloud application model but on hardware owned by the customer.

The eBay announcement at WPC was also quite a coup. eBay will “incorporate the Windows Azure platform appliance into two of its datacenters” later this year; and while it is not clear exactly how much of eBay will run on Azure, these appliance kits represent significant hardware.

We’ve seen other strong releases from Microsoft – server 2008 R2, Exchange 2010, SQL Server 2008 R2, SharePoint 2010 which whatever you think of SharePoint is a solid advance on its predecessor, and of course Windows 7 which has done a lot to rescue Microsoft’s performance and reputation after the Vista disappointment.

I also continue to be impressed by Visual Studio 2010, which is a huge release and works pretty well in my experience.

What about Windows Phone 7? With the market focused on iPhone vs Android, clearly it is in a tough market. If there is something slightly wrong with it on launch, instability or some serious hardware or software flaw, it might never recover. Nevertheless, I do not write it off. I think the design effort is intelligent and focused, and that the Silverlight/XNA/.NET development platform along with Visual Studio is an attractive one, especially for Microsoft Platform developers. VP Scott Guthrie describes the latest SDK here. People still switch phones frequently – something I dislike from an environmental point of view, but which works in favour of new entrants to the market. If Windows Phone 7 is a decent device, it can succeed; I’d rate its long-term chances ahead of HP WebOS, for example, and will be keen to try it when it becomes available.

phonedev

Is there a lot wrong with Microsoft? Yes. Does it need a fresh approach at the very top? Probably. Nevertheless, parts of the company still seem to deliver; and even the Windows Phone 7 team could be among them.

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.

Why we love to hate Microsoft

Mary Branscombe has an excellent ZDNet post on Why do we (love to) hate Microsoft, and asks:

What would Microsoft need to do and say to you for you to be happy to call yourself a fan?

In part she’s reacting to Frank Shaw’s Microsoft by the Numbers in which he highlights the success of Windows 7, and makes the point that Windows netbooks will likely outsell Apple iPads by 7 or 8 times in 2010, that Linux has not ousted Windows either on the desktop or the server, and that Nokia smartphones will likely outsell iPhones by 2.5 times in 2010.

That last one is interesting. Why is Shaw puffing Nokia, when he is VP corporate communications for Microsoft? Well, the enemy of my enemy applies; it’s a jibe at Apple.

Unfortunately for Shaw, Nokia itself admits that Apple iPhone and Google Android are hurting its market share, or at least that is how I interpret this remark:

Nokia now expects its mobile device value market share to be slightly lower in 2010, compared to 2009. This update is primarily due to the competitive situation at the high-end of the market and shifts in product mix.

Nokia is being driven down-market. The same thing has happened to Microsoft in the laptop market, with the high-end going to Apple. This is a worry for both companies, since if a company becomes known as “the best” in a particular sector, it may well extend its market share simply by lowering prices or introducing cheaper product variants. This happened to some extent in the portable music player market – only to some extent, because Apple is still more expensive than most of its competitors, but its market share is now huge.

I digress. Here are a few observations on the ZDNet post. First, has Microsoft really changed as stated?

Microsoft is still paying for the bad old days of arrogance and dubious business practices. I think they’re the bad old days – I spend a lot of time talking to Microsoft insiders, partners and competitors and the attitudes I see have changed, inside and out.

The trouble is, Microsoft is so large and complex that it is hard to generalise. I think of it more as a set of united (or disunited) states than as a single corporate entity. This has always been the case – at least, as long as I can remember, and I don’t go back to the very early days.

I can believe that regulation has mitigated the worst practices of the past. But why on earth is Microsoft suing Salesforce.com (and getting itself counter-sued)? It’s terrible PR; it looks as if Microsoft wants to compete in the courts and not on product quality. If it wins and hurts Salesforce.com, what is the benefit to the industry? I realise Microsoft is not a charity, but we are talking business ethics here.

More broadly, there are two separate topics that need to be addressed. One is about the quality and prospects for Microsoft’s products and services, and the other is about how it is perceived and why.

I’ll take these in reverse order. Microsoft has history, as Mary Branscombe says, and more history than just Clippy. It’s the perceptions of the web community that are most visible to many of us, and the piece of history that counts for most is over the web browser. Microsoft beat off the competition, then froze development, an evil act that is particularly hard to forgive because of its cost in terms of devising workarounds for web pages. Yes, that’s changed now, and we have had IE7, IE8, and the promising IE9; but has Microsoft convinced the community that it would not do the same again if it had the opportunity?

There are other things I can think of. The whole Office Open XML (OOXML) saga, and hints that Microsoft is not following through on its promises. The BlueJ incident.

There is also the question of pricing, especially for business users. When I reviewed a Toshiba Netbook recently I figured that installing Windows Pro (to join a domain) and Office would cost more than the hardware. I suppose you cannot blame a company for charging what the market will bear; but when the commodity software costs more than the commodity hardware, you have to wonder whether monopolistic pricing is still present.

OK, what about product quality? I tend to agree that Microsoft often does better than it is given credit for. Windows 7 is good; Visual Studio 2010 is great; Silverlight 4 was a bit rushed but still impressive, to mention three offerings about which I know a good deal.

Nevertheless, Microsoft still had deep-rooted problems that I’ve not yet seen addressed. I’ll mention a couple.

First Microsoft still has an OEM problem. Going back to that Toshiba Netbook: it was nearly wrecked by poor OEM software additions and the user experience of a new Windows machine often remains poor. Many users do minimal customisation and as a result get a worse experience of Windows than they should. Apple will carry on winning if this is not addressed.

Second, Microsoft is conflicted, caught between the need to preserve its profits from Windows and Office, and the need to keep up with the new Cloud + Device model of computing. It is drifting towards the cloud; and developments like Office Web Apps and other one about which I am not allowed to tell you yet are encouraging (wait until next month). This issue will not go away though.

Third, mainly as a result of the above, Microsoft still does not convince when it comes to cross-platform. Silverlight is cross-platform, sure; except on the Mac you don’t have the COM integration or any equivalent, sorry, and on Linux, well there’s Moonlight or maybe we’ll work something out with Intel. It is the Windows company. Having said that, I put the Live Messenger app on the iPhone 4 I’ve been trying and it’s great; so yes, it sometimes gets it.

What can Microsoft do in order to be better liked? The key to it is this: ensure that our interactions with the company and its products are more often pleasurable than painful. Windows Phone 7 will be an interesting launch to watch, a product where Microsoft has made its best effort to break with past and deliver something users will love. We’ll see.

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.

Microsoft – make up your mind about Moonlight

I’ve been trying out Microsoft’s Office Web Apps, as provided for the release version of SharePoint 2010. The cross platform story is uneven, whether across Mac/Windows/Linux, or across different browsers, or even across different versions of Windows and Office. So far it does mostly work though, even if there are problems with certain tasks like printing or opening an online document in a desktop application.

The biggest problem I’ve had is on Linux. Supposedly Firefox 3.5 on Linux is supported. I ran up Ubuntu and Firefox 3.5, and went to look at a document in Word Web App. When I selected the document, Firefox quit. Every time.

After checking that Firefox was up-to-date it occurred to me that the problem might be related to Moonlight, the Linux implementation of Silverlight done by the Mono team. I disabled it. Suddenly, everything worked, even Edit in browser.

Moonlight is not just an open source project like the original Mono. It has a certain amount of official blessing from Microsoft. Here’s what VP Scott Guthrie said back in September 2007:

Over the last few months we’ve been working to enable Silverlight support on Linux, and today we are announcing a formal partnership with Novell to provide a great Silverlight implementation for Linux.  Microsoft will be delivering Silverlight Media Codecs for Linux, and Novell will be building a 100% compatible Silverlight runtime implementation called “Moonlight”.

Moonlight will run on all Linux distributions, and support FireFox, Konqueror, and Opera browsers.  Moonlight will support both the JavaScript programming model available in Silverlight 1.0, as well as the full .NET programming model we will enable in Silverlight 1.1.

You would think therefore that Microsoft would test the Firefox/Linux/Moonlight combination with its shiny new Office Web Apps. Apparently not. Here’s what the user experience is like for Office Word App. I figured that the solution might be to upgrade Moonlight to the latest version, so I did, installing what is now called Novell Moonlight 2.2. I went back to Word Web App. Firefox no longer crashes, but I now get a blank area where the Word document should be shown, and an error if I resize the browser window:

Now let’s see what happens if I disable Moonlight:

Everything is fine – except now there is a banner inviting me to “Improve my experience” by installing Silverlight. If I follow the link I eventually get back to the same Moonlight install that I have just enabled, which would actually break rather than improve Word Web App.

It is obvious that if users have to disable Moonlight to work with Office Web Apps, this will not help Moonlight adoption on Linux.

Office Web Apps are new and I’d hope this is something that Microsoft, Novell and the Mono team can soon fix between them. One reason for highlighting it now is the hope that something could be done before the full roll-out of Office and SharePoint 2010 on May 12th.

The real point though is what this says about the extent to which Microsoft cares about Moonlight and Linux users, and how much or little communication takes place between Microsoft and Novell. Silverlight isn’t required for Office Web Apps – as you can see from the above – but it is used to good effect where available, and this Office release is therefore an important release for Silverlight as well.

Microsoft should make up its mind. Is Novell really a trusted partner for Silverlight on Linux? Or a third-party product that has to take its chances?

DevExpress merges its Silverlight and WPF UI controls, says VS 2010 is light years ahead

Developer Express is a component vendor with add-ons for Visual Studio and Delphi. It has offered a library of components for Silverlight for some time, and a separate set for WPF (Windows Presentation Foundation), but now says that Silverlight and WPF are close enough that it can merge the two into a single codebase to be called XPF (Express Presentation Framework). CTO Julian Bucknall says:

Silverlight in v4 has the ability to create desktop applications that aren’t sandboxed into triviality. In fact, Silverlight, more than ever, resembles a WPF-lite on the desktop side, to the extent of pundits considering their eventual merging. At long last it is possible to write one set of non-trivial code and compile it both for Silverlight and for WPF without having to reinvent so many wheels on the Silverlight side (and to a much lesser extent on the WPF side).

Even though Visual Studio 2010 is only just released, DevExpress is focusing all its new Silverlight and WPF development on the new platform and IDE:

The Silverlight and WPF controls in DXperience v2010.1 will require .NET 4 and VS2010. In particular, you must use the new Silverlight 4 and WPF 4; the controls will not function with the previous versions of WPF and Silverlight, such as Silverlight 3. Similarly, you cannot use VS2008 or earlier, but must use VS2010. To my mind this isn’t that much of a downside: VS2010 is light years ahead of its earlier brethren in terms of user experience and its use is de rigueur if you are creating applications with either Silverlight or WPF.

Of course it’s in Bucknall’s interests to move developers on; he’s keen to sell upgrades. I still find this interesting. Like him, I find Visual Studio 2010 a major advance on earlier versions. More significant though is the idea of a common WPF and Silverlight codebase, though presumably still with added capabilities when running on WPF. I don’t think Windows-only development is dead; the success of Windows 7 may even stimulate the market for applications that take advantage of its new features. That said, for the large subset of applications where cross-platform is desirable, Silverlight seems to me a better choice than WPF.