BlueJ 3.0 – What’s new

We’ve been working on it for the last eight months, and now it’s finally here: BlueJ 3.0.

Version 3.0 of BlueJ includes the most significant set of updates to BlueJ functionality since version 2.0 was released in 2004. (Yes – 2004! That was when we had no Google maps, no Facebook, no Twitter. It’s really that long ago…)

It might be good to summarise the most important of them.

The one thing that many people will notice first is an interface update:

The BlueJ 3.0 main window

The BlueJ 3.0 main window

The interface had a slight update and polish. Nothing too significant – we aimed at providing a slightly more modern appearance while still retaining the instantly recognisable “BlueJ look”. As part of the interface update, object inspectors have also changed in looks:

An object inspector

An object inspector

The inspector now looks like a magnified version of an object on the object bench. This emphasises that this is just another view of the same thing (just with additional detail provided).

The functionality of the object inspector is unchanged: fields can still be inspected further, static fields can be displayed, and so on.

The main changes in BlueJ 3.0, however, are not its looks. Our main effort has gone into improving the editor.

The BlueJ editor has always been fairly simple. 10 years ago, when it was originally written, it was simple and mainstream. Today, it was just embarrassingly simple.

Davin McCall, one of our senior developers on the BlueJ team, has implemented a new parser for BlueJ that forms the basis for much of the new editor functionality that you can see in 3.0, and also for some future features that will appear over the next few months. The most interesting of the new editor features are:

  • Scope highlighting,
  • the navigation view, and
  • code completion.

Let’s briefly look at them.

Scope highlighting

We have added background colouring to the editor to highlight scopes:

The new BlueJ 3.0 editor

The highlight makes it easier to see when brackets are missing or mismatched, and thus makes some errors more obvious. It hopefully helps students understand the concept of nested scopes.

The Navigation View

The Navigation View

The Navigation View

To the right of the editor is the “Navigation View”.

The navigation view shows a miniature version of the full class text, and highlights the currently selected viewport.

It is usable like a scroll bar: The view can be dragged, clicked, moved with a mouse wheel, etc. This gives a better overview over a source file for easier navigation.

When the mouse hovers over the navigation view, tool tips show relevant method names – this makes jumping to specific methods quicker than before.

The idea for the navigation view is taken from the “Fluid Source Code Editor” by Michael Desmond, which I saw presented at the PPIG workshop by Chris Exton.

Code completion

One of the most contentious non-features of BlueJ was, and always has been, code completion.

Almost from the very beginning, when BlueJ 1.0 was released in 1999, people have asked for code completion. Other people have been tearing their hair out in horror at the mere mention of the possibility of code completion ever being added to BlueJ. The discussions at the First Vatican Council were just a chat over coffee in comparison.

In the past, we have sided with the contra faction. (Okay, I admit: we have pretty much led the contra faction.)

But, as Konrad Adenauer, the first German post-war chancellor, said: “Was kümmert mich mein Geschwätz von gestern”.

Fact is: we have always aimed at providing tools that can be taken for granted in all reasonably modern development environments. 10 years ago, this included compilers and debuggers, but not code completion.

Code completion, back then, was still a “cool feature” that only a few high end environments provided. We did not want to create reliance on a feature that might be absent later in other environments, which meant that students could not look up documentation competently.

This has now clearly changed. Code completion is now a standard feature in mainstream environments, and the arguments against using it have grown weaker than my grandmother’s bed time cup of tea.

So, in short: code completion is finally here.

Code completion

In the BlueJ editor: code completion

In contrast to other environments, the code completion pane does not pop up automatically, but has to be activated explicitly (Ctrl-Space, by default). This means that the code completion function will not pop up unexpectedly and frighten beginners into spilling their Dr Pepper over their keyboards.

And wait, there’s more…

There is more good stuff to find in the latest BlueJ release. If you are interested, have a look at the BlueJ change log or — better still — download it and give it a run around the block.

You might like it.

(Images in this post are produced by the author and are hereby placed in the public domain.)