JLS : Java Glossary

JLS

JLS (Java Language Specification). A lawyerly document that specifies the grammar of the Java language. This is the ultimate authority on any question of what is legal syntax in Java and just what any Java program is supposed to do. It is primarily aimed at compiler writers and lawyers. It is all but unintelligible to newbies. It is the bible used to settle language disputes in Internet discussions.

It is written in a language it rarely answers my questions clearly. Perhaps I am too much of a lawyer. I find too many ways of interpreting its language. Most of the time it might as well be written in Chinese. It uses language that to me bears little resemblance to the Java symbols I manipulate. It has too many of its own abstractions. It is written to impress, perhaps as a legal document, but not to explain to ordinary humans who understand best by generalising from examples to get the general idea plus the general rule to nail down the fine points. In short, I have little confidence in my interpretations. It is OK for things I know already, but not for things I find puzzling.

The problem with using experiments to deduce the rules of the Java language is that if something does not work, it may well be for a reason quite different from the thing I am testing. If it does work, there may be no guarantee it will always work, or work in other situations.

To settle a question I use a multi-pronged approach:

  1. Do some experiments to develop a working hypotheses of how I think the language works. Even a newbie can perform experiments. The experiments can be polished to become SSCCEs (Simple Self Contained Compilable Examples) for later posting for discussion of unresolved matters. (I have posted all kinds of SSCCEs on this website. You can often use them as a starting point for your own experiments.) Keep the code short and independent of unrelated code. Note to self: if you try to perform your experiments in the middle of a giant project, there are too many factors that many interfere with your conclusions.
  2. Read the JLS to see if it concurs. I find it almost impossible to make sense of the JLS unless I already have a hypothesis or two on what it might mean.
  3. Bring the issue up in the comp.lang.java.programer  newsgroup for discussion. I will find out quickly if there is controversy and fueled by the desire to prove each other wrong, programmers will settle the issue. The catch is they will chastise me severely for not trusting my own interpretation of the JLS and for disturbing them by posing a question they may optionally discus.

Sources:


available on the web at:

http://mindprod.com/jgloss/jls.html
ClustrMaps is down

optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\jls.html
logo
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy.
Blog
IP:[65.110.21.43]
Your face IP:[54.198.224.121]
You are visitor number 10,391.