Previous Index Next

Christoph: Some of these information aren't up-to-date anymore, some other "wished" things are allready implemented. You may wish to read the documentation in the VKBase package instead.

VisKProg

This is (hopefully) the "description" of a future version - like a long todo list.

Why not use C++ and simply write an IDE for Qt/KDE?

When I remember my first steps learning a programming language (I was 12 years old) I does also remember the difficulties: If you don't even know the mathematically definition of a function it's nearly impossible to learn a language like C. In addition nobody can say that C++ is easy to learn, especially if you'd like to learn Qt (nearly) at the same time becouse you're only interested in writing applications for a desktop environement. So the "classical" to KDE programming (learn C first, and then C++ (for the text promt) before you start to write KDE apps) does not work any longer. There are _many_ Linux newbees who came in the past months and among them, there are _not_ only the simple users who aren't intersted in programming at all.
But for someone who has come from W*nd*ws and who doesn't (nearly) use shells, the way from C over C++ to Qt and KDE isn't attractive.
Then I tried to check whether it could be possible to learn C++ with Qt at one time (if there were a good documentation for programming beginners).
But if you try to imagine you were such a newbee, you just had to ask several questions: Why do I need such a complex project and a meta object compiler, why must I use signal/slots to connect to a button click event and why not, if I want to receive a click event of simple QWidget, ... .
Beginners dont't need to know about most of these difficulties and we can hide them to them; This doesn't mean that they shouldn't learn C++ later: VisKProg won't be a good "language" for big projects, and it is a fact, that its programs will never become as fast as a pure KDE application is.

But as well as I think, that C++ is too difficult for beginners the typically beginners "language" under M$-W*nd*ws ("Visual Basic") isn't a good choice, too. So I thought at a syntax which is mixed from C++ and Pascal, with the goal to make it easy to understand but to "keep as many logic" as possible in it's syntax.
That we also need a complete IDE for those beginners is a consequence.
To make development as easy as possible I thought at a combination of a translater and an interpreter. Both based on a little number of C++ classes which implement the main differences to pure C++ (see below) and which could be used for the translator as well as in the interpreter.

Widgets

In order to hide the signal/slot and event technology to the programmer I've written two classes, one which inherits KTopLevelWindow, and one based on QWidget. They are connected to their parent and to all their childs (childs can only have children themselves if they inherit vkWidget or vkTopWidget). These connections allow to any of these widgets to "send" data to any other without a special connections, simply using a function ( I call this the "post office" communication systeme - if you look in the source code you'll find out why ).

Widget properties

But this class can do more: They manage the "properties" of themselves and of all their dependent cilds (childs which aren't vkWidgets): It will be possible in VisKProg to read/change them like public variables, and the vkWidget will call the matching function (for "read" or "write") E.g.
    .label.text = "Hello world!";

will cause a 'label->setText( "Hello world" );'. Thanks to the "post office" this will also work for childs of another parent: 'windowName.widgetName.subWidgetName.label.text = "Hello world";' is ok (even if this is called in a function of a widget in another window and in another sub widget).

Functions

I want to allow to types of functions:
  • Event functions: Functions with predefined declaration for each object, which get ONLY called in case of the event.
  • User defined functions for normally operations.

Variables

I don't want to use different variable types: The variable management is done by a C++ class (vV) which spends a QString and a type flag for each variable. Flags can be: (long) int, (long) float, QString;
They'll get converted in the type which is needed.
Each variables flag can be one of integer, long, float, double, QString (in order of priority) or bool (without priority).
After a change of the variables value, VK trys to set the flag of the _highest_ priority which is possible. If the variable is used in function call which expects a special type (e.g int) VK will try whether the variable has the flag of this type or a flag with higher priority (this means that the variable can be converted); if this doesn't work, the application will quit with an error message.
The resulting flags after operations are dependent of the operation and of the operands. Normally (with +, -, *, ...), the resulting flag is the one of the operand with the flag of _lower_ priority; but VK will allways try to set a higher flag (Example: a = 1.5 + 1.5; Both operands have the float flag, but a can get highest priority (int) ). If the programmers try to use one of these standard operands with a string, this will cause an error. Strings can only used with '&' ( e.g. "Hello " & "World!" == "Hello World!" ), and the '%' operand can only be used with ints and longs.


© 2000 by Christoph Pinkel