Tuesday, March 2, 2010

Debugging: Class, interface, or enum expected.

Java's error messages aren't always very meaningful - to novices at least. Take this, what we might imagine to be a fairly common error:

Class, interface, or enum expected.

Now, I know what it means, but would a new programmer? To understand this message, you surely need to know what an interface or an enum is - neither of which are likely to be taught in the first few lessons.




Therefore, JAKE aims to make debugging a bit easier. When a JAKE program is compiled, the IDE reads the feedback from javac and tries to translate it into simpler language. Obviously, it's important to maintain parity with the Java error itself, so the actual error message is always shown. It's just that JAKE also gives a short, plain-English explanation too.


Since JAKE's being developed to research teaching programming, it's not going to include an explanation for every possible javac error. However, the system is designed in such a way that it's modular; the explanations are taken from text files, and JAKE just looks for a file that matches the javac error description. See below, where there's no matching explanation for the error:



The explanations, where they do exist, are also quite short, so it's feasible that the novice programmer might want more help. To get around either of these problems, there's a link to Google. Yes, this might sound overly simple, but it seems like a good, quick (since this is only a demonstrator) way of providing extra help. Why duplicate help content that can be found on the web? When the user clicks on the link (either link, if there's no explanation and a link appears instead), their default browser opens and they're taken to a Google search page about their error:

No comments:

Post a Comment