Clear code is the best code.
Bear Bibeault wrote:The * only represents one level of hierarchy.
Dave Tolls wrote:
In fact, I would say there is simply no concept of hierarchy in packages, from the compilers (and JVMs) point of view.
but as far as Java is concerned they are completely unrelated. They are just organized like that for the convenience of the developer.
I don't need to ask why, because I already know why. Those people know good programming style.salvin francis wrote:. . . don't ask why . . .
salvin francis wrote:Maybe, you are right, but nevertheless, they are a folder structure and hence a hierarchy from a developers point of view.
Jesper de Jong wrote:It might look like a hierarchical structure to you, but that's not how the compiler treats packages.
Campbell Ritchie wrote:For the same reason as I mentioned earlier about Timer.
Campbell Ritchie wrote:Please avoid conflating Java® and C++. They are different languages, even though their syntax looks so similar.
Clear code is the best code.
Dave Tolls wrote:
Bear Bibeault wrote:The * only represents one level of hierarchy.
In fact, I would say there is simply no concept of hierarchy in packages, from the compilers (and JVMs) point of view.
Yes, java.awt.event looks like a lower level of java.awt, but as far as Java is concerned they are completely unrelated. They are just organised like that for the convenience of the developer.
Clear code is the best code.
I have known people who even frown at using "*" wildcards in the imports and who insists in importing only those classes which are used in code (don't ask why )
Clear code is the best code.
Dave Tolls wrote:
Bear Bibeault wrote:The * only represents one level of hierarchy.
In fact, I would say there is simply no concept of hierarchy in packages, from the compilers (and JVMs) point of view.
Yes, java.awt.event looks like a lower level of java.awt, but as far as Java is concerned they are completely unrelated. They are just organised like that for the convenience of the developer.
Clear code is the best code.
Shawn Lau wrote:In that case they should have used a different symbol than a wild card, because ...
Bear Bibeault wrote:
Shawn Lau wrote:In that case they should have used a different symbol than a wild card, because ...
Not really. In many systems a single * represents a single level, while ** is used to indicate "whatever comes after". In any case, not supported by the import statement and unlikely to change.
Clear code is the best code.
Bear Bibeault wrote:Then there are a lot of "eccentric" systems out there.
Clear code is the best code.
Shawn Lau wrote:Its just hard to accept some of it with a straight face.
Paul Clapham wrote:
Shawn Lau wrote:Its just hard to accept some of it with a straight face.
When I'm learning a new language I find that it's better to accept the language as it is. That goes for both computer languages and human languages. Complaining about language features is unproductive (as they aren't going to be changed) and just gets in the way of the learning process.
Clear code is the best code.
Shawn Lau wrote:Why get egocentric about languages? It like, "We don't call the pointers in java because they could be anything, but they probably are pointers" This from Head first Java talking about how objects are referenced. Mysticism and programming is not a great match.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
"Java references are NOT pointers and hopefully never will be - indeed, one of the foundation stones of the language was to get rid of pointers. "
Clear code is the best code.