A few weeks ago I decided to try out the Flickr API by developing a wallpaper application that would automatically retrieve images from Flickr. As well as experiencing the Flickr API, I would also experiment by developing the same basic software simultanously in two languages and IDEs, namely Microsoft Visual C# Express 2005 and Delphi 2005 Personal.
I usually don't reinvent the wheel, and in this case components have been developed which ease the programming interaction with Flickr. These are FlickrNet for .Net (ie. C#) and dFlickr for Delphi. It was at this point that my Delphi project stalled, as I had great difficulty installing dFlickr. As I tinkered aimlessly trying to get Delphi to talk to Flickr, I steamed ahead on the C# project. The combination of straightforward installation of FlickrNet, sufficient documentation, and very helpful code completion enabled me to communicate with Flickr in negligible time, and get the guts of the program done without trouble.
There are other Flickr wallpaper applications written in C#, but I wanted to provide a better user experience. Flickrwallpaper is a nice command-line example, which is useful to programmers because it includes all the source code, but would put off most casual users by its difficulty of use due to its lack of graphical user interface.
After about a week, my C# wallpaper application was just about done, and I moved back to trying to get dFlickr to work. Doing this, and learning how to use it, took an additional two days. Then I did a quick straight conversion of the C# code to Delphi, which took three more days.
I did a previous comparison of Delphi 6 versus Visual C# Express 2005 (Beta 1), and much of that is still valid with these products. Whilst Delphi hasn't progressed much, the problems with the C# Express beta have been eliminated.
Visual C# Express is good because:
- The visual designer provides great positioning aids. You can use the mouse to align items with ease, whereas with Delphi I have to resort to doing pixel positioning calculations in my head.
- It is very productive. I was never stuck wondering how to do something. This is due to a combination of great help, great code completion, and plenty of online tutorials and forums about C# and .Net.
Visual C# Express is bad because:
- It has no inputbox function. I had to write an entire form and associated code to do what I expected to be provided in a single line of code.
- The programmer and end user need to have the .Net framework installed.
- Any extra components need to have their .dll files distributed too, so you can't just provide a single file download without zipping everything up.
- Help (not Intellisense, though) is very slow to load, slower than loading the whole rest of the IDE.
Delphi 2005 is good because:
- The end result is an all-in-one executable, making life easy for your users.
Delphi 2005 is bad because:
- Errors, such as accessing an object before it's created, often cause an 'Access violation' message, but do not provide much help debugging.
- Code completion doesn't work if there are many errors in the document.
- Code completion isn't very descriptive, and you can't click elements within it, such as on type names to get more information
- Help is hard to navigate
- Not much is built in (eg. no XML processing, no internet access), so you must rely on components written by third parties
- The IDE is much clunkier (and even worse than Delphi 6)
- Because this is Pascal, you have to declare everything (functions and variables) in advance.
- It can be hard to install components.
- Again a Pascal note, begin and end are more verbose than curly brackets.
In the neither bad nor good category, it was interesting that with Visual C# the IDE is fast to start, but slow to load the actual project. In comparison, the Delphi is IDE slow to start, but the project fast to load. I prefer the former, which seems faster though probably isn't much different.
Delphi 2005 can actually produce two types of code. The first is based on Win32, which is what all former Delphi versions could create. Second is the new-fangled .Net Framework, or what Visual C# Express is using. I have been testing the former only, as the other seems to offer the worst of both worlds, the poor IDE of Delphi combined with the poor distributability of .Net.
In summary, the programming experience in Visual C# Express is vastly superior to that of Delphi. However, for most end users, the code that Delphi produces is much better. Firstly, it does not require a large software package, the .Net Framework, to be installed. Secondly, all the components are combined into one executable file, rather than being separate dll files. Certainly these problems can be mitigated by the use of nifty installers, but they're not ever going to be as clean.
The end result of all this work is the Delphi production of Fleace. I'll probably still use the C# code to try out experiments, but my users deserve the easy-to-install Delphi version.
PS. Just a note that if you have both these IDEs installed, you may have problems with the Delphi help refusing to appear. The fixes for this are on the Borland and gnegg sites.