• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bloch namin' methods funny...  RSS feed

 
Nick George
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cut and pasted from ArrayList, by author Joshua Bloch. Ain't it sposed ta be rangeCheck? Now, I ain't one ta come at Joshua Bloch about his programmin', but what's the deal with that?
Sorry, I meant to post this at beginner, feel free to move.
[ April 20, 2004: Message edited by: Joseph George ]
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be honest, this might just be an editing error, and I suspect that it is.
From the author's point of view, it's a weird call, because it's not technically incorrect, so do you put it in the errata?
M
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be honest, this might just be an editing error, and I suspect that it is.
Max, Joseph actually refers to the code in ArrayList.java, directly from the JDK. It does look abnormal. One thing that crossed my mind when I looked at that class is that the RangeCheck() is the only private method in there (well, except for the writeObject() and readObject(), but these two are really special). So, perhaps Joshua Block was using the capitalized methods as a convention to indicate that they are private methods (this code was written in 2001). More likely, however, is that it's simply a typo in the original code that is still part of Java since 2001.
[ April 20, 2004: Message edited by: Eugene Kononov ]
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eugene Kononov:
To be honest, this might just be an editing error, and I suspect that it is.
Max, Joseph actually refers to the code in ArrayList.java, directly from the JDK. [ April 20, 2004: Message edited by: Eugene Kononov ]

You're right , I should have read the post more carefully.
 
Nick George
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing that crossed my mind when I looked at that class is that the RangeCheck() is the only private method in there (well, except for the writeObject() and readObject(), but these two are really special).

I too considered this possibility, but it seems unlikly the the two really special methdos would follow the normal convention, and the not-so-special private method would be the one to violate the convention. Are we satisfied with the typo explanation, or do we want to dig deaper?
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
who really cares?
Are you suddenly not going to use any code Joshua Bloch wrote because he used a single capital to start a method name somewhere?
Is he suddenly any less of a programmer, or is Java suddenly not a good language to work in?
If you're that interested, try to contact him. He might be able to explain himself.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Max]: To be honest, this might just be an editing error, and I suspect that it is.
I'm inclined to think it is still an editing error - made while editing the code, perhaps using an IDE (propagating the goofy method name to all uses of that method name). Note also that just because the code lists the author as Josh Bloch, that doesn't mean that he's the only person to have edited the code. Many other people could have made minor changes. Whoever introduced the goofy method name, it's gone unnoticed because it doesn't really affect anything. Perhaps the next time someone has a reason to edit ArrayList.java, they'll notice and fix it. But while it is a violation of Sun's coding standards, it's not a big deal really. I suspect that Sun engineers have one or two other issues that are higher priority for them right now.
 
Nick George
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please to note that obviously i'm not coming at Joshua Bloch, someone was saying something about losing respect for him because of this, which rather came out of nowhere... i was just figurin' this guy quite literally wrote the book on naming conventions, I was wondering if there was some kind of rule. My only difficulty with the editing error theory is that the method was called somewhere within the program. What are the odds that the method was both written, and called without noticing? Plase also note that this is just a passing curiosity.. if no one else cares, we can just let the thread die out
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!