REVIEW - The Elements of Java Style


The Elements of Java Style






Cambridge University Press ()




Francis Glassborow


June 2000



This is a very small format book (each page is about a third of the area of a page of A4 (Overload, new format C Vu). The main text takes 93 pages. That is followed by eight pages listing the 108 style guidelines that the main text covered in more detail, and then there is a glossary and index. Almost half the entries in the index refer to the glossary.

None of the above would matter if the guidelines sparkled. However just let me take one at random.

62 Explain local variable declarations with an end-line comment. Not exactly innovative stuff. Then two guidelines on, I find:

64 Label closing braces in highly nested control structures Well if you are going to nest them deeply, I suppose it makes sense to label them. However, I think a much better guideline would be 'Avoid nesting control structures.' Any experienced programmer will tell you that nesting control structures is a recipe for buggy code.

I think that is enough. Keep your money, if this book tells you anything you do not already know then you need it to invest in learning to program.

Book cover image courtesy of Open Library.