Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

Language comparisons
Divider

This section describes some of the differences and similarities between QDL and other languages.

C/C++

C++ could be called the "parent" language to QDL, as QDL inherits the largest minority of concepts and syntax elements from C++.  QDL is designed to overcome many of the problems C++ has; most of the problems mentioned in C++?? : A Critique of C++ (3rd Edition) are solved by QDL.  These problems include

Cryptic Syntax
Not only is C++ hard for humans to understand, even compilers and other code scanners often have to be very complex to decipher C++ code.  QDL is designed to be more human-readable, but also easier for a compiler or other code scanner to parse.  In particular, QDL is designed to be easier for programmer's editors that perform real-time code analysis for such things as class browsers, and automatic statement completion.  QDL is not nearly so scared of having too many keywords as C++ is, although it doesn't create a new reserved word for every purpose as Basic does.

Pointers
Arguably the worst thing C++ inherited from C is pointers.  The critique mentioned above covers the problems of pointers well.  QDL uses references instead, and although the main differences between the two are syntactical, references turn out to be much safer, easier to understand, and easier to use.

RTTI and type casts
Type casts are much safer in QDL.  Although unsafe and unchecked casts are possible in QDL by dropping to the pointer level, they cannot be used accidentally like in C++.

QDL has far more run-time type information (RTTI) than C++.

Case sensitivity
The critique argues well why case sensitivity is a bad thing, and I agree wholeheartedly.  Case-insensitivity is an important little feature of QDL.

Brackets
I'm surprised at how few people seem annoyed at the sheer amount of brackets you have to type in C/C++.  Shift-9, Shift-0, Shift-9, Shift-9, Shift-0, Shift-9, Shift-0, Shift-0.  We have to do it constantly!  You will notice immediately the amount of bracket reduction in QDL.  Here, check out how a C++ if statement might translate to QDL:

if (!(Func1() && Func2(x))) ...
Unless Func1 && Func2(x) Do ...

As well as being faster to type, bracket reduction also makes code more readable: your brain has at least one less set of brackets to match up in a complicated expression.  I've been programming C/C++ for six years now, and still I have to burn several extra brain cycles to match up brackets.

Precedence changes

A curious bit of C++ design, possibly intended to show off operator overloading, has programmers writing things like:

cout << "Hello I am " << 12 << " years old.";

This happens to work well only because the shift operators have low precedence; it fails when you start writing things like

cout << "Setting a variable in an expression is C tradition..." << c=12 << " eh?";

Anyway, this would break down further if it were attempted in QDL, because of the increased precedence of the shift operators.  This was not mentioned in the critique, but I believe C++'s precedence rules are flawed.  While they got most of it right--the basics, such as arithmetic--the bitwise operators seem placed inappropriately.  I mean, how often do you write

unsigned int x;
x = 2 << 16 - 1;

and actually intend this?

X = 2 << (16 - 1);

It has been my experience that

Turbo C++ had a warning feature that would tell you whenever you combined operators with little-known precedence relationships, without brackets. I figure I'll probably have to put such a warning in my compiler, this time to warn veteran programmers that the precedence rules they took so long to get straight have now changed.

The Preprocessor

The C preprocessor allows you to make a parameterized macro that is used like a function.  The arguments against these macros include:

An additional problem that would occur if C-style macros were allowed in QDL regards function calling.  When a function is called in QDL and its return value discarded, the brackets around the arguments are omitted.  This syntax is not really compatible with function-style macros.

Despite the arguments against macros, there are at least a couple of legitimate uses that cannot be achieved any other way:

Recognizing this, QDL abolishes function-style macros, but adds something more powerful in exchange: Automatic and Abstract function arguments. In short, a kind of macro expansion mechanism is built into function calling. As well as answering the criticisms above, this feature allows for some unique new function-calling possibilities.

Bad Features Kept

QDL resembles C++ in that it can be used for much more low-level work.  Global variables and functions are retained, except that they are typically not "totally" global, as they are located in a "namespace".

A few things in the critique are not solved by QDL, such as:

  1. Functions that don't return a value are still called functions, even though it might make more sense to call them "procedures".  Why did I do it?  Well, I just don't agree that the distinction is necessary.  I considered calling them "routines" instead, since that term has no implication of returning or not, but QDL is intended to feel comfortable to C/C++ programmers, so I kept the term "function".  In fact, in this documentation I sometimes refer to everything that is made of code a "function", including overloaded operators, for example; however, the language itself has special keywords for these things.
  2. Pointers are still present in QDL, though their use is restricted.  You can still do the "unsafe" things in QDL that you could do in C, although it is much more difficult to do them accidentally.  I've done this because I don't like a language that can't do low-level stuff.

    I've seen documentation on multiple OO languages suggesting that if you want to do various kinds of low-level things you should write that low-level stuff in C and use some obscure platform-dependent facility for getting the two languages to interface.  This is odd: after all their criticisms of C, they concede that you have no choice but to use it for certain tasks?  By including limited pointers, and the Compile Option statement (which maps loosely to C's #pragma), QDL could potentially be used for any task currently entrenched in the C/C++ domain.
  3. = and == are unchanged.  It was suggested that = is an inappropriate symbol to represent assignment; it should be := instead.  While I sorta-kinda see the logic there, the strongest reason to me to keep = for assignment is that it's faster to type.  And of course, it's more familiar to the C/C++ programmers.

Other annoying things removed

C++ had some other annoying "features" that are not present in QDL:

Scope resolution operator

From the beginning, QDL used the scope resolution operator, ::, in many places, the same way it is used in C++.  It's been argued to death that it's "confusing" having separate dot (.) and scope resolution operators (::), but it was never confusing to me: When you want to access members of a class, enumeration, or namespace, use scope resolution, and when you want to access members of an object, use dot. Look, people, it's really not that hard!

However, over time I've have been warmed to this weird idea, and after over one year with :: in the spec, I've finally decided to remove it from the language. This has introduced certain ambiguities into the language:

Oh well.

Visual Basic

Visual Basic is very different from QDL in most ways, but you can see some resemblence in there:

Pascal

QDL again has little in common with Pascal that it doesn't have with every other language listed here, but you can see some similarities here too:

You might think ending constructs with"End" is borrowed from Pascal or VB, but you'd be mistaken. The End pseudo-statement is used to help code scanners see a program's structure.

Java

Java posed some very interesting ideas to me in the design of QDL.

* The purely conservative garbage collector doesn't count.

Although Java is also based on C++, it ends up looking significantly different from QDL.

Eiffel

I looked at Eiffel only briefly, but what studying I did helped me solidify a couple of the ideas floating around in my head.

C#

C Sharp, or C Hash as I like to call it, or C Number Sign as people who have never heard of C# tend to call it, is a language that popped out of nowhere as I was making (what I thought were) final revisions to the QDL language definition. Apparently Microsoft also recognized that C++ is becoming more and more obsolete, and decided to make a language of their own. I'm naturally suspicious of anything that slithers out of One Microsoft Way, and C# is no exception. After reading the preliminary documentation for an hour I was:

Perhaps one saving grace for QDL is that C# appears firmly rooted in Microsoft Land. The reference declares that all objects are COM objects, and encourages C# programs to be built upon a foundation of Microsoft, Microsoft, and more Microsoft. I get the impression that C# can only work on platforms Microsoft puts it on: namely, Windows, and maybe, if you're really lucky, Macintosh. The way it looks to me is that things can go one of two ways for Microsoft:

  1. Microsoft attracts legions of developers to C# and the many other charms of Microsoft tools, and infiltrates all the Universities, dooming our impressionable youth to a life of Microsoft development. Linux and BeOS lose their niche markets, Apple stocks crash, and Microsoft completes its goal of world domination. Windows is installed in every computer (maintaining the price point of $200+ per copy, of course), and the term "operating system" falls into obscurity as people shorten it to "Windows".
  2. Microsoft's proprietary-everything policy backfires. Because Microsoft is obsessed with owning everything in software development from the compilers to the APIs to the file system to the underlying operating system, software written under the all-Microsoft ideology is very difficult to port to a non-Microsoft-saturated platform. Nevertheless, the reverse is not true; a mindful developer can develop software that will work on many platforms including Windows. Recognising this, and being tired of being smothered on all sides by Microsoft, developers slowly move away from tools that tie them tightly to Microsoft. More portable software is written, and alternative platforms and tools become increasingly predominant. Eventually, Microsoft loses its monopoly, and crumbles, being unable to compete without it.

Unfortunately, I don't think scenario #2 can happen. People naturally take the path of least resistance, and Microsoft is that path. So, I'm hoping for the current DoJ antitrust action to be successful (sure, DoJ won the case, but luckily for Microsoft, we have all these higher courts to drag out the case for years, and the new Bush administration, which might exercise bad influence over the courts; anyway this sentence has run on far too long, so adios).

Table of Contents Qwertie's Site/Mirror
Next
Previous