The Artima Developer Community
Sponsored Link

Weblogs Forum
Directories are not Java source file package names

19 replies on 2 pages. Most recent reply: Dec 29, 2004 4:53 PM by Gregg Wonderly

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 19 replies on 2 pages [ « | 1 2 ]
Tasos Zervos

Posts: 17
Nickname: tzervos
Registered: May, 2003

Re: Directories are not Java source file package names Posted: Oct 1, 2003 6:45 AM
Reply to this message Reply
Advertisement
> I'm no fan of the Java conventions for placing brackets
> or capitalizing variable (and other) names but life is
> too short to plough my own furrow on these issues.

Although this is true, the issue here was about IDEs enforcing such rules or not... It was about options!

For example I prefer to read and write my code using the West Coast style of tabs and identation. It happens to be the case that the rest of my team like it as well. Why should the IDE force us to use the K&R style?

To state the issue again: The IDE should have options for things you might want to enforce and are not required by the language spec. The IDE should not have options for things required by the language spec.

Gregg Wonderly

Posts: 317
Nickname: greggwon
Registered: Apr, 2003

Re: Directories are not Java source file package names Posted: Oct 1, 2003 7:07 AM
Reply to this message Reply
> You have the technical facts right but the human interface
> wrong. The thing to remember is that the source file
> hierarchy is not primarily for the compiler - it's for the
> other people who read your code. When I'm looking for the
> source code for the class named org.whatsit.foo.Bar, I
> look in the corresponding place in the source tree. I
> don't want to have to search around for the source file.
> Being "creative" about arranging your source tree just
> ensures that your source code is that much harder to
> read. So I'm happy that IDE's enforce the conventional
> way of doing things, even if it's not strictly required
> by javac.

The IDE and the rest of my environment have no problem with how I arrange my files. Others looking for source know that the best choice for finding a class is to use "Find in Project Files" (which is informative from a referent class perspective too), or go to explorer and use search, or, click on the "Packages" tab in Kawa and look by package there. We all have found it very convienent to be able to arrange our project folders in the IDE in arbitrary fashion so that we can think the way that we think about the things we are doing. This makes us much more efficient at the mundane tasks of file manipulation.

When a new file is added to the project, and the tree is mostly flat, it appears more obviously in the IDE and you can spot it/them and go see what is up.

> Having empty directories at the top used to bug me too,
> but I got used to it, and now I wouldn't have it any other
> way.

Well, but how much of your working mode is driven by the IDE verses what you would be the most efficient doing? That is the real question for me.

I do VI editing and ant compiles on a regular bases too, because it is the fastest way to make changes in many cases.

Others have talked about doing that here. It seems to me that either we are holdouts for a 'better' IDE, or our brains just don't work the way the IDE developers do, and so the collision of UI and thought process is problematic.

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Directories are not Java source file package names Posted: Oct 1, 2003 8:57 AM
Reply to this message Reply
> At my previous company I was working on a large codebase
> with perhaps 25 other developers; a full javac would take
> several minutes (on my Pentium 4, maybe 1.4GHz).

Simply using Jikes instead of Javac would have solved this problem. Using Jikes inside of IDEA (which is trivial to set up) is even better.

Kumar Mettu

Posts: 1
Nickname: javaswamy
Registered: Oct, 2003

Directories are Java source file package names Posted: Oct 4, 2003 10:32 AM
Reply to this message Reply
Please find the response at my blog.
http://javaswamy.blogspot.com/archives/2003_10_01_javaswamy_archive.html#106528784705182717

Gregg Wonderly

Posts: 317
Nickname: greggwon
Registered: Apr, 2003

Re: Directories are Java source file package names Posted: Dec 29, 2004 4:53 PM
Reply to this message Reply
Now lets get back to reality. Though Java Language Specification doesn't impose the restiction of Directories are Java source file package names, JavaDoc does. JavaDoc tool faq states "If your classes do not all belong to the unnamed package, you must put them in directories named after the packages.". So if you need to generate javadocs for your project and use JavaDoc tool to generate the documentation, Directories are Java source file package names.


The above statement is copied from the specified blog.

The problem is that you can in fact just name the source files on the command line and javadoc has no problem with processing the files. With large sets of files, this can cause command lines to become very long. But, in the end, it takes care of making sure that you can explicitly name the classes you want included, which I find to be a benefit.

Flat View: This topic has 19 replies on 2 pages [ « | 1  2 ]
Topic: Heron.NET or JHeron? Previous Topic   Next Topic Topic: Static versus Dynamic Event Handlers in C++

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use