Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes OO abstraction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "OO abstraction" Watch "OO abstraction" New topic

OO abstraction

Michael Waites

Joined: Mar 30, 2001
Posts: 8
No laughing, please....
I have been taught that Hungarian Notation is the way the world does things. So why in Style Guide used for the Cattle Drive do they state:
Hungarian Notation violates OO abstraction and is not to be used.
Maybe the correct questions is, what is OO abstraction.

(Ohh, I feel like a newbee!!)
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241
Don't worry, Michael, we're all laughing with you, not at you.
You have been misinformed: Hungarian notation is not the way the (Java) world does things. Says Bruce Eckel in his book, Thinking in Java, p. 1052:

"Hungarian notation is the worst example of [creat[ing] your own "decorated" private data member names], where you attach extra characters that indicate data type, use, location, etc., as if you were writing assembly language and the compiler provided no extra assistance at all. These notations are confusing, difficult to read, and unpleasant to enforce and maintain. Let classes and packages do the name scoping for you."

So I think Mr. Eckel is trying to dissuade you from using Hungarian notation.
It's a bad thing, don't do it!
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
This is good reading:

"JavaRanch, where the deer and the Certified play" - David O'Meara
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
And for extra fun you can always do a JavaRanch search on "Hungarian". There have been lots of threads discussing this in the past.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
octavyn pittman
Ranch Hand

Joined: Mar 06, 2001
Posts: 134
I particularly like a section from the "ugly" from the above link:
Hungarian notation is, when all is said and done, a commenting technique. And the one great law of comments is that they lie. Comments are not syntax checked, there is nothing forcing them to be accurate. And so, as the code undergoes change during schedule crunches, the comments become less and less accurate.

Ahh documentation...
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Of course you are making an exception for MY documentation - yes???
I agree. Here's the link:
subject: OO abstraction
It's not a secret anymore!