Category Archives: .net

Code for Mac Cocoa in Visual Studio – surprised to see this?

I grabbed this screenshot from a preview just installed:

Cocoa app in Visual Studio

It comes from Delphi Prism, a new product from Embarcadero/Codegear which lets you code for .NET using the Delphi language, an object-oriented version of Pascal. The product is not as new as it first appears. It is based on an existing product from RemObjects, called Oxygene, which it now replaces.

Here’s the story in a nutshell. 2003: Borland, the company which created Delphi, decides (rightly) that .NET is here to stay, and releases Delphi 8, a pure .NET version. Nobody wants it, because it has no advantages to speak of over Win32 Delphi (which is faster), or C#, which is the Microsoft .NET language.

At that time some voices muttered that what Borland should do is to integrate Delphi into Visual Studio, rather than doing its own .NET IDE.  One was Marc Hoffman at RemObjects, only he did more than mutter: his company developed its own implementation of Delphi Pascal for Visual Studio, called Chrome.

Borland soldiers on with Delphi 2005, which does both .NET and Win32 in a single IDE. Developers are happy to have a new Win32 Delphi, but most still don’t see the point of the .NET stuff. Further, Delphi 2005 is buggy; many stick with Delphi 7. Next comes Delphi 2006: more of the same, but less buggy.

There’s a couple of problems with Delphi’s .NET support. First, it is always out-of-date compared to Microsoft’s .NET tools. Second, it has component library schizophrenia. There’s VCL for .NET, based on Delphi’s component and GUI library, but that’s not compatible with .NET components built for Windows Forms. There’s Windows Forms, but that’s not compatible with existing Delphi code. Borland decides to deprecate use of Delphi .NET with Windows Forms. This is really for VCL developers, it says.

Next comes Delphi 2007. Nice product, but where’s .NET? Gone. Nobody seems to mind [and it turns up later in RAD Studio 2007*]. Delphi 2009, gone again. But now there’s Prism, and it is a complete U-turn. Forget VCL.NET. It uses standard .NET libraries, runs in Visual Studio, supports Windows Forms, ASP.NET, WPF, and soon Silverlight. Oh, and it’s based on what that other guy did back in 2004, with some Borland Codegear Embarcadero technology thrown in: dbExpress database framework, client support for DataSnap multi-tier applications, and the Blackfish pure .NET database engine.

Very good; but there’s still that awkward question: why not use C#? The answer, I guess, being either that you love coding in the Delphi language, or you want to use one of the Delphi-compatible libraries.

Or that you want to use Mono, which of course is what enables those tasty Mac options in the New Project dialog above. You can also use C# with Mono – possibly you should, since it is Mono’s core language – but in Prism it comes nicely integrated into Visual Studio. Well, somewhat nicely. In practice there are a few extra steps you need to take to get it working. The recommendation is to run Visual Studio in a VM on a Mac, since Windows cannot run Cocoa applications. And you’re going to be using Apple’s Interface Builder; there’s no GUI designer in Visual Studio itself.

Hardly enterprise-ready then; but still an intriguing development.

*Added correction thanks to John Moshakis’ comment below.

Microsoft’s new .NET logo

One thing I forgot to mention from PDC 2008: the new .NET logo:

Note the visual link to the Silverlight logo; the ribbon (I may be reading too much into this); and the soft brushwork that is meant to evoke “designer” as well as “developer”.

The .NET part has changed from lower case to upper case. This was the old logo:

 

Since as far as I’m aware Microsoft has always preferred .NET to .net or .Net (except in the logo) I guess this makes sense. Must remember to type it that way.

C# 4.0 goes dynamic

Anders Hejlsberg is explaining new features in C# 4.0, a future version, at Microsoft’s PDC. The big new feature, he says, is support for dynamic typing. Currently C# uses static typing, which means that when you call object members like methods and properties, the compiler checks that they exist or raises an error if they do not. By contrast, with dynamic typing you can call any old method or property, and they are not checked until runtime.

C# 4.0 will support dynamic typing through a new static type called “dynamic” (this raised a laugh at PDC). In other words, if you declare a variable as dynamic:

dynamic obj;

then you can call what you like as if it were a member of obj, and it will be resolved at runtime.

Hejsberg showed in his demonstration how this simplifies interop with other dynamic languages like JavaScript or Python.

Other new features are named parameters and optional parameters. This is a big win for COM interop – automating Microsoft Office, for example, from C# has always been painful because COM was designed to support optional parameters. C# got round this with an ugly hack “ref.missing”. All gone in C# 4.0.

Technorati tags: , ,

Hello Windows Azure

Ozzie has made his big announcement here at PDC 2008. Windows Azure is, he says, Windows for the cloud; a “web tier” offering that runs on Microsoft’s own datacenters. The basics: develop a web service in Visual Studio, deploy it to Azure. You can test and debug using a local Azure server. The client for Azure apps can be anything that can call a service – web app, Silverlight app, Windows app. Your Azure apps can call upon a set of other services many of which are already familiar. For example, the database is SQL Services, formerly called SQL Data Services. Workflow can be managed with Workflow Foundation (WF). For identity and access control, there will be an Active Directory connector, or other options (more on this later).

Note that Azure is a platform for hosted applications, written in .NET but eventually with an option for native code, rather than a VM running Windows in the manner of Amazon’s EC2 service. Thus, Azure has more in common with Google App Engine than with what Amazon is offering. Microsoft’s slides also show Sharepoint, Live Services, and Dynamics CRM as part of the Azure platform.

Microsoft will compete on things like the scope and ease of use of its platform. Integration with Visual Studio and Active Directory should make it relatively easy for Microsoft platform developers to start experimenting with enterprise apps hosted on Azure. Business model not spelt out yet, but the assumption is that Azure apps will scale seamlessly and on-demand.

Technorati tags: , ,

PDC 2008: Microsoft attempts to remake its image

There are two big themes at Microsoft’s Professional Developer’s Conference, just getting under way here in Los Angeles.

One is cloud computing. At this morning’s keynote, Ray Ozzie and others will present Microsoft’s cloud computing strategy. If it’s right that IT is moving inexorably into the cloud, this could be make-or-break for the company. Truth is, despite huge number of users for things like Hotmail and Live Messenger, Microsoft is not perceived as a web or on-demand computing company. That space belongs to others, like Google or Salesforce.com. Further, Microsoft has a problem that those companies do not have: how to keep its partners happy while embracing a computing model that may severely reduce their role.

The other is Windows itself. Vista’s image is tarnished: the wow started badly, and although the OS itself now works better than it did at the launch, its negative perception is beyond rescue. Windows 7 is Microsoft’s next opportunity to generate some consumer and user enthusiasm for Windows, and to stem the flow towards Apple. Tomorrow is Windows 7 day.

We’re also going to get insight into the future of key technologies like .NET, the next version of C# and Visual Studio, the Oslo modeling platform, Microsoft’s plans for identity management, and plenty more.

I’ll be blogging and tweeting as I can during PDC. I’m also keen to know what you think, whether or not you happen to be here in LA (the keynotes are being streamed over the Internet).

Technorati tags: , , ,

UK job stats show Java decline

Long-time readers of this blog may recall that I occasionally track IT job vacancies at Jobserve. There may be better sites to track; but it carries a lot of vacancies, and I need to be consistent. I started in early 2002 with the goal of seeing how much adoption Microsoft was winning for its .NET technology. In March 2002, there were 153 vacancies which mentioned C#, versus 2092 for Java.

Since then, C# has grown steadily. Today it overtook Java for the first time (in my random and infrequent visits). There are 2206 C# vacancies, 2066 Java.

I also noticed that the absolute number of vacancies has declined substantially since my last visit, but Java by more than C#. The economy, I guess.

Is Microsoft really sweeping all before it? Well, no. Vista has disappointed; Apple sales grow ever higher; Netcraft’s web server survey shows a decline in the percentage of IIS sites on the Internet in September 2008 and observes that 75% of new web sites coming online use Apache. So it is a matter of what statistic you want to pick. Nevertheless, there is clearly still a lot of C# development out there.

Technorati tags: , , ,

Tell me what’s wrong with Microsoft’s Team System

At Microsoft’s Remix08 in Brighton last month, a developer asked about Visual Studio Team System during a panel discussion. What interested me was not so much the question itself, but that after the session she was surrounded by other delegates advising her not to use it. These were people who had tried it, or were using it, but found it frustrating. The general proposal was to use open-source tools instead – things like Subversion and CruiseControl.NET.

I was surprised by the strength of feeling. I’ve looked in some detail at Team System and been reasonably impressed by what it does – but that’s not the same as using it in anger, of course. I admit, for my own work I do use Subversion, just because it is lightweight, works well cross-platform, and runs on my Linux web space as well as locally; but I am not part of a team of developers working on Microsoft platform projects, which is where Team System ought to make sense.

For the sake of balance, I’ll add that I met a developer at the airport on the way to Remix Las Vegas earlier this year, who loves Team System and told me that it is Microsoft’s best product.

I’d love to hear in more detail what users think of Team System. Is it broken, or does it depend on how it is set up and maintained? What are the key things that Microsoft needs to fix? Or is it just great, and those complainers in Brighton atypical?

Silverlight on Linux: Moonlight or moonshine?

Microsoft’s press release for Silverlight 2.0 says this:

Cross-platform and cross-browser support. This includes support for Mac, Windows and Linux in Firefox, Safari and Windows Internet Explorer.

The use of the present tense for Linux support is … misleading, to be generous. I tried visiting the official Silverlight site on Ubuntu. Here’s what I’m offered as downloads:

Hmmm. If I go to the official Moonlight site, I see this:

Note that not even Silverlight 1.0 is fully released; further, it says “no video or mp3 playback is enabled”. The installers are said to be incomplete.

I asked about this at the press conference; the answer was “we’re working on it” and “as soon as possible” and “Miguel is speaking at PDC”.

That’s fair enough and I understand that these things take time. But if you read the press release, you might suppose that a Linux user could use it now. Other than for geeky and experimental users, that is not the case.

Silverlight 2.0 is released, Eclipse tools for Silverlight announced

Microsoft’s Scott Guthrie has announced the final release of Silverlight 2.0, its browser plug-in which includes a cross-platform implementation of the .NET runtime as well as a multimedia rendering engine. It will be available for download tomorrow.

Not really a surprise, but nonetheless a significant moment for Microsoft. I have been watching the project closely since it was first announced at PDC 2005 as Windows Presentation Foundation Everywhere. I am particularly interested in the cross-platform aspect. When .NET was first released in 2001, as Microsoft’s answer to Java after falling out with Sun, it had obvious cross-platform potential, yet the company held back form any commercial implementation outside Windows. Miguel de Icaza took independent action to create an unofficial open source Linux implementation, that also runs on Mac and Windows, called Mono. Microsoft was initially wary of Mono, but in my view the company had more to gain than to lose by supporting it. That now appears to be recognized, with Microsoft working formally with Mono to support Moonlight, Silverlight on Linux, and to provide it with multimedia codecs.

Microsoft has also announced Eclipse tools for Silverlight, in partnership with Soyatec, the idea being to enable Java developers to develop for the Silverlight client within Eclipse.

One clarification: although the press release says “This includes support for Mac, Windows and Linux”, the Mac support for Silverlight 2.0 is Intel Mac only, and the Linux version lacks multimedia support and the 2.0 version is described as “Experimental”; it is a long way from full release. Although Microsoft is now working with Mono, cross-platform currently means Windows and Intel Mac, though this does account for a large proportion of active Web users.

Press release is here.

Technorati tags: , ,

What’s new in .NET Framework 4.0?

Good question. There are a few things we know about Microsoft’s managed application runtime and class library:

There will be major updates to the Windows Communication Foundation (WCF) and Workflow Foundation (WF). According to this announcement along with this post by Steven Martin we are going to see “better support for Web 2.0 technologies like REST, POX and ATOM” and a 10x performance increase in WF.

The table shown here also mentions a bigger role for XAML:

Seamless integration between WF and WCF and unified XAML model. Build entire application in XAML from presentation to data to services to workflow.

There will be a new application server codenamed Dublin, which hosts WF/WCF applications and manages messages, long-running transactions, state management. Dublin extends Internet Information Services (IIS) and will run on Windows Server – probably Server 2008 only.*

Dublin supports Oslo, which is Microsoft’s latest attempt at model-driven development. I guess Dublin is the host for Oslo applications, as this post implies. XAML is a good fit with modelling, because it is both declarative and well-suited for visual representation. Models do not have to be visual, and Oslo includes a new textual language which could also be based on XAML (?), but nevertheless there is synergy between modelling and visual designers.

Putting this together, we have a new take on Microsoft’s end-to-end stack, developed in Visual Studio with XAML supplemented by procedural code where needed, hosted on Dublin, and using WPF or perhaps Silverlight(?) for the presentation layer. Thanks to the new REST support, or the old SOAP support, you could also use other clients including JavaScript or Java.

It is all a bit perplexing if you currently think of the .NET Framework as the runtime engine and class library for C# and Visual Basic. It sounds as if .NET Framework 4.0 is enterprisey, more JEE than Java. We are seeing increasing fragmentation or more positively, diversification, in Microsoft’s .NET story. There are micro versions, cross-platform versions (Silverlight), desktop versions (client profile), and more and more pieces that only belong on servers.

How much of Oslo and the Dublin application server is likely to be implemented in Mono, I wonder? I suspect not that much, since Mono has focused in the past on the common language runtime and ASP.NET. There was no WPF support in Mono until Moonlight.

All this begs the question: is .NET becoming too complex? I interviewed Scott Guthrie, Corporate VP Developer Division, at the Remix conference in Brighton last month. I asked him about Oslo, thinking that he must be closely involved in what is, according to some at Microsoft, a major step forward in application development. His reply: “That’s not my world”.

Guthrie is a simplifier. He was one of the original developers of ASP.NET, along with Mark Anders, and as I recall, when asked what modelling tool he used he replied, “a whiteboard”. I spoke to Anders about the early days of ASP.NET and he emphasized the value of simplifying what already exists; see also How ASP.NET began in Java.

Microsoft also claims that Oslo/Dublin will make complex things easier for developers, but looking at all these pieces I’m waiting to be convinced. PDC 2008 is where we will find out more.

*According to this post “Dublin” actually refers to the next version of Windows Server itself, though this announcement says “a set of enhanced Windows Server capabilities codenamed ‘Dublin’ that will offer greater scalability and easier manageability.” I guess this comes to the same thing, and that preview versions of Dublin could either be early releases of the entire OS, or preview bits that install into Server 2008.