Review: Kylix 3 has plenty of ‘programming power’

138
– By Gavin Melhuish
gav@gav.com.au –

It is not as if I am new to Kylix. I am a Delphi programmer since version 1, and I always keep my C++ skills up. So it was with great anticipation that I looked forward to the release of Borland’s Kylix 3, the Rapid Application Development environment for Linux that includes both Delphi language and C++ IDE’s (integrated development environment). The code produced with Kylix can be recompiled with minimal changes under Microsoft Windows using either Delphi for Windows version 6 or greater, or C++ Builder version 6 or greater.

It is only recently that Borland has decided to name their implementation of Object Pascal the Delphi language. Actually, Delphi has been around for about 7 years in the Windows environment, but Borland always called the language itself Object Pascal. Whatever the name of the language, it is still Pascal in an object oriented environment.

I must say that one of the weakest areas of Borland is their sales and marketing department. I was promised a copy of Kylix 3 for this review, and alas I am still waiting weeks on. I was going to purchase a copy in any case, and by chance Borland in Australia happened to call me to make sure my Delphi and Kylix licenses were up to date, so I took the opportunity to upgrade on the spot. After the package got lost in transit because it was incorrectly addressed, I finally received my copy of Kylix 3 Professional version about two and a half weeks later.

Installation

My main test system for Kylix 3 is a Pentium 3, 733 with 512mb of RAM running Mandrake 8.2. I also loaded it up on my Pentium 3, 800 laptop with 128mb of RAM running Mandrake 9. Borland’s licensing of Kylix allows an individual developer to use copies of the software on multiple machines as long as it is only the one developer who uses those machines.

Kylix loaded without a problem under Mandrake 8.2, but I had a lot of problems loading it onto the laptop. After repeated attempted installs and deletion of files that had been installed, I ran “setup.sh -m” and it finally installed properly. It is probably not the ideal configuration to install Kylix under in any case, but I do like to have my development environment with me when I go away for a few days. The specifications on the Kylix 3 box say that a minimum 256mb of RAM is required, and I can well believe that. I managed to get the Delphi IDE running, but the C++ IDE chewed up memory like you wouldn’t believe. I never got it started properly, and the “free” command indicated the laptop was out of memory.

Borland certifies Kylix 3 on Red Hat 7.2, Mandrake 8.2 and SuSE 7.3. If you are not running one of these distributions, then you may experience some installation problems. In most cases I would not consider the problems severe, and usually you can get the installation to work with a little tweaking and information on how to do so for your distribution is available from newsgroups.

First Impressions

First impressions upon opening both IDEs were that it is hard to tell which IDE you are currently running. The only way to tell is the program title Kylix 3 for C++ or Kylix 3 for Delphi.

A quick browse of the component pallete sees some very useful new components in the System page. These components allow a graphical view of the file system in the tradition of many file navigators, but with the ease of drag and drop implementation. So, if you don’t like the way Konqueror or Nautilus work, now you can create your own custom file manager with ease.

Kylix is actually so large that it is almost impossible to go into all it’s functionality, and even though I use it day in, day out, and am very familiar with it, there are still areas I have not looked at, and I make new discoveries all the time. However, even though it is so large and incorporates so much functionality, it is very easy to become productive quickly. The reason for this is that CLX (pronounced clicks) which stands for Component Library for Cross Platform Development, is structured quite similarly from component to component and class to class. So even if you haven’t used a particular functionality in the past, a few minutes study of the extensive help files and code examples will have you productive in no time at all, using and expanding on knowledge you have learned with other components and classes.

Rapid Application Development is a bit of a misnomer. It is rare that you can get away with writing an application by dragging and dropping a few components. Sooner or later you are going to have to get your hands dirty and do some real coding, and usually that realisation comes sooner than not. Pascal has traditionally been considered the learning language because it is a nice blend of power and ease of use. The Delphi language is no exception. Many classes and procedures have logical names and are easy to remember such as Trim() to trim whitespace off the beginning and end of a character string or IntToStr() to convert an integer to a string. Being a Delphi programmer I am quite familiar with these procedures, and just out of curiosity I decided to try some of them in the C++ IDE. To my surprise, they worked. Looking a bit further, I found that even many of the data types are named the same. In Delphi you declare a string variable as MyString : String; and in C++ you declare it as String MyString; How easy can things get?

Being an ANSI/ISO C++ compliant compiler, I decided to try the old faithful C++ syntax such as strcat(), atoi() etc. These functions still work, but not with the new data types. To work with these you will still have to declare your variables as int, long, char etc.

The Standard Template Library is also supported in C++, through the incorporation of the STLPort open source project.

Putting Kylix to the Test

Where the real power of RAD is, is it’s collection of reusable objects and widgets. Kylix has more than enough of these for almost every purpose, no matter what your programming needs are, and if by some chance you can’t find what you need in Kylix, there are plenty of open source and inexpensive third party proprietary libraries that will suite your needs, or if you are so inclined, Kylix allows you to write your own components.

I have always loved the ease of use of Delphi, but there are a few things that I much prefer to do in C++ – the use of pointers being the main area. It is much easier to dynamically allocate and manipulate memory in C++. Don’t get me wrong, it’s not that it can’t be done in Delphi, it is just that it is much less elegant to do so. There are other areas that I became accustomed to in C++ as well –
dealing with make files, debug and release builds etc. The Delphi language doesn’t have to deal with such niceties, but C++ programmers have come to expect that they can handle EVERYTHING at its lowest possible level. Kylix doesn’t disappoint in this area either. You can compile a C++ application through the IDE, or if you are a hard core C++ programmer that just can’t let old habits die, you can export your project to GNU make file format and compile it at the command
line.

One of the main features of both languages is that object code from one can be used by the other. I installed the Zeos database library in Kylix for Delphi, and also tried to install it in C++. The C++ files were included with Zeos, but unfortunately only for up to C++ Builder 5 for Windows. By clicking on the Component->Install Packages menu item and selecting the shared object I had just compiled in Kylix for Delphi, the Zeos components were installed immediately on my component palette in C++.

Delphi has always been renowned for it’s speed of compilation. With a couple of small test projects I did, which were the same in both IDE’s, I tried to compare compile times. Of course, C++ code can never be compiled at lightning speed because it requires a two pass compile. Delphi code on the other hand only requires a single pass compile. The Delphi build times as expected were faster than C++, however I would not say that you could consider the C++ compile times were slow by any means.

The first two releases of Kylix were, well, not as good as what they could have been. I was constantly nagged by little annoying “features” in these releases. Kylix 3 on the other hand is a good solid release with few detectable bugs, and this is quite evident when you first start either IDE and play around with creating some sample projects and going through the build process. I even loaded up a project that I started back in Kylix 1 which is getting quite large now and did a build. Some of the required libraries had changed since it’s last build in version 2, but after a few minutes of adjusting dependencies the build went smoothly. I even noticed that some annoying things that Kylix 2 had produced in the compiled application were gone. The resulting executable just seemed to perform so much better.

The underlying architecture in both Kylix languages is Qt from Trolltech. Originally, Borland were hoping that Kylix 3 would use the Qt 3 libraries, but because of some stability problems with Qt 3, they decided to revert back to Qt version 2.3.0. This was probably a good move by Borland. They have produced a stable product that is a joy to use, albeit based on the older libraries, but most developers would not notice or be concerned. It also gives Borland time to work on their next release with Qt 3. And yes the IDEs and compiled applications run equally well under both Gnome and KDE.

Kylix – Its Place and Its Future

If you are thinking that you can replace gcc with the Kylix C++ compiler, think again. Kylix is primarily an IDE for creating applications. You can do some powerful stuff with it like writing Linux daemons, socket programming, even inline assembler, but it is not designed for you to be able to compile the Linux kernel with. Its database access support is second to none, and at the moment it would have to be the leading tool on the market for writing database applications based on open source and proprietary databases for Linux.

There are three versions of Kylix available – Open, Professional and Enterprise. The Open edition is designed for educational purposes or writing open source applications. Professional is designed for desktop type application development, although you will find a lot of functionality available in it for database support and server and web applications. This edition is all that you will need if you are an independent programmer or small to medium sized company. The Enterprise version comes with everything in Professional, but with extra drivers for major databases such as Oracle and DB2. There is also further support for writing web service and server applications.

The price of the Professional version is just US$249, or US$129 for the upgrade. In my opinion, for what Kylix 3 is capable of doing this is an absolute bargain. The cost for the Enterprise version however, at US$1999 or US$999 for the upgrade takes a bit more thinking about, but when you consider that it is designed for enterprise environments, it really is reasonably priced for the corporate market.

Kylix 3 is certainly a well positioned product for many programming tasks and many levels of programming expertise. I would, however, like to see it ported to at least OSX/BSD platforms in the near future. I think it’s only limitation at the moment is that it is restricted to only Windows and Linux for cross platform development. To write true multiple platform applications you are still going to have to use Qt, WxWindows or similar. But if you can settle for cross platform development on just two platforms, or if you are developing just for Linux, there is nothing else that comes close in terms of speed of development, ease of use and value for money.

Microsoft Windows is a registered trademark of Microsoft Corporation.
Kylix, Delphi, C++ Builder and CLX are registered trademarks of Borland Software Corporation.
Qt is a registered trademark of Trolltech(TM) AS

This review is published under the terms of the GNU Free Documentation License.

Gavin Melhuish is a software engineer specialising in designing and writing client/server database and Internet applications using the languages Delphi, Kylix and C++. He currently resides in Sydney, Australia.

Category:

  • News