Username/Email:  Password: 
TwitterFacebookFlickrRSS

Kylix: Rapid Application Development on Linux

A discussion of what you can and cannot do with this RAD.

If you believe the hype, a Rapid Application Development (RAD) tool means never having to write code again. Instead of all that tedious writing, you click here and there, drag a little, drop a little and-- Hey! Presto!--instant application. Real problems call for real code, and the true value of a RAD tool lies in how easily you can design, document, implement, test and maintain a project. This article takes a closer look at Borland Kylix, the facts, not the fiction.

How Rapid Is Rapid?

There are three aspects to the rapidity of developing an application: design, development and debugging. Kylix is a development tool and offers no help at the design end. You can find third-party design tools (mostly using UML) that work with Delphi (Kylix's sibling for Windows). In time, they might be ported to Kylix. For now, you are on your own.

For the actual coding and debugging, Kylix offers the usual integrated development environment: source editor, syntax highlighting, class browser, a WYSIAWYG (What you see is almost what you get) GUI builder, integrated source-level debugger, additional assembler-level debugger, database field editor, menu editor, fast database access components, extensible, object-oriented component framework, Internet components--hmmm, maybe there's a little more than what you find in other RAD tools. Let's take a closer look at some of Kylix's features.

The source editor has several features that make the typing go a little faster:

<il>* Code templates let you define a large code fragment and insert the fragment by typing a short alias. Several templates are predefined, and you can freely create, modify and delete the templates to meet your needs.

<il>* Code insight pops up hints while you type. If you don't remember the parameters to a function, the editor pops up a hint window to remind you of the parameter names and types. If you can't remember how to spell a method, type or variable name, a different window pops up that shows you all the methods that are meaningful. If you remember the first few letters, the hint window shows only those methods with the same prefix. The hint window is also type-aware and shows only the methods that are type-compatible for the containing expression.

<il>* Cross references are available with a click of the mouse. If you want to see the definition of a function or other symbol, hold down the Control key and click on a reference to it.

The compiler runs in the background, feeding code insight with the types and functions that you have written so far. Even if you aren't finished and don't yet have code that will compile successfully, the code insight hints will work with what you have typed so far.

Real Programmers Use Pascal

Editor enhancements are nice, but real programmers need real programming languages. The bad news is that Kylix uses Pascal. The good news is that Kylix uses a modern, object-oriented version of Pascal.

Kylix Pascal has a Java-like object model (single inheritance of classes, and a class can implement many interfaces), exception-handling, dynamically-resizable arrays, copy-on-write strings, custom Variant types for operator overloading, and a rich library of classes, components and reusable code.

Kylix Pascal is a clean, elegant language. Borland avoids cluttering the language with reserved keywords and special syntax by creating context-sensitive directives. The following example is a declaration for an external procedure in a shared object, using the C calling convention:

function strlen(Str: PChar): Integer; cdecl; external 'glibc.so';

The keyword "function" is part of standard Pascal. The directives "cdecl" and "external" are not reserved. Their special meaning applies only in the context of a procedure or function declaration. Borland has succeeded in creating a language that follows the spirit of the original Pascal, while adding features that we expect from a modern object-oriented language.

The compiler is also quite fast. The first time you try Kylix for yourself, and click the Compile button, don't blink. The cursor briefly changes to an hourglass and back to the normal arrow. Even a very large project usually compiles and links in seconds.

Kylix Pascal uses a mixed model for memory management. The programmer is responsible for most memory management (as in C++), but interfaces are automatically managed (using reference counting). Dynamic arrays and strings are also managed automatically. Visual forms and controls are implemented as ordinary objects, but unlike other objects, their lifetimes are managed automatically.

Although Kylix Pascal lacks garbage collection (as in Java) or smart pointers (such as the auto_ptr<<>> template in C++), in my experience, Kylix programs do not often exhibit the number or degree of pointer problems that plague many C and C++ programs.

Perhaps the most glaring omission is the lack of generic types, what C++ programmers call templates.

______________________