Upgrading from J3 to J4

Dick Bowman

Contents

After using J3 for some time and watching the steady stream of J announcements it seemed timely to think about an upgrade to J4; J Software offers a two-week evaluation period which entails getting an evaluation key - this is all integrated into the download procedure.

Installation

Simple and straightforward; the recommendation is that J4 should be set up so that it can be used in parallel with earlier versions rather than replacing them, so that's what I did.  The version used was 4.03c; I had previously been using 3.05.  Hardware a dual-processor Pentium II/233 with 128mB RAM and "enough" disk space.

Initial exploration revealed a lengthy list of changes (from the base 4.01 version); not all of the implications of these changes are immediately apparent.  Although the options under the help menu are extensive it's not clear how current they all are; it seems a little chaotic.

There's been some reorganisation of the supplied files, now distributed across a slightly changed folder structure.  This necessitates some exploration in order to re-establish a comfortable working environment

Return to Contents

Initial Conversion of a Sample Application

The application chosen for conversion was quite simple; allowing the user to choose from a set of application-use logging files, tabulating, summarising and plotting the information...

Looking at some (but not all) of the new features available when moving from J3 to J4...

Return to Contents

Form Facilities

Aside from the addition of grids and the removal of isitables this seems to be essentially unchanged (still a relatively simple and restricted GUI compared to Dyalog APL - or Visual Basic).  The grid will probably (judging from its usefulness in Dyalog APL) prove to be a very valuable extension.

New Window Driver commands allow colours to be specified for forms and controls (worth noting that this is documented both in the Release Notes and in the main body of Windows Driver reference); it makes for some relief from the unrelenting greyness.

The popup menu enhancement looks useful; if only (perhaps it can) it can be activated with a right mouse click.

Return to Contents

Code Editor Changes

In addition to the syntactic colouring already mentioned there are many enhancements to the code editor (applying both to .ijs and .ijx windows) such as drag-and-drop.  These all go toward making J coding less tedious (let's face it, writing code is always tedious - no matter what the language)

To give some idea of the effect...

J3, without colouring, becomes...

J4, with colouring.

Return to Contents

Object-Oriented Programming in J

A 70-step Lab purports to explain all, but does make the important point that OOP can sit beside FP (functional programming).  I'm glad to see that in print.

Dabbling with Smalltalk, Java and VB hasn't really given me a lot of insight into what's so "wonderful" about the OOP way; once we get beyond the "reusable code" incantations it never seems much more than a complicated way to do simple things.  One might, if one were cynical, even suspect that it represents a way for "computer scientists" to justify their existence.  The J OOP Lab doesn't do a lot to help me over this hurdle; it would be nice to see a comparison between an OOP solution and an FP solution to the same (small) problem one day.

Possibly my difficulty is that I want a class called "APL/J variable" and methods that correspond to APL and J functions.

Noting that the Grid examples all use OOP I suspect that this will begin to ease the way.

Return to Contents

ODBC

The ODBC interface has been completely rewritten, so I moved over an application which uses ODBC with a Microsoft Access database.

The only changes required were (again) to change the script filename extension and to make one assignment global rather than local (there's a comment in the Release Notes about this, but it's rather cryptic).  The code for the application (several hundred lines spread across 18 script files) appears to run unchanged, sitting now on top of the new ODBC interface.

ODBC seems a little slower to start operating (fetching data from different Access tables) but a long-standing irritation (which I reported to Strand/J, but which they could not replicate) appears to have been remedied; the problem was that after doing a few data fetches the application would slow down and effectively freeze.  This looks good, although it does raise the bogey (far from specific to J) about whether it is ethically correct for a vendor to require payment when bugs are fixed.

Return to Contents

Memory Mapped Files

This impressively simple (to use, can't tell about the implementation effort) offers a very powerful set of tools for operating on files as if they were "normal" J variables.  The introductory Lab session is clear (although it does digress into some implementation technicalities) and certainly one begins to wonder whether it might become possible (and desirable) to seep away a lot of application code which treats files as something special (files).  Hopefully there aren't going to be too many unpleasantnesses hidden away when the functionality is used in earnest; I've long felt a little apprehensive about the way that J developers appear to introduce major functionality then move on to something new rather than clean up all the details.

Return to Contents

Project Manager

The Project Manager at the very least begins to introduce some structure into the process of building applications with J.  Documented with a help file (and not a Lab) it probably has more immediate appeal to the J newcomer than the old hand (who may well have developed their own mental model for putting a project together).

But it does look to add rigour to the process and it is probably unwise to ignore the Release Note encouragement to adopt it; actually, what this highlights once more is the desirability of more documentation - an example of using the Project Manager would be invaluable (otherwise everyone is likely to create their own personal interpretation of how it is intended to be used, and an example would save a lot of time otherwise consigned to experimental learning).

Return to Contents

Debug

Described as an interim version, debug offers a (fairly elaborate) variation on the sort of line-by-line execution visualisation to be found in VB, Delphi and Dyalog APL.  As with the Project Manager - it has been built using J rather than being hardwired into the interpreter.  The sort of display you see while running with the debug option in action is shown below.

Again, I'm not sure about the absolute value of this sort of thing;  I used Dyalog APL solidly for two years without looking at the debug display more than a handful of times and I may have made my life more difficult as a result (although it didn't feel like it).  I suspect that it will be more useful in J because the default of clearing suspensions makes it more tedious to home in on what's what when code breaks.

Return to Contents

Conclusions

There's a lot more to J4.03 than I have covered here; the essence of this exploration has been to decide whether to upgrade from J3.05 to J4.03 (or possibly wait for the sparse arrays due "soon").

The move from J3 to J4 reveals a product which is becoming more stable (in the sense that old functionality tends not to be decommitted, and the base J language isn't changing a lot) and which is growing capabilities which make it increasingly suited to serious (i.e. paid for) application development.  The pace is still pretty hot, with sparse array support announced but not yet in an available product.

Will I pay the money?  That's for me and J Software to know...

Return to Contents

Return to the J\APL Contents page

Copyright Dick Bowman, 1999-2013; latest update 11 March 2013 (repaired links)