Are you unhappy that Microsoft didn't upgrade Visual Basic to version 7? Learn about an alternative package that may make you smile again.
I'm a moderator at VBForums.com and it's not uncommon for would-be programmers to ask how they can learn to program in Visual Basic 6. My response to them is that although VB6 is still a very popular and useful programming language, Microsoft has dropped support for it, and so I advise them to learn VB.Net instead. What I usually don't tell them is that I have not followed my own advice and have for the last several years kept on developing in VB6, ignoring the wall at the end of the tunnel. Long before now, I suppose I should have "sucked it up" and invested some of my time into VB.Net, but for various reasons, not the least of which is that I'm good at VB6 and I don't want to leave my comfort zone, I haven't. Then, out of the blue, I was given the chance to review Real Software's REALbasic 2008 Release 1 and the wall fell away, revealing a programming environment in which I feel comfortable and very much at home.
Now as for my review, let me start at the beginning.
Installing REALbasic is a snap. It takes about two minutes to download via cable modem and another two minutes to install. There was no option to create a desktop icon but of course that's easily done. When I ran the program, the splash screen told me that I had an "Update plan" that was good until 8/11/2008 (6 months). I don't know how that compares with other commercial products, but six months seems generous.
Here is what the REALbasic IDE looks like. It's a little different, but as you can see, almost everything that you expect to see in VB is there. A Form may be called a Window and a CommandButton may be called a PushButton, and so forth, and there are built-in controls such as the ExcelApplication and the NotePlayer that are not available in VB, but the differences are very easy to get used to.
The product comes with a well-done, 134 page PDF tutorial that I immediately began to work through. One small problem with the tutorial is that is has symbols in the margin that draw attention to different aspects of the text. However the "supplemental information" symbol, which is an "i" in a solid green circle and the "should pay careful attention" symbol, which is an "!" in a solid green circle are too similar. Perhaps the latter should be red.
The tutorial leads you step by step through the creation of the following fairly robust text editor.
As I worked through the tutorial I found a lot that I liked a few things I didn't like.
What I Liked
The first thing that I noticed was the fact that, rather than having code panes and form windows that can get very messily layered on top of each other as in the VB IDE, REALbasic instead uses a tabbed approach. The first picture in this document shows the IDE after adding the first window in the project. As I added code, menus, and a second window, more tabs were added and the tabs separated things very nicely and made access to them very easy.
The second thing I noticed was that code written for REALbasic is hard to tell from code written for VB6. Here's an example.
Other than the use of "//" for comments (you can also use ' or REM) and the lack of spacing in the lines of code, it's almost indistinguishable from VB6 code. REALbasic is very visual and, in fact, I found that it's more visual than Visual Basic. Following are several examples of that.
- In the picture above, note the very nice graphical connections of the If/End if and If/Else/End if lines. No more struggling to figure out which goes with which!
- When creating or working with menu items, you can drag the menu items around rather than having to work through a Menu Editor.
- You use the &c symbol to specify a color value using the Red, Green, Blue (RGB) color model, and when you do, in a statement such as g.ForeColor=&c000000, the value is automatically color-coded to show which digits affect which component of the end color.
- A nice touch is the addition of an asterisk to the end of the displayed project name when the project is "dirty."
- The last visual touch that I'll mention (I'm sure there are many more) shows up when there is a compile error. Here's the same code as shown above except with a small change I purposely made that caused it not to compile. When I then ran the app in the IDE, an "Error" tab was created that listed the type of error, its location, a copy of the problem line and an error message with Findxindow highlighted (it should have been FindWindow, the name of a window used in a Find dialog) telling me that "This method or property does not exist". Double-clicking on the data in the Error tab sent me to a code tab where the problem line was marked with a cute little bug. Very visual!
- Also note the dashes in the left-hand margin. They are indications of where break points (just like the break points in VB) can be placed when debugging. I placed one on the third line to point out once again how similar REALbasic is to VB6.
I've mentioned several times that REALbasic is like VB; another way to demonstrate that is that it has its own version of IntelliSense. It operates a little differently in that you need to press Tab instead of Ctrl+Space, but when you do the list of available properties and methods appear. Debugging is also very similar to debugging in VB in that when you need to debug you can look at the call stack, step through, step in, or step out of code and edit code on the fly.
Finally, I like the fact that REALbasic is a cross-platform development tool. To quote from the REALbasic Users Guide, "REALbasic is truly a cross-platform application. The application itself runs under Windows 2000 and above, Linux with GTK 2.x installed, and Mac OS X. REALbasic can build applications that run on Windows 98/ME, Windows NT/2000, Windows XP, Vista, Mac OS X, and Linux." And, when there are aspects of one platform that don't apply to the others, REALbasic programmers can use #If...#Endif statements to control conditional compilation as show below.
Best of all, REALbasic creates the Nirvana of Visual Basic programmers—stand-alone executables!
What I Didn't Like
Some of the following may be due to a lack of understanding because of my REALbasic newbie status, but...
- When changing a window's name, there is no right-click paste option. You have to type the new name manually or do Ctrl+V.
- Properties are not explained in the property window as they are in VB6.
- When looking for something, the Find dialog allows you to keep cycling through previous matches. In other words, it doesn't tell you it is at the end.
I really like REALbasic. It seems quite powerful, it's easy to use, and its learning curve (at least for a VB6 programmer) is very short. I really wish that Microsoft had created a VB7 upgrade to VB6 rather than .Net, but REALbasic, in this programmer's estimation, is a more than sufficient "upgrade" for VB6.