GNU Java Training Wheels 1.1: About GNU Java Training Wheels

Next: J.T.W. Proof of concept #1 A superfor macro, Previous: Top, Up: Top [Contents][Index]

## 1 About GNU Java Training Wheels

This document documents a new programming language written by me, Davin Pearson (email: `davin dot pearson at gmail dot com`) called J.T.W., short for Java Training Wheels for the sole purpose of making it easier to learn to program in Java. The J.T.W. language has a similar syntax to Delphi, Pascal, BASIC and JavaScript and therefore learning J.T.W. before or while learning Java provides a less steep learning curve than learning Java from scratch. For many reasons you might even prefer to program in J.T.W. rather than Java. Here is why you should learn J.T.W. before or while learning Java:

- The J.T.W. language is supported by a parser that troubleshoots problematic J.T.W. code with clear error messages.
- The J.T.W. language compiles to Java in a natural and straightforward way so it is easy to learn Java once you know J.T.W.. See the following diagram for a comparison of the J.T.W. and Java build processes.

          +-----+
          |*.jtw|
          +--+--+
             |
             v Emacs' batch mode
          +------+                   +------+
          |*.java|                   |*.java|
          +--+---+                   +--+---+
             |                          |
             v javac compiler           v javac compiler
          +-------+                  +-------+
          |*.class|                  |*.class|
          +--+----+                  +--+----+
             |                          |
             | java                     | java
             V                          V
      runs the class             runs the class

- Pascal-style `begin` ... `end` constructs are supported instead of C-style `{ ... }` constructs which is more sensible especially for novices.
- A simple syntax for the `main` `function`: `beginMain` ... `endMain` rather than the rather cumbersome: ``public` `static` `void` `main`(String[] args) { ... }`.
- Class variables, properties, functions, methods and constructors are declared as such much like Delphi which makes your code look clearer. Specifically there are new keywords `classVar`, `constructor`, `function`, `method` and `property`.
- The Delphi/Pascal/JavaScript keyword `var` for clearer local variables.
- The Pascal/BASIC keyword `then` for clearer `if` statements.
- The BASIC and C++ style keywords `and` and `or` rather than Java’s rather cumbersome: `&&` and `||`.
- The P.H.P. keyword `elseif` is supported instead of Java’s cumbersome `else` `if`.
- As proof of concept, a `superfor` macro is presented for enhanced BASIC-style `for` loops. See J.T.W. Proof of concept #1 A superfor macro.
- As proof of concept, file inclusion is supported so that you can spread a class across several files. Natural divisions are methods. Different methods can be placed in different source files for those situations where methods become large and unwieldy. See

  J.T.W. Proof of concept #2 file inclusion.

- NEW! As of J.T.W version 1.1, packages are now supported. See Packages in J.T.W. and Java.

Next: J.T.W. Proof of concept #1 A superfor macro, Previous: Top, Up: Top [Contents][Index]