Category Archives: software development

Delphi for PHP is done

Hot on the heels of Delphi 2007, CodeGear has announced the completion of Delphi for PHP. Apparently download purchasers can buy immediately.

The name is controversial: this product uses neither the Delphi IDE, nor the Delphi language. Rather, it is inspired by Delphi; maybe it was created with it too. I guess it would have used the Delphi IDE had it not been a third-party buy-in; perhaps it will in future.

The associated library, called VCL for PHP, is meant to be open source; but its home page on SourceForge remains empty at the time of writing.

More when I’ve had a chance to try it out; again, I’d be interested in hearing from early adopters.

 

Technorati tags: , , ,

Automating development: Software factories for Visual Studio

The Register has my piece on software factories, based on an interview with Jack Greenfield, a Microsoft software architect. Greenfield talks about a 40% – 80% productivity gain.

If you’re not familiar with this stuff, a bit of orientation may help. When Greenfield talks about software factories, he means both factory instances, which automate the building and customization of specific types of application, and also factory-making tools, which let you create or adapt factories to suit your specific needs. And when Greenfield talks about the factory “runtime”, he means the infrastructure in Visual Studio and its SDK that lets you put your factory to work.

You can actually play with this stuff now. The runtime is called the Guidance Automation Extensions and the authoring tool is the Guidance Automation Toolkit; perhaps one should add the Domain-Specific Language tools. All can be downloaded. You can also download the first four software factory instances. If anyone has tried these and has comments, I’d love to hear from you.

I was intrigued by the internal debates Greenfield mentions. He says it was a mistake to ship the “White Horse” modeling tools in Visual Studio 2005 (Design for Deployment) as a fixed set which are used only occasionally. He is now focused on shipping tools to make and customize tools, a strategy which he believes has more future.

We will always need tools; improvements are welcome. That said, I am also reflecting on the lesson from Qcon: the human factor counts most.

 

Visual Studio 6 on Vista

Why would you want to run Visual Studio 6 on Vista? Two reasons. First, because it includes Visual Basic 6.0, the last version not based on .NET. Second, because Visual C++ 6.0 is still widely used to avoid issues with the C runtime library. There is little point in installing the other products in Visual Studio 6.0.

Visual Basic 6.0 is supported on Vista, but Visual Studio 6 is not. One reason is that it includes the Microsoft Java Virtual Machine which Microsoft promised Sun it would withdraw. This is the stated reason why Visual Studio 6.0 is no longer available for download, even for MSDN Universal subscribers. Fortunately I still have some old MSDN DVDs, so I dug these out and ran setup for the Enterprise edition of Visual Studio 6.0, installing on Vista Professional.

I can’t pretend it went smoothly. First there were compatibility warnings, which I ignored. I deselected applications other then Visual C++ and Visual Basic. Then setup appeared to hang on the screen where it detects installation components, and Vista popped up its “Program not responding” dialog. I believe this is just a matter of patience. My tip is to run task manager and see if the ACMSETUP process is taking up CPU time. If it is, give it more time.

So setup completed, but with an error towards the end:

RegCreateKey failed for \Interface\OLEViewerIViewerCLSID. Access is denied

followed by a DLLREgisterServer failure. I was informed that setup had failed, but nevertheless VB 6 and VC++ were installed and seemed to run OK.

Naturally I wanted to apply the service pack – SP5 or SP6. This is where I had the biggest problems. I could run SETUPSP6.EXE, but the install always failed. If I logged the install, I found this entertaining error:

Do not ship. Error message to log function that detects what VS products are installed in what language unable to function.

Hmmm. I Googled to no avail, though I found this thread where several others report the same problem. Then I tried removing Visual Studio 6.0 for a reinstall, but got the same error from add/remove programs. I finally twigged. The problem was that the first install never completed. Although the product was mostly installed, some part of the Microsoft Installer database had not been updated. The error message actually makes sense: the products were not installed.

Therefore I re-ran the original setup. This time I went into the Tools part of custom setup, clicked Change Option, and deselected the OLE/COM object viewer. Setup now completed without error; so too did SP6. Success.

The apps seem to work OK too – so far so good, though I’m resigned to having to use Run as administrator.

Try this at your own risk; as I mentioned above, Visual C++ 6.0 is not supported on Vista; in fact, I don’t think it is supported at all.

 

Thawte promotes security, insecurity

I recently headed over to Thawte to purchase a digital certificate for code-signing. According to Thawte, it:

Promotes the Internet as a secure and viable platform for content distribution

I agree with the value of signed code. However I had problems making the purchase, which involves a web form and some ActiveX stuff. Here’s what Thawte tech support advised me to do:

  • Switch off the personal firewall.
  • Add the url to the trusted sites store.
  • Set all the activex controls and plug-ins to prompt or enable.
  • Set the privacy security level to low.

It is not quite as bad as it looks at first. You only need to do the ActiveX changes for trusted sites. Further, I’m not convinced all the steps are needed in all circumstances.

Still, asking someone to connect to the Internet with a disabled firewall is, on the face of it, irresponsible. In mitigation, if you are trying to purchase a digital cert you are probably clueful enough not to disable a personal firewall unless there is some other protection in place; most users have at least a NAT router between their PC and the Internet.

There is a generic problem here. Support departments confronted with users who “just want it to work” may resort to scattergun disabling of security software, never mind the risks. Of course it is better to figure out exactly what is not working and find the minimal relaxation of security needed to solve it, but this is harder to do.

Nevertheless I’m disappointed that Thawte can’t find a more secure technique for delivering its certificates; and that these technical issues are not spelt out more clearly on its site (perhaps it is embarrassed?).

 

Technorati tags: , ,

Semi-documented APIs in Windows

There have long been complaints about undocumented functions in the Windows API which give Microsoft’s internal developers an advantage over third-party software developers. Perhaps even more frustrating are those that are semi-documented. An example was found recently by a user of the htmleditor, a .NET wrapper for the HTML editor built into Internet Explorer. If you write an editor you might want to support undo and redo; there are simple undo and redo commands available but they are crude. The API also provides more advanced functions, including a change log and the ability to undo or redo entries in the log. You can find the documentation here; the relevant interfaces are IHTMLChangeLog, IHTMLChangePlayback and IHTMLChangeSink.

All looks good on a brief inspection; but note the lack of any sample code. Then think about how you might want to use this API. What exactly does an item in the change log represent – a single character, an HTML element, a paste operation, or what? How can you inspect the items (they seem to be a binary black box, understood only by an API function called ExecChange)? There is only one function for iterating through a change log, called GetNextChange – are you intended to cache the entries somewhere, since there is no GetPreviousChange or GetFirstChange? The API allows for notification of changes, but the Notify event has no arguments: presumably you are meant to call GetNextChange and do something or other with the log entry.

Of course developers have shrugged their shoulders and experimented a bit. Some have found Notify failing to fire, particularly with MFC. Others have just been puzzled. I tried it with my C# wrapper and got strange results; I think the only way forward would be to reverse-engineer the log entries to work out what it is they represent.

But what about Microsoft’s developer support? There are managed newsgroups, which are meant to guarantee a response for developers with MSDN subscriptions, as well as other online forums supposedly monitored by Microsoft developers – like Senior Program Manager Dave Massy, who says in his welcome:

Welcome to the MSDN forum for Internet Explorer Addon Development. If you have questions around development of extensions for Internet Explorer then this is the place to ask them.

Perhaps it is; but Massy is strangely silent on the intricacies of IHTMLChangeSink. I have seen this often: easy questions get a ready reponse either from Microsoft or from community members, but the tough ones, where only Microsoft has the answer, are simply ignored; or else there is a request for further information which looks promising at first but leads nowhere. Try Googling on this API; you will find questions but few answers.

My question is this: why bother publishing the API at all if it is so poorly documented and badly supported that nobody can figure out how to use it?

I would guess that this API is or has been used internally, by other Microsoft products that use the IE editor, and that somewhere in the bowels of Redmond there is proper documentation or sample code, perhaps not in sufficiently polished form for general release.

It’s time Microsoft either stopped pretending to offer developer support through these online forums, or put in the effort required to make them work.

 

Salesforce.com hints at Adobe Flex support

Salesforce.com announced its Spring 07 release yesterday, including what it calls an Business version of MySpace: a portal where organizations can share of their data or applications with their customers and collaborate with them. During a briefing, I talked to Adam Gross, vice president of developer marketing. Salesforce.com has a SOAP web services API, and apparently more than half of the platform traffic is via the API rather than through direct visits to the Salesforce.com site. Would it make sense for Salesforce.com to use Adobe’s Flex Data Services to support rich internet applications created with Flex or Apollo?

“Stay tuned,” was his response. “Flex makes so much sense for us. I can build those experiences, just like I can in AJAX,but I can build richer experiences that are easy to build, they plug right in and I can upload them to Salesforce, it’s hand in glove to our model.”

Of course it is already possible to use Flex with Salesforce.com, since Flex supports SOAP web services. On the other hand, if Saleforce.com exposed a Flex Data Services API using AMF (Action Message Format), that would make for smoother, faster and easier development of Flex clients, which use the Flash player as a runtime.

Technorati tags: , , , , , ,

Delphi 2007 is done

CodeGear says it has completed Delphi 2007, its RAD development tool for Windows. What’s notable about Delphi 2007? First, it’s Win32 only. Borland CodeGear hasn’t yet won over many .NET developers, so it took the decision to concentrate on native code in this release, although CodeGear is not abandoning .NET completely.

Second, it builds apps that work right on Windows Vista.

Third, there’s a new database API (CodeGear calls it an “architecture”) called DBX4; I’ve not investigated this yet. 

Fourth, it’s mostly binary-compatible with Delphi 2006 so that existing add-ins should work.

Fifth, it uses MSBuild (same as Visual Studio 2005), which is good news for anyone with a non-trivial build process.

Delphi 2006 was a huge improvement over the two previous versions (Delphi 8 and Delphi 2005). Version 8 was for .NET only, bypassed by most Delphi developers. 2005 brought .NET and Win32 together, but the IDE was barely usable. 2006 is pretty good; it looks as if 2007 may be better still. Although the feature set is not particularly exciting, the product is said to be faster and more reliable, which is what Delphi developers care about most. I will be reviewing the release shortly and will post links when available.

 

Technorati tags: , , ,

Scrum: good but not that good

Jeff Sutherland, co-creator of the Scrum development methodology, gave a talk at QCon on Agile Project Management: Lessons learned at Google. The session was packed; I’m realising that this is as much an Agile crowd as it is a Java crowd.

This was a fascinating session though not in the way that I’d expected. There was a fair amount about Google but not that much about how it uses Scrum, more about the overall characteristics of the company, its flat, team-based management structure, and of course how much money it makes. There is plenty of good sense in Scrum; it facilitates communication, surfaces problems, and promotes sane prioritisation. A key insight is that software development is not just about technology; it is also about people. “Scrum is the only process that makes personal issues as important as technical issues,” says Sutherland.

That said, I didn’t much enjoy this talk. It came over more as a Scrum marketing pitch than what I’d hoped for, which was a real-world account of a Scrum implementation. Listening to Sutherland you get the impression that Scrum is the One True Way; nothing else will do. Adopt Scrum and succeed; do anything else and (if you have competition) your company will fail.

Sutherland is a master motivator. We hear a lot about success. There are little anecdotes about soldiers climbing ridges. Along with Google, we learn about another company Sutherland admires, Toyota, and its secret of success which he calls The Toyota Way.

I don’t doubt the value of Scrum as a process; but I question whether it is only right way to develop software.

 

Technorati tags: , ,

Getting to grips with LINQ 2.0

Microsoft’s Eric Meijer spoke at QCon about “LINQ 2.0” in his keynote. So what on earth is LINQ 2.0? The name is probably inappropriate; he explained to me later that it is just a convenient tag for “what comes after LINQ 1.0”. Meijer started by talking about integrating relational concepts into languages; he didn’t say exactly what this would look like, but the idea is that you could specify relationships between objects, independent of the objects themselves. This is not LINQ 2.0 though; perhaps it is LINQ 1.1. LINQ 2.0 is about simplifying multi-tier, cross-platform web applications- hence the title of the talk, “Democratizing the cloud.”

So how do we do that? The starting point is that users want the same experience everywhere, irrespective of computer platform or device. Meijer’s idea is programmers should be able to code for the easiest case, which is an application running directly on the client, and be able to transmute it into a cross-platform, multi-tier application with very little change to the code.

That means a cross-platform runtime, right? Sort-of, but Meijer doesn’t envisage having to distribute a runtime engine such as .NET, the JVM (Java Virtual Machine) or Flash. Rather, he wants to use what is already available. Therefore he envisages .NET IL (intermediate language) binaries becoming a universally executable format. The runtime could be the CLR (Common Language Runtime), or the JVM, or the Flash player, or the browser. This would be transparent to the developer, because some intermediate piece would translate the .NET IL to JavaScript, or Java, or  a Flash SWF. or somehing else.

This is a little similar to the concept behind the Google Web Toolkit, which lets you code in Java but translates your code to JavaScript. The idea is that you code in whatever language you like, provided that it compiles to IL. For deployment, some sort of cross-compiler does whatever is needed to run it. Maybe it gets converted to JavaScript, or a SWF, or WPF, or WPF/E; you are not meant to care. He calls this late-binding against the client runtime. Note that this is different from implementing the CLR on multiple platforms, though Microsoft is beginning to do this as well (WPF/E).

So that’s the cross-platform runtime sorted. What about the programming side? How do we make our single-tier VB.NET application into a multi-tier web application?

Meijer talks about growing the application organically using refactoring. His use of the term “refactoring” is wrong I think; refactoring is meant to leave functionality unchanged. He means something more like re-purposing. You would take a method and add an attribute to convert it to a web service. Of course ASP.NET already has this (WebMethod attribute), but Meijer’s idea seems to include greater intelligence about the plumbing behind the exposed method. He believes programmers should only need to think sequentially, even though in reality web applications may have multiple entry-points and users may do things like clicking the Back button.

Meijer applies the same thinking to concurrent programming; developers should be able to do this with simple attributes, rather than struggling with synchronization statements and the like. Similar logic applies to state handling: Meijer reckons programmers should be able to program statefully, and have the infrastructure deal with the problems.

We should give programmers the illusion that their servers are stateful, while we can implement that in some scaleable way. That should be done once instead of all programmers trying to solve that problem.

No roadmap

I chatted to Meijer after his session. He emphasised that there is no roadmap for implementing “LINQ 2.0”; he is merely sharing some research thinking. What I’ve described above may never be implemented, or may evolve into something very different. Some parts sound fanciful to me. Will the idea of compiling IL for different runtimes really fly? Is it feasible to reduce multi-tier programming to a few attributes? Will this be any better than DCOM, which was meant to make distributed objects easy, but proved more complex and less robust than had been hoped?

That said, there’s little doubt that advances in programming will be about introducing new levels of abstraction, which may well provoke scepticism among old-school developers. This has happened before. I respect Meijer for what strikes me as good work in LINQ 1.0, so I’m paying attention.

 

Technorati tags: , ,

Constantine on Usability: should the Office Ribbon be customizable?

Here at QCon, Larry Constantine gave a keynote on usability. His big idea is that developers should not rely on user opinion, feedback and testing to determine the user interface and feature set of applications. You end up with too many features, and replication of past errors. He made some good points, but I was not greatly impressed with this session. The majority of the time was spent poking fun at other people’s UI blunders, which left little space for presenting Constantine’s proposed solution, a thing called Activity Modeling.

First up for scorn was the options dialog in Microsoft Word (pre-2007). This is one of those multi-tabbed affairs with a bewildering number of checkboxes. It’s better in Word 2007; but Constantine is not keen on the famous Office Ribbon either. Let’s say you have an image in a document, he said. Would you really expect Insert Caption to be on the References ribbon?

Possibly not; though looking at the section it is in, I can see the logic of it (it is grouped with “Insert table of figures”). That said, personally I wouldn’t search the ribbon for this. I would right-click the image; and indeed, if you do this, insert caption is right there on the pop-up menu. Constantine either did not spot this, or chose not to mention it.

The underlying point is fair though. No matter how Microsoft designs the ribbon, it will not seem intuitive to everyone. So should the ribbon be customizable? Constantine says it should; he even has a mystery source at Microsoft who told him that it would have been, but the developers ran out of time.

I’m not so sure. Customizability would be nice; yet it is less necessary than in earlier versions, since many more features are exposed by default. The advantage of fixed ribbons is that once you have learned where features are located, they are always there. The snag with highly customizable UIs is that no two instances are the same.

Let’s say you have your customized Word set up just how you like it. Then you have a system crash, or visit another office, and you have to work with Word set back to its defaults. Now where has that pesky icon got to?

In any case, Office is atypical. It’s a mature general-purpose tool, used for everything from quick memos to books and dissertations. By contrast, most business applications (the kind that most developers have to work on) are narrow in focus.

My view is that usability is just difficult to achieve. I don’t think there is any silver bullet, not Constantine’s Activity Modeling, nor Microsoft’s one-way glass, wish line, or any other single technique.

That said, usability does deserve more attention than it tends to get. One good point Constantine made was that the increasing computing power available today gives us more options than were available in the past. Lots of research opportunities here.