Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.java.programmer Subject: Re: Death To Sub-Sub-Sub-Directories! Followup-To: comp.lang.java.programmer Date: Fri, 06 May 2011 11:56:44 +1200 Organization: Geek Central Lines: 37 Message-ID: References: <34va98-dgm.ln1@dagon.net> NNTP-Posting-Host: 118-92-95-178.dsl.dyn.ihug.co.nz Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: lust.ihug.co.nz 1304639804 6935 118.92.95.178 (5 May 2011 23:56:44 GMT) X-Complaints-To: abuse@ihug.co.nz NNTP-Posting-Date: Thu, 5 May 2011 23:56:44 +0000 (UTC) User-Agent: KNode/4.4.7 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3628 In message <34va98-dgm.ln1@dagon.net>, Dagon wrote: > Lawrence D'Oliveiro wrote: > >>Google’s tool for creating an Android project insists on creating a >>subdirectory hierarchy corresponding to the package naming hierarchy. > > So does everyone else's java tools, including eclipse, netbeans, javac. > And by "insist", you mean "does this by default" - it's optional but > highly recommended. It’s a pain in the bum. >>Thus, if you name your class com.example.test_project.Main, it will put >>Main.java inside the subdirectory src/com/example/test_project/. > > Right. That's sensible for any non-tiny codebase. I just looked at a “non-tiny codebase”, not written in Java—the Linux kernel. I counted up about 13 million lines of C code, and it goes no more than 3 subdirectories deep. There is no hierarchical division along anything resembling namespace lines. And this is widely regarded as one of the most productive and high-quality software projects in the world. I conclude from that that imposing a directory hierarchy along namespace lines is not actually helpful for “non-tiny codebases”. Furthermore, for your typical, more modest-sized mobile-phone app, it’s going to be downright counterproductive. >>But it turns out no part of the build process depends on this: you can put >>all source files at the top level of your “src” subdirectory, and the >>project still builds just fine. > > Yup. You'll hate yourself when you try to manage a nontrivial project > that's set up wrong, but it's allowed by almost all java tools. I have no plans to use Java for anything other than Android development.