TigaByte Logo

HyperNext and Visual Basic


Overview

Here is a very brief comparison of HyperNext and Visual Basic. It is aimed at beginner programmers and so is quite limited in coverage.

Although HyperNext and Visual Basic can both be termed RAD (Rapid Application Development) systems their target users are quite different. HyperNext is aimed at beginner programmers whereas Visual Basic is aimed more towards developers producing medium to large scale applications. HyperNext is also truly cross-platform and can build applications for both Windows and Macintosh platforms whereas Visual Basic applications run only on the Windows platform.

First Impressions

For newcomers to programming their initial impression of their chosen development tool is often gained when it first starts up. If the screen is filled with dozens of controls, toolbars and windows then the effect can be very discouraging whereas a simple interface can quickly instill some confidence.

Today most modern visually based development systems have similar interfaces comprising a menu bar, various toolbars and a main design window in which controls are placed. Both HyperNext and Visual Basic share this design but appear quite different due to their differing user requirements.

Below are shown the user interfaces of HyperNext and Visual Basic. To most newcomers HyperNext probably looks easier to use because it has just one design window, a single simple toolbar and a mode switcher. In contrast, Visual Basic is loaded with buttons, icons and many other mysteries that professional programmers need quickly to hand.

The HyperNext toolbar is very simple, having areas for Properties, Control selection and the Card List whereas Visual Basic is surrounded by toolbars on three sides.

 

Desktop  

HyperNext Creator interface

Desktop

Visual Basic interface

Integrated Development Environment(IDE)

The IDE allows a program's visual interface to be quickly designed and the program's code to be developed. Generally a program is developed by creating the various windows, placing controls on them and then gradually filling in the program's code so that the program can actually do something.

HyperNext has three modes: Design, Preview & Run which can be quickly entered using the mode switcher. It also has a keyboard shortcut allowing the language compiler to quickly check the whole program for syntax errors. Visual Basic also has these modes but they are located amongst the myriad icons and so can take a beginner some time to find.

Design Window

The Design window of the IDE is where buttons and other such controls are placed. It represents a window in the running program via which a user can interact. In HyperNext this window is called a "card" and in Visual Basic a "form".

Once a control has been placed on the Card/Form, its properties such as width, height, display font etc can be modified using the Property area of the toolbar. Both HyperNext and Visual Basic are very similar in this respect although Visual Basic has a much wider range of modifiable properties for its controls.

Visual Basic is intended for building a wide range of applications ranging from accounts packages to word processors and so its built applications need the option of having several windows open simultaneously. In contrast, HyperNext uses a card-based metaphor where only one window need be visible at any one time even though the program may contain thousands of windows(cards). For many types of software the HyperNext approach makes more sense and can greatly simplify a program's design and development.

Program Code

In both HyperNext and Visual Basic program code can be located in many places. It can be attached to a control as a handler or reside in various modules and even be called from external libraries.

A handler is just a procedure or small program that is executed when that control is activated by user interaction. Controls can contain more than just their own handler, they can also hold an almost unlimited number of local procedures so making them very powerful. Code located within a control is local to that control and in HyperNext cannot be accessed from outside that control. Another control having handlers is the user-defined menubar which has a handler for each menu-item.

When creating software it is usually best to use a structured or modular programming approach. At its simplest, structured programming mean breaking the program down into manageable chunks where each chunk is implemented by a procedure or function. HyperNext and Visual Basic both support modules that can hold global procedures and global variables. Unlike Visual Basic, HyperNext currently only supports one internal module which is fine for small programs but for larger programs development is made easier by being able to access external libraries.

In HyperNext these external libraries are called plugins and can be easily built using HyperNext Developer which is part of HyperNext Studio. Plugins can access nearly all HyperNext functionality and can even be used to make new types of control.

Language Differences

Programmers familiar with languages such as BASIC, Delphi, C++ etc will find HyperNext quite different in terms of statements and the manner in which it stores and accesses data in memory. For beginner programmers, the HyperNext approach allows them to create their own software much more quickly than with a conventional language. Once they are comfortable creating their own software then they will be in a better position to understand more conventional languages .

Statements

Statements or commands are usually a single line of code that tells the program to to something, for instance:

Task

Visual Basic

HyperNext

add two to a variable x

x=x+2

Add 2 to x

access an array element

x=y(5)

Put line 5 of y into x

Variables

Most languages use typed variables, that is, a variable declared to be of a specific type such as integer, string, real, boolean etc. For example, the compiler needs to know whether a particular variable will hold a whole number, a decimal number, a string and so on. In HyperNext though, all variables are stored as strings and need no type declaration, they just need their name declaring and an indication of whether they are Global or Local.

Global variables are accessible from anywhere within the program while Local variables are only accessable from within the Procedure where they were declared.

Unlike most languages all local variables in HyperNext are static and so retain their value even when their Procedure has exited.

HyperNext also treats variable storage quite differently to most other languages and assumes that variable storage is persistent and not just temporary. When a HyperNext application or stack quits the default behaviour is for all global and local variables to be saved. This automatic saving enables automatic restoration of variables the next time the application or stack is run. Such automatic saving/restoring makes it much easier for beginners and means they do not have to learn about file operations until much later on.

REALbasic RBscript

If you are familiar with modern BASICs then you will be pleased to know that HyperNext programs can create and run RBscripts. RBscript is a subset of the modern Object Oriented programming language REALbasic which has many similarities to Visual Basic. REALbasic is developed by REAL Software and there are many REALbasic resources readily available on the internet:

RBscripts can be loaded into HyperNext in several ways:- via drag and drop from an Edit-Field, read in from a text file, typed in by a user or even created by a HyperNext program. Once an RBscript is loaded it can then be compiled, tested and run.

Examples of HyperNext RBscripts suitable for beginners are the Circles and the Mandelbrot examples included with HyperNext. RBscript is also used in some of the neural network projects and plugins accompanying the HyperNext bundle.

 

TigaByte Software 2014

 
 

Information