If you are a Basic user, this is good news for you. Morfik Basic was created to allow Basic developers to have easy access to the advanced Ajax application building capabilities of Morfik AppsBuilder. A lot of effort went into making sure that the extensions necessary so that the Basic language could reflect all the capabilities of the underlying Morfik semantics did not seem "foreign" to the Basic developer.
For example, in order to implement in-code documentation, Morfik relies on multi-line comments which are not available in traditional Basic. In adding this feature to Morfik Basic it was tapped from the C family of languages as Microsoft is currently the primary developer of a Basic language and it was reasoned that if they were to add such a feature to the language they would probably use their C# syntax.
For adding pointer support, on the other hand, it was decided that since C# has no such support, falling back to C++ or C would not be a good idea. In that respect it was decided to base the syntax in the ByRef and ByVal keywords that are used to specify how parameters are passed to Functions and Subs in Visual Basic. Reference parameters are, in essence, pointers and this seemed like a logical way of doing it, even if a bit verbose. The following is an example of a common declaration of a variable of the Integer type followed by a declaration of a variable that is a pointer to an Integer.
Dim I As Integer
Dim newX As Ref Integer
In order to actually the use the integer value that is referenced by this pointer you need to dereference the variable which is done using the syntax you can see in the following line:
newY = DeRef newX +5
Though it seems a bit on the lengthy side, it seems to fit in with the Basic language practice and is actually pretty clear about what the code is doing. Considering that at application level there is very little pointer usage in Morfik and since there are no pointers in Basic it seemed better to write a few characters more every once in a while than to add a cryptic operator for the sake of saving some keystrokes.
In general I believe that Basic developers should feel right at home with the language, though like everybody else, they will still need to learn the Morfik Framework.
No comments:
Post a Comment