aspose file tools*
The moose likes Java in General and the fly likes How important is it to go through the JLS? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How important is it to go through the JLS?" Watch "How important is it to go through the JLS?" New topic
Author

How important is it to go through the JLS?

Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Perhaps this is a bad place to ask this, and it's surely off-topic, but I would like to hear opinion from Mr Campbell (and other Ranchers, of course). How important do you think it is to go through Java Language Specification? I see that you are often referring to it, but I never actually read a lot of it. Usually when I am facing a problem or having a doubt I consult API, or some of the books I used when I was learning Java in the first place (and of course, this forum if none of it helps).


The quieter you are, the more you are able to hear.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Kemal Sokolovic wrote:Perhaps this is a bad place to ask this, and it's surely off-topic, but I would like to hear opinion from Mr Campbell (and other Ranchers, of course). How important do you think it is to go through Java Language Specification? I see that you are often referring to it, but I never actually read a lot of it. Usually when I am facing a problem or having a doubt I consult API, or some of the books I used when I was learning Java in the first place (and of course, this forum if none of it helps).


No longer off-topic now that the thread has been split.

I don't think any normal Java programmer needs to read the entire JLS. It's probably a good idea to look over the table of contents, and check out a little bit of each section, just to get a feel for what's in there and how it's written. Most of what you need to know to program you can get from tutorials, examples, and trial and error. Then, when you get down to wondering about the nitty gritty details of some particular point, you can refer to the relevant parts of the JLS. And of course, if you want to argue about the rules of the Java language, then the JLS is the ultimate authority.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

What kind of labeling this is - "any normal Java programmer"?
Thanks for the response, I'll keep that in mind and probably take a look at some parts of JLS when necessary.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18662
    
    8

Let me put it this way -- I have been programming Java for about 10 years and I have never even looked into the JLS. And I think I'm a normal programmer, at least I've been pretending to be one for the last 40 years. It's usually obvious to me how things are supposed to work, so I leave the heavy reading to those who like reading that kind of document.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39415
    
  28
It is important to know what is in the JLS, so I agree about looking through the table of contents. Some parts, like this part are impossible to read through. I don’t think you will manage to read the whole JLS, but it is worth looking at any part you are having difficult with. Remember (as I usually say) it is often difficult to read.

Another reason I often refer to the JLS is that it is the ultimate authority on Java.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

Kemal Sokolovic wrote:Usually when I am facing a problem or having a doubt I consult API, or some of the books I used when I was learning Java in the first place (and of course, this forum if none of it helps).

I basically agree with my colleagues here: the JLS is a reference, not something you need to read "from cover to cover".

Also, it deals with how the language works, not how a class behaves (except some stuff about Strings and wrapper classes).

For example, if you have a horrible legacy class with a pile of overloaded methods, the JLS will tell you precisely how the language goes about choosing which method satisfies an ambiguous call. It also explains exactly how all the operators work, and how literals are used - two sections that I would say are worth reading.

It's main problem is that it was written by technicians (at least that's my suspicion), not good technical writers, so it won't win any prizes for prose style.
Also, for the basics, the tutorials cover a lot of the same ground - and they're MUCH easier to read.

My 2 cents.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Ok, thanks for all for the responses. I will keep all that in mind.
Actually, I have opened JLS couple of times (usually as reference given in this forum by some of you), and it looked to me like it's too formal specification to read now. As it has been repeated here as a reference in many topics, I started to wonder am I missing a lot by avoiding to read it, hence this topic.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Kemal Sokolovic wrote:As it has been repeated here as a reference in many topics, I started to wonder am I missing a lot by avoiding to read it, hence this topic.


It's usually used here to settle an argument, or to provide a precise answer on how the language behaves when the question and/or subsequent discussion is "fuzzy." In that second situation, it can serve as a starting point to get clarification or steer the discussion in the right direction.

Sometimes when I refer to a specific section in a response here, I know ahead of time exactly what I'm looking for because I've read that section before. Other times, I have no idea, but I know that the answer is probably in the JLS somewhere, so I just search for relevant sections.

A good way to start getting a passing familiarity with it, if you're interested, might be to go ahead and follow a link when you see one here.
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3018
    
  10
It used to be, it was also useful to decide whether unexpected behavior was correct or not. Because the compiler and JVM used to have a lot more bugs - when something strange happened, it wasn't clear whether it was supposed to happen or not. So it was helpful to check the documentation to see if it was a bug. Nowadays, well, bugs still exist, sure. But language-level bugs are a lot less common than they once were, so checking the JLS seems less frequently necessary than it once was.

Anyway I think I only knew one person who actually read the whole thing through cover to cover. And she did learn a lot doing that. Me, I just look at specific sections when an issue comes up. I agree with Campbell that it can be helpful to know what's in there, and to get some practice in interpreting it. But it's also possible for someone to be an excellent Java programmer and never look at it once.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How important is it to go through the JLS?