Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Death To Sub-Sub-Sub-Directories!

Reply
Thread Tools

Death To Sub-Sub-Sub-Directories!

 
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      05-05-2011
Google’s tool for creating an Android project insists on creating a
subdirectory hierarchy corresponding to the package naming hierarchy. Thus,
if you name your class “com.example.test_project.Main”, it will put
Main.java inside the subdirectory src/com/example/test_project/.

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.
 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      05-05-2011
On 5/4/2011 7:31 PM, Lawrence D'Oliveiro wrote:
> 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.



Builds? Or runs? The directory structure you excoriated is standard in
the Java world. Why not use it? (Seriously, why not? If the tool
builds things there automatically, what is the advantage of not being
compatible with the rest of the planet and doing things differently?)

 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      05-05-2011
Lawrence D'Oliveiro wrote:
> Google’s tool for creating an Android project insists on creating a
> subdirectory hierarchy corresponding to the package naming hierarchy. Thus,
> if you name your class “com.example.test_project.Main”, it will put
> Main.java inside the subdirectory src/com/example/test_project/.
>
> 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.


This is simply the normal behavior for file-system-based Java installations,
such as those on Windows, Linux, Solaris, and Mac. No surprise, since Android
is built on a Linux core (well, GNU OS, I suppose I should say).

While it is not true that anything or anyone "insists" on using a reasonable
package structure, or to utterly eschew the default package, it's awfully
foolish to build anything other than toy examples in the default package.
That's why the very strong bias is to the best practice of non-default
packages for all types. You should follow that practice.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg
 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      05-05-2011
In message <ipt2dd$bp2$>, wrote:

> On 5/4/2011 7:31 PM, Lawrence D'Oliveiro wrote:
>
>> 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.

>
> Builds? Or runs?


Builds and runs. I have at least 4 Android projects structured this way now.

> The directory structure you excoriated is standard in the Java world. Why
> not use it?


Because it’s a pain in the bum,

> (Seriously, why not? If the tool builds things there automatically


No tool “builds things there automatically”.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      05-05-2011
On Thu, 5 May 2011 02:31:23 +0000 (UTC), Lawrence D'Oliveiro
<_zealand> wrote, quoted or indirectly quoted
someone who said :

>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.


It will matter if you run without jarring. That structure lets
java.exe find the class files without searching.

See http://mindprod.com/jgloss/classpath.html
--
Roedy Green Canadian Mind Products
http://mindprod.com
Politicians complain that Kindles and iBooks are killing jobs by
destroying the paper book industry. I see it that they have create a way
to produce books for less than a third the cost without destroying forests
and emitting greenhouse gases in the process. They have created wealth.
They are encouraging literacy and cutting the costs of education.


 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      05-05-2011
In message <>, Roedy Green wrote:

> On Thu, 5 May 2011 02:31:23 +0000 (UTC), Lawrence D'Oliveiro
> <_zealand> wrote, quoted or indirectly quoted
> someone who said :
>
>>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.

>
> It will matter if you run without jarring.


It builds classes.dex just fine.

> That structure lets java.exe find the class files without searching.


java.exe? What’s that?
 
Reply With Quote
 
Esmond Pitt
Guest
Posts: n/a
 
      05-05-2011
On 5/05/2011 12:47 PM, Lawrence D'Oliveiro wrote:
> Because it’s a pain in the bum


Is that supposed to be a reason? Because it isn't.

If you do as you suggest you lose automatic recompilation of dependent
classes.
 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      05-05-2011
In message <4dc23d41$0$99951$>, Esmond Pitt
wrote:

> On 5/05/2011 12:47 PM, Lawrence D'Oliveiro wrote:
>
>> Because it’s a pain in the bum

>
> Is that supposed to be a reason? Because it isn't.


Want some examples?

> If you do as you suggest you lose automatic recompilation of dependent
> classes.


No I don’t.
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      05-05-2011
Lawrence D'Oliveiro wrote:
> Esmond Pitt wrote:
>> Lawrence D'Oliveiro wrote:
>>> Because it’s a pain in the bum


No, it isn't, not for disciplined non-ignoramuses, or for people who can give
engineering reasons for their pronouncements.

>> Is that supposed to be a reason? Because it isn't.


> Want some examples?


If you have to ask ...

You /DO/ realize that "it's a pain in the bum" is neither logic nor evidence,
don't you?

Don't you?

>> If you do as you suggest you lose automatic recompilation of dependent
>> classes.


> No I don’t.


Care to apply some reason, evidence and/or logic there, sport?

--
Lew
I'm guessing the answer is "no".
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      05-05-2011
Lawrence D'Oliveiro wrote:
> java.exe? What’s that?


If you don't know, then you are definitely participating in the wrong group.
This is a newsgroup for Java programmers, buddy.

Regardless, here's your answer:
http://lmgtfy.com/?q=what+is+java.exe

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Death, even when expected, is hard for anyone to deal with, but asuicidal death asim malik Perl Misc 1 09-13-2009 07:42 AM
Re: Crocodile Hunter - DEATH VIDEO - Steve Irwin - crocodile hunter - death video - steve irwin.exe (1/1) Mikey DVD Video 3 09-14-2006 05:52 PM
OT: how to beat death and taxes [short form] /* Microcephalic \Simpson\ Bob */ MCSE 1 09-28-2005 01:07 PM
VoIP ebay & skype = DEATH (Offtopic ? Maybe) codefixer@gmail.com Cisco 0 09-08-2005 09:27 PM
[OT] [Media] The Imminent Death of Critical Thinking Brian MCSE 4 04-20-2004 08:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57