Category Archives: visual studio

Steve Ballmer and Ray Ozzie at All things Digital – a poor performance

Microsoft CEO Steve Ballmer and Chief Software Architect Ray Ozzie put on a poor performance when quizzed by Walt Mossberg at the All Things Digital conference, judging by Ina Fried’s live blog.

What was wrong with it? They allowed the conversation to be focused mainly on competing products: Apple iPad, Google Android, Google Apps, Google search. Since these products have exposed weaknesses in Microsoft’s own offerings, it was unlikely to work out well.

Mossberg asks about the transition to the cloud. “You guys are putting, for instance, a version of Office in the cloud.”

That was a gift. You would expect the two men to enthuse about how Microsoft’s dominance with desktop Office was now including the cloud as well, how the Office Web Apps enable new opportunities for collaboration, how Microsoft’s investment in XML for Office was now enabling the same document to live both on the desktop and in the cloud.

Nope. Ozzie waffles about people being more connected. Ballmer “disputes the notion that everything is moving to the cloud”.

So what about Steve Jobs prediction, of a transition from PCs to tablets and mobile devices? Ballmer says “not everyone can afford five devices,” lending support to the notion that Windows is for those who cannot afford something better.

Mossberg asks about tablets. Although Mossberg did not say so explicitly, tablets have been a tragi-comedy at Microsoft. Bill Gates evangelised the tablet concept years ago, pre-echoing Jobs’ claim that they would largely replace laptops. Microsoft tried again and again, with XP Tablet Edition, Vista on tablets, then “Origami”, or Ultra-mobile PC. Going back even further there were was the stylus-driven Palm-size PC (I have one in the loft). Tablet PC was not a complete failure, but remained an expensive niche. Origami sank without trace.

Ballmer replied that the “race is on”. Meaning? I guess, now that Apple has demonstrated how to make a successful Tablet, Microsoft will copy it? Or what?

I am not sure how you defend such a poor track record; but the starting point would be to explain that Microsoft has learned from past mistakes. In some ways it has; Windows 7 learns from mistakes in Vista, and Windows Phone 7 learns from mistakes in Windows Mobile.

None of that from Ballmer, who says vaguely that he expects Windows to run on a variety of devices. He makes matters worse later, by defending the stylus. “A lot of people are going to want a stylus,” he says. Some do, perhaps, but Apple has pretty much proved that most people prefer not to have one. I’d like to see effort go into designing away the need for a stylus, rather than implying that Microsoft is just going to repeat its part mistakes.

Someone in the audience asks, “Will we see Silverlight on Android or iPhone?” “My guess is  if it did, it would be blocked”, says Ballmer, ignoring the Android part of the question.

He’s ignoring the force of the question. Why bother developing for Silverlight, if it is locked into a Microsoft-only future, especially considering the company’s poor position in mobile currently? Ballmer could have mentioned the Nokia Symbian port. He could have said how Microsoft would get it on iPhone just as soon as Apple would allow it. He could have said that Microsoft is working with Google on an Android port – I don’t know if it is, but certainly it should be. He could have said that Silverlight plus Visual Studio plus Microsoft’s server applications is a great platform that extends beyond Windows-only clients.

Microsoft does have problems; but it also has strong assets. However it is doing an exceptionally poor job of communicating its strengths.

Update: There is a fuller transcript at Engadget, in which Ballmer and Ozzie come over better, though they still fail to impress. On mobile though, I like this comment:

We have new talent, we had to do some cleanup, we did it for Windows, and we’re doing it for mobile. And excellence in execution is also part of the equation.

I’d be interested in hearing from anyone present at the event.

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.

Microsoft Expression Blend is too hard to learn

Expression Blend is the design tool for Windows Presentation Foundation (WPF) and Silverlight, and thus a key tool for building applications for the current generation of Microsoft’s platform. How good is it? There is a shortage of in-depth reviews, if my quick Google search is anything to go by, though there are plenty of quick write-ups saying that it is not as good as Adobe Flash. Blend got a bit of attention following the 2009 Mix conference thanks to SketchFlow, the prototyping feature built into Blend 3, and which has been well received.

One reason for Blend’s relatively low profile is that it is aimed at designers, whereas Microsoft’s community is more developer-focused. WPF developers can avoid Blend to a large extent, by using the designer built into Visual Studio, which is fine for laying out typical business applications. Now with Visual Studio 2010 the same is true for Silverlight. Another option is to write your own XAML code, which works for laying out controls though it is inconceivable for drawings. XAML is verbose

It is just as well you can avoid it, because although Blend is very capable, it is not easy to learn. I’m guessing there are quite a few developers who have opened it up, clicked around a bit, and retreated gratefully back to Visual Studio. This was a problem for Adobe Flash Professional as well, and one of the reasons for the creation of Flex and Flex Builder, a code-centric IDE for the Flash runtime.

You can argue that a design tool does not need to be easy for developers to use; it needs to be good enough for designers to create great designs. That’s true; but the developer/design divide is not a absolute one, and ideally Blend should be something a developer can dip into easily, to create or enhance a simple layout, without too much stress.

Maybe some developers can; but I have not found Blend particularly intuitive. The user interface is busy, and finding what you want or getting focus on the right object can be a challenge.

As evidence of this, take a look at Adam Kinney’s Through the Eyes of Expression Blend tutorial, which is among the best I have found. Try lesson 9, Styling and working with design-time data. Then ask yourself how easy it would be to discover the way to do this without the step-by-step instructions. Would you have known to right-click the StackPanel and choose Change Layout Type > Grid? What about step 8, right-clicking the ListBox, and selecting Edit Additional Templates > Edit Layout of Items (Items Panel) > Create Empty?

image  

And notice how in step 9 you have to click the “small grey square next to the Source property”, that’s the one called Advanced Options:

image

Overall it is a nice tutorial, but you might need an evening or two with a couple of fat books, one on XAML and one on Blend itself (if you can find a good one), in order to understand the features you have have been using.

It is probably worth it, if you intend to work with Silverlight or WPF. Blend has one great advantage over Flash Professional: it authors XAML, and you can open it up in Visual Studio and continue working on it there. Microsoft has no need for something like Adobe Catalyst to bridge the XML/Designer divide.

Still, Microsoft had a clean slate with Blend, which is only a few years old, and it is a shame it could not come up with something a bit more user-friendly.

The other implication is that the new visual designer in Visual Studio 2010 makes Silverlight applications a great deal easier to create. You can Blend if you want to; but the Visual Studio effort is far more approachable.

How do you find Blend? I’d be interested in other perspectives.

Silverlight 4 vs Silverlight 3: a little bit faster?

Microsoft’s Scott Guthrie spoke of “twice as fast performance” in the newly-released Silverlight 4, thanks to a new just-in-time compiler.

Performance is a hard thing to nail down. Maybe he meant that compilation is twice as fast? I’m not sure; but I tried a couple of quick tests.

First, I looked at my Primes test. Version 3 running in Windows Vista took around 0.40 seconds (the exact figure varies on each run, thanks to background processes or other factors). I then upgraded to version 4.0. No significant difference, on average over several runs. I used Vista because I’d already upgraded my Windows 7 install.

Next I tried Bubblemark. I maxed it out at 128 bubbles. On Vista with Silverlight 3 I got about 240 fps; on the same machine with Silverlight 4 about 260fps; about 8%.

image

Next I tried on an Apple Mac. My Mac Mini is less powerful, though not that bad, an Intel 1.83 Ghz Core Duo. On the Prime test I got 0.54 secs before, and 0.50 secs after the upgrade to 4.0, about 7.5% improvement. On Bubblemark, it was only 24 fps before and after.

I guess the vast difference in graphics performance is also interesting. It is not just Mac vs Windows; the Nvidia GeForce 6800 on the PC is more powerful than whatever is in the Mac Mini.

If anyone can tell me in what respect version 4.0 is twice as fast, I’d be grateful.

Update: prompted by the comment from David Heffernan below, I also tried the Encog Silverlight Benchmark. I used an older core duo laptop, since I am running out of machines to upgrade. I ran the test twice before upgrading, and twice after. Lower is better:

Silverlight 3.0: 22.0

Silverlight 4.0: 12.7

That’s about 42% better, where “twice as fast” would be 50% better, much closer to Guthrie’s claim. I guess it depends what you measure.

Silverlight 4.0 released to the web; tools still not final

Microsoft released the Silverlight 4.0 runtime yesterday. Developers can also download the Silverlight 4 Tools; but they are not yet done:

Note that this is a second Release Candidate (RC2) for the tools; the final release will be announced in the coming weeks.

Although it is not stated explicitly, I assume it is fine to use these tools for production work.

Another product needed for Silverlight development but still not final is Expression Blend 4.0. This is the designer-focused IDE for Silverlight and Windows Presentation Foundation. Microsoft has made the release candidate available, but it looks as if the final version will be even later than that for Silverlight 4 Tools.

Disappointing in the context of the launch of Visual Studio 2010; but bear in mind that Silverlight has been developed remarkably fast overall. There are huge new features in version 4, which was first announced at the PDC last November; and that followed only a few months after the release of version 3 last summer.

Why all this energy behind Silverlight? It’s partly Adobe Flash catch-up, I guess, with Silverlight 4 competing more closely with Adobe AIR; and partly a realisation that Silverlight can be the unifying technology that brings together web and client, mobile and desktop for Microsoft. It’s a patchy story of course – not only is the appearance of Silverlight on Apple iPhone or iPad vanishingly unlikely, but more worrying for Microsoft, I hear few people even asking for it.

Even so, Silverlight 4.0 plus Visual Studio 2010 is a capable platform; it will be interesting to see how well it is taken up by developers. If version 4.0 is still not enough to drive mainstream adoption, then I doubt whether any version will do it.

That also raises the question: how can we measure Silverlight take-up? The riastats charts tell us about browser deployment, but while that is important, it only tells us how many have hit some Silverlight content and allowed the plug-in to install. I look at things like activity in the Silverlight forums:

Our forums have 217,426 threads and 247,562 posts, contributed by 77,034 members from around the world. In the past day, we had 108 new threads, 529 new posts, and 70 new users.

it says currently – substantial, but not yet indicative of a major platform shift. Or job stats – 309 UK vacancies right now, according to itjobswatch, putting it behind WPF at 662 vacancies and Adobe Flash at 740. C# on the other hand has 5349; Java 6023.

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.

Book Reviews: Programming F# and Beginning F#

I’ve been working with Microsoft’s new language F# recently and enjoying it. If it catches your interest, you might turn to a book in order to familiarise yourself with the basics. Here are two which I’ve looked at. They are both aimed at experienced developers who are new to F#.

Programming F# by Chris Smith

Programming F# comes from O’Reilly. It kicks off with Hello World and an introduction to the interactive console in Visual Studio 2010 – a great way to try out F#. Next we get a summary of types, and a brief explanation of how to write an F# program – stuff you have to know.

Chapter 3 is an introduction to functional programming, and also mentions type inference, an important F# feature. The following chapter explains mutable programming in F# – yes, you can do it; it is just not the default behaviour – and also covers exceptions. Chapter 5 turns to object-oriented programming in F#, another distinctive feature, while chapter 6 covers aspects specific to .NET such as garbage collection. That’s about half the book, and gets you up and running with the language.

The second half of the book is more interesting, looking at ways of using F#. Smith looks at applied functional programming, including pattern matching, recursion, continuations and closures. Next, there’s a look at applied object orientation. Chapter 9 covers scripting with F# – an interesting use case – and includes welcome examples for things like copying files and automating Microsoft Office. Chapter 10 is a key one, explaining computation expressions that let you create workflows and all-but extend the language. It’s “a very advanced concept that even expert developers can have a hard time grasping,” admits the author, though he presents it clearly.

Next we get a section on a likely reason for picking up F#: asynchronous and parallel programming. There’s a wide-ranging chapter explaining both .NET and F# asynchronous techniques, including the .NET Parallel Extensions. It’s a little confusing, especially since Smith observes that F# asynchronous workflows are sub-optimal for CPU parallelism; he recommends the .NET Parallel Extensions because of the better thread management it offers.

The last chapters cover .NET Reflection, code analysis and generation with Quotations – “deep wizardry”, says the author. An appendix summarises .NET Libraries and F# interop with COM and native code.

While this is an excellent language introduction, and thorough within the topics it covers, some aspects disappointed me. I cannot find any mention of F# agents, based on the MailboxProcessor class (nothing to do with email), which is a surprising omission; F# designer Don Syme sees it as a critical feature for scalable web development. Nor is there anything on graphics processing, another common usage, or any hint about how you might use F# for financial analysis. I also found it rather dry overall – hard to avoid with so much plumbing to cover, but I feel the author could have conveyed a little more excitement about what F# enables. Don’t make this the only F# book you read.

Beginning F# by Robert Pickering

This Apress title covers similar ground as the O’Reilly book, but with a slightly more hands-on and informal style, which on the whole I enjoyed. It starts with an introduction including a quote from Ralf Herbrich at Microsoft Research describing how he converted 1000 lines of C# into 100 lines of F# which performed just as well – this is the kind of real-world touch that makes you want to read on. The second chapter explains how to install F#, including different versions of Visual Studio, the open source SharpDevelop, and Mono on Linux – excellent diversity. Chapter 3 introduces functional programming, in effect a brisk overview of the core of F#. Read it slowly!

The author goes on to look at imperative programming and mutability in F#, and then object orientation, just as Smith did in his book. Chapter 6 is useful overview of how code is organised into modules and namespaces, and also covers comment annotations. Next, Pickering looks at F# libraries, including a brief look at math programming. Chapter 8 covers user interface coding – completely lacking in Smith’s book – complete with a quick look at GTK#, which works on Linux. There’s also a quick look at ASP.NET, Microsoft’s web server platform. Although this little introductions are too brief to be really useful, they do spark ideas about how you might use F#.

Data Access is next, another important real-world topic, covering XML, LINQ (Language Integrated Query) and ADO.NET.

Chapter 10 is when we get to parallel programming and reactive programming – code that waits for an external event before running. Pickering introduces F# agents and the MailboxProcessor class. Next comes a look at distributed applications using sockets, HTTP requests, web services, and Windows Communication Foundation.

Chapter 12 has the intriguing title Language-Oriented Programming, and should be taken together with the next chapter on parsing text. This is where we look at using data structures as little languages, parsing and interpreting text, and extending F# syntax. Finally, chapter 14 is the interop chapter, covering interop with C# as well as platform invocation for COM and native code.

Of the two books, this is the more lively and wide-ranging read, and more likely to enthuse you about the possibilities F# offers, though it skims the surface in places; many topics receive only shallow coverage.

View on Amazon.com

 

View on Amazon.co.uk

 

Anders Hejlsberg on functional programming, programming futures

At TechDays in Belgium Micrososft’s C# designer and Technical Fellow Anders Hejlsberg spoke on trends in programming languages; you can watch the video here.

I recommend it highly, not so much because of any new or surprising content, but because in his low-key way Hejlsberg is a great communicator. The talk is mostly not about the far future, and much of what he covers relates directly to C# 4.0 and F# as found in Visual Studio 2010. Despite his personal investment in C#, Hejlsberg talks cheerfully about the benefits of F# and gives perhaps the best overview of functional programming I have heard, explaining what it is and why it is well suited to concurrency.

image

I will not try and summarise the whole talk here; but will bring out its unifying thought, which is that programming is moving towards a style that emphasises the “what” rather than the “how” of the tasks it encodes. This fits with a number of other ideas: greater abstraction, more declarative, more use of DSLs (domain-specific languages).

The example he gives early on describes how to get a count of groups in a set of data. You can do this using a somewhat manual approach, iterating through the data, identifying the groups, storing them somewhere, and incrementing the count as items belonging to each group are discovered.

Alternatively you can code it in one shot using the count keyword in LINQ or SQL (though Hejlsberg talked about LINQ). This is an example of using a DSL (Domain Specific Language), and also demonstrates a “what” rather than “how” approach to code. It is easier for another programmer to see your intention, as there is no need to analyse a set of loops and variables to discover what they do.

There is another reason to prefer this approach. Since the implementation is not specified, the compiler can more easily optimise your code; you do not care provided the result is correct. This becomes hugely important when it comes to concurrency, where we want the compiler or runtime to utilise many CPU cores if they are available. He has a screenshot of Task Manager running on a 128-core machine which apparently exists in Redmond (I can’t quite read the figure for total RAM but think it may be 128GB):

image

Hejlsberg says there was a language doldrums between 1995 and 2005, when many assumed that Java was the be-all and end-all. I wonder if this is a tacit admission that C#, which he was working on during that period, is not that different in philosophy from Java? The doldrums are over and we now have an explosion of new and revived languages: Ruby, Groovy, Python, Clojure, Boo, Erlang, F#, PowerShell and more. However, Hejlsberg says it makes sense for these to run on an existing framework – in practice either the Java or .NET runtime – since the benefits are so great.

Hejsberg also predicts that distinctions such as dynamic versus static languages will disappear as each language absorbs the best features from other languages. “Traditional taxonomies of languages are breaking down as languages pick paradigms from each other,” he says. The new language paradigm is multi-paradigm.

Just as C# has now acquired dynamic features, we can expect it to get better support for immutability in future (borrowed from functional languages).

Adobe news: Flash Builder 4, Creative Suite 5, quarterly results

Lots of Adobe news this week.

First, the release of Flash Builder 4. It seems a long time ago that I was looking at the first preview of code-name Gumbo; it’s good to see this finally released. Since it is Eclipse-based, it looks similar to to Flex Builder 3.0; but under the covers there is the new Flex 4 SDK with the Spark component architecture. The design tools have been revamped, and a time-saving feature is that you can now generate an event handler with one click. Flash Builder 4 also has built-in unit testing with FlexUnit, which is a big deal for those enlightened folk who do test-driven development.

Adobe has also worked hard on database connectivity. Flash Builder 4 will generate wrapper code for a variety of data sources, including HTTP and REST, PHP, SOAP, and Adobe’s LiveCycle Data Services middleware.

image

There is a new data/services panel that shows all the available sources, with drag-and-drop data binding, batch updates, and other handy features.

There are a few downsides to Flash Builder 4. ActionScript feels dated if you have been playing with something like C# 4.0, soon to be released as part of Microsoft’s Visual Studio 2010. I’ve also heard complaints that equivalent projects built with Flex are larger than equivalents built with the Flash IDE. The naming is puzzling; we now have to distinguish between the Flash IDE and the Flash Builder IDE, which are completely different products, but the SDK for code-centric development is still called Flex. There is no support yet for AIR 2.0, the latest version of the desktop runtime; nor for the much-hyped iPhone app development. Patience is called for, I guess.

More information on Flex and Flash Builder here.

The next big product launch from Adobe will be Creative Suite 5, for which a launch date of Monday, 12th April has been announced. You can sign up for an online launch event and see some sneak peek videos here.

Finally, Adobe released quarterly financial figures today. The company says they are strong results; revenue is 9.1% higher than last year and GAAP earnings are positive (unlike the last quarter). However, looking at the investor datasheet [PDF] I noticed that new analytics acquisition Omniture now accounts for 10% of revenue; if you deduct that from the increase it does not look so good. Still, a profit is a profit, and the quarter before a major update to CS 5.0 may be under par as users wait for the new release,  so overall it does not look too bad.  The Q1 Earnings Call is worth looking at if only for its nice indexing; I wish all online videos worked like this.

One questioner asked about HTML 5 – “how quickly can you provide support when it comes”? An intriguing question. I suspect it reflects more on the publicity around Flash vs HTML than on the progress of the HTML 5 standard itself, which is coming in fits and starts. “The reality is that it’s a fragmented standard, but we will continue to support it”, was the answer from CEO Shantanu Narayen, though he added a plug for the “benefits of our runtime, which is Flash”.

Visual Studio software factories to emerge from Microsoft deep freeze

Last night at the Microsoft Mix party in Las Vegas I happened across Michael Lehman, a senior architect, who told me he had been working for the last six years on a Visual Studio add-on called Feature Builder. This turns out to be the evolution of the very same project which Microsoft’s Jack Greenfield told me about back in March 2007, at an architecture conference in the UK, though back then it had a more exalted status (in Greenfield’s eyes at least) – he described it as a platform rather than merely an add-on. Now Feature Builder is to appear as an extension in the Visual Studio 2010 Gallery, only discoverable by those who seek it out. If enough developers find it and like it, it may end up as part of a future Visual Studio release.

It’s all part of Microsoft’s desperately confused architecture and modelling story. Note that Greenfield in 2007 denigrated the UML:

The UML is a collection of useful abstractions. Unfortunately it’s been peddled as a universal modelling language, but the U never stood for Universal. We subscribe to Michael Jackson, author of Problem Frames, who says that there is no such thing as a universal solution. It’s a childish approach. This is where the Universal Modelling Language marketing pitch fails. UML was never properly extensible. It also has the problem that it was designed by a committee.

So what do we have actually shipping with Visual Studio 2010? Standard UML modelling, the best Microsoft has yet come up with.

Reading between the lines, this likely means that the UML faction within Microsoft outvoted the non-UML faction. However, each release of Visual Studio seems to have its own unique approach to modelling and architecture tools, so it would be no great surprise if Visual Studio 2012, say, replaced them with something different.

As for Feature Builder, it does sound interesting – read the Greenfield interview referenced above for why it has potential. Lehman says it is a simpler approach than previous software factory tools from Microsoft, and named Feature Builder to avoid association with past efforts.

Update: Lehman has blogged about the project here, and you can download the preview here.