Death To Sub-Sub-Sub-Directories!

  • Thread starter Lawrence D'Oliveiro
  • Start date
Z

Zapotec

I am opening and closing lots of files all the time, so specifying those
filenames takes extra steps, that does indeed slow down everything I do.

And if you keep all those files open at once instead: tab explosion! Or
equivalent proliferation of windows/buffers/etc. to find the one you
want among.
 
M

Michael Wojcik

Zapotec said:
Completion again. People talk about it like it's a magic bullet, but
it's not, especially when there are a lot of possible completions, which
happens when there is a common prefix (like
src/java/com/mylongcompanyname/mylongprojectname/dal) to a lot of the
filenames.

Works fine for me. Is it possible that your experience is different
from mine? Nah. Surely you must be correct that I experience pain due
to long directory names.
Every little bit adds up, and time spent doing peripheral tasks is time
not spent coding, testing, or debugging.

You have not demonstrated that it adds up to anything significant.
I'll wager it doesn't. Certainly it's far less than the time I've
spent over the last two decades writing Usenet posts.
And what "proper APIs" might those be, that for instance Microsoft's own
cmd.exe and Explorer evidently don't use?

RTFM. They're the Unicode versions of the File APIs.

http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx

Gosh, that was hard to find. First hit for "path length" on MSDN.

cmd.exe doesn't support them properly (it does for some builtins, but
it has its own path length limitations that are separate from the OS
ones), because Microsoft frankly doesn't give a damn about cmd.exe.
(If you're going to use one of their shells, they'd like it to be
Powershell.) But that's rather beside the point, which is that the
short path length limitation was corrected in Windows long ago - I
think with NT 4.0.
I might add that Java doesn't use these phantom APIs either, as
evidenced if you try to use java.io.File/FileInputStream to read a file
that exceeds a much shorter length.

Did you specify it correctly, using a UNC name? I thought not.
(Make a directory with a one-letter
name in a drive root and a file with a name about 150 characters long in
it. Then rename the directory to a similarly long name and try to access
it with java.io ... boom! FileNotFoundException.)

-----
C:\tmp>dir
c:\tmp\longdir1234567890123456789012345678901234567890123456789012345
67890123456789012345678901234567890123456789012345678901234567890123456789012345
678901234567890\averylongfilename12345678901234567890123456789012345678901234567
89012345678901234567890123456789012345678901234567890123456789012345678901234567
8901234567890123456789012345678901234567890
The filename or extension is too long.

C:\tmp>java -cp . test
\\?\c:\tmp\longdir123456789012345678901234567890123456789
01234567890123456789012345678901234567890123456789012345678901234567890123456789
0123456789012345678901234567890\averylongfilename1234567890123456789012345678901
23456789012345678901234567890123456789012345678901234567890123456789012345678901
23456789012345678901234567890123456789012345678901234567890
foo
-----

Works just fine for me.

Here's the source:

-----
import java.io.*;

class test {
public static void main(String[] args) throws java.io.IOException {
File file = new File(args[0]);
FileInputStream fs = new FileInputStream(file);
int ch;
while ((ch = fs.read()) != -1) {
System.out.print((char)ch);
}
fs.close();
}
}
-----
Not with Java's long/and/deeply/nested/package/hierarchies...

I've never had that problem.
Junctions are those funny-behaving versions of My Documents and such
that are in Vista and Windows 7, right?

Junctions are a facility of NTFS, built on top of reparse points. If
you're going to complain about Windows, maybe you should learn how it
works first.
The last time I checked, the
user can't create those,

Check again.
at least not with the default set of tools
available by e.g. right-click-and-drag in Explorer.

Whereas in Unix and Linux installations, all possible actions are
available in the various GUI file managers?
If Microsoft had been intelligent, competent, and capable of even decent
copycatting, let alone true creativity, outside of the
inventing-new-anticompetitive-dirty-tricks department,

And now the ad hominem. Let's all watch as Zapotec loses the ability
to formulate an actual argument.
Vista would have
included real proper symlinks,

It does:

-----
C:\tmp>mklink /?
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

/D Creates a directory symbolic link. Default is a file
symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction.
Link specifies the new symbolic link name.
Target specifies the path (relative or absolute) that the new
link
refers to.
-----

NTFS also supports hard links and junctions.
which you can click through in Explorer

As indeed you can.
without getting error messages, and which would have been available on
the right click menu: right click, drag, "Make symlink here". :p

I agree that being able to make links and junctions from Explorer
would be useful for lazy whiners who can't be bothered to learn how
their OS works.
 
M

Michael Wojcik

Lawrence said:
There’s a fundamental problem, in that all these special features like
“junctions†and so on are intimately tied up with NTFS. There is no virtual
filesystem layer, like on Linux and other sanely-designed *nix systems—
everything is tied into that one specific filesystem.

Bullshit. Windows has a virtual filesystem layer (the volume manager).
Any alternative filesystems for Windows could support reparse points.
 
M

Michael Wojcik

Lawrence said:
No, instead you just go tab-tab-tab, once for each directory level.

Bash and Emacs do the exact same thing.

No shit, Sherlock.
It’s still a pain, with all these
levels of directories that contain nothing but another subdirectory.

It's not a pain. See? We can do this all day.
I am opening and closing lots of files all the time, so specifying those
filenames takes extra steps, that does indeed slow down everything I do.

Perhaps it is your work habits, or your typing speed, that is the
problem, and not the length of your filenames.
 
Z

Zapotec

Works fine for me. Is it possible that your experience is different
from mine? Nah.

Same technical thing, no PRNG involved? Nah indeed.
You have not demonstrated that it adds up to anything significant.

I think that should be fairly obvious. If it takes you two extra seconds
to select a file, you select ten files every hour, and you work
forty-hour work-weeks, then in one year you spend an extra 52*40*10*2 =
41600 seconds. That's almost half a DAY of cumulative time -- more than
one day's work shift. Basically, without that extra two seconds per file
selection you could be equally productive and yet get one more vacation
day a year.

If you chronically have overtime to meet deadlines, as programmers
normally do, make that two vacation days.
I'll wager it doesn't. Certainly it's far less than the time I've
spent over the last two decades writing Usenet posts.

Perhaps you should consider writing fewer Usenet posts, then.

How rude. And why in hell would I have a set of Microsoft API manuals
around anyway?
They're the Unicode versions of the File APIs.

And these aren't what the native tools, like Explorer, use, even though
those tools seem to support localization, to judge by the proliferation
of Windows versions in other languages?
cmd.exe doesn't support them properly (it does for some builtins, but
it has its own path length limitations that are separate from the OS
ones)

Even wackier.
because Microsoft frankly doesn't give a damn about cmd.exe.

Even wackier still. It's no wonder they're doing so poorly in the server
space, with that attitude.
But that's rather beside the point, which is that the
short path length limitation was corrected in Windows long ago - I
think with NT 4.0.

Not so a user working with the built-in tools such as Explorer and
cmd.exe would notice.
Did you specify it correctly?

new File("C:\\path\\to\\file.ext"); -- how else? Unless you're now going
to tell me there's some other Java File API, perhaps buried several
packages deep under java.nio?

And of course like any Java string that path is made of Unicode
characters by the time the File class sees it. It would be strange if
File wasn't then punting to the Unicode versions of the Windows file
APIs under the hood.
C:\tmp>java -cp . test
\\?\c:\tmp\longdir123456789012345678901234567890123456789

What the **** is that? Certainly not a pathname in normal Windows syntax
(that would be C:\tmp\longdir...). Isn't that some syntax used for
referencing network volumes or something?

Anyway, that's a lot of ridiculous hoop jumping and it's moot anyway
since Java doesn't use those funny paths. For instance, try creating
C:\Z\150-character-dirname\150-character-filename in the manner I
described and then

new FileInputStream((new
File("C:\Z\150-character-dirname")).listFiles()[0]);

and see how far you get. You can't use Java's own filesystem APIs to get
handles on such files in a manner that will work. So unless the user
hand-enters every such path into the application ...

And of course the user *doesn't* enter every such path into javac,
bringing us back to the trouble you'll get if your package hierarchy
results in long enough path names and anyone tries to build the app on
Windows.
I've never had that problem.

Lucky you.
Junctions are a facility of NTFS, built on top of reparse points.
So?

If you're going to complain about Windows, maybe you should learn how it
works first.

Who says I didn't?
Whereas in Unix and Linux installations, all possible actions are
available in the various GUI file managers?

All actions of a basic nature such as "make symlink here" are, I'd
expect, in a typical GUI file manager, or what good is it?
And now the ad hominem.

Actually, it was a conclusion drawn from available evidence. It would
have been an ad hominem if I'd said "Microsoft plays anticompetitive
dirty tricks, therefore you can't trust their stuff to work", but I
didn't; I said "You can't trust their stuff to work and most of it is
shoddily copied from competitors, therefore their creativity must be
being spent on anticompetitive dirty tricks instead of on software
development" instead.
Let's all watch as Zapotec loses the ability
to formulate an actual argument.

Sorry, but that show was canceled due to Zapotec doing something
different instead.

Not anywhere a normal user would find it, such as the right-drag menu in
Explorer.
As indeed you can.

Not junctions; Explorer dings and says something silly along the lines
of you need permission to do that -- silly because it says it even if
you're logged in as root.
I agree that being able to make links and junctions from Explorer
would be useful for lazy whiners who can't be bothered to learn how
their OS works.

It would also be useful for the general populace of users who prefer to
use preview-providing browsing tools like Explorer instead of typing
everything out longhand at the shell, particularly given how poor a job
the cmd.exe shell does at being a shell.
 
P

Pitch

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.


I hate subdirrs as well. All my java-projects often have only one package
inside. I like the way .NET classes are configured.
 
L

Lew

Pitch said:
I hate subdirrs as well. All my java-projects [sic] often have only one package
inside. I like the way .NET classes are configured.

Stupid attitude. They're only subdirectories! And fucking up your Java
package structure because of a coincidental correlation to subdirectories is
monumental folly. Get out of programming now!
 
D

Daniele Futtorovic

Pitch said:
I hate subdirrs as well. All my java-projects [sic] often have only
one package
inside. I like the way .NET classes are configured.

Stupid attitude. They're only subdirectories! And fucking up your Java
package structure because of a coincidental correlation to
subdirectories is monumental folly. Get out of programming now!

Amen.
 
S

Snorkmeier

... [utter bullshit] ...

Plonk. Zappie.

Bravo! Excellent debating skills you put on display there, Lew! Why
bother with a detailed counterargument against whatever specific things
in Zapotec's fairly long post you don't happen to agree with when you can
just snip the whole thing and simply call it "bullshit" instead?

And the whole sticking your fingers in your ears thing is just the icing
on the cake. That oughta show him! He'll never *dare* to say anything
*you* disagree with again! -- or at least you will be able to pretend he
didn't!

Well, unless someone inconveniently quotes one of his posts and, in
particular, some bit you happen not to agree with. But then, that's easy
enough to solve isn't it -- just killfile everyone else in the newsgroup
too! Why, it's positively brilliant!
 
P

Pitch

I hate subdirrs as well. All my java-projects [sic] often have only one package
inside. I like the way .NET classes are configured.

Stupid attitude. They're only subdirectories! And fucking up your Java
package structure because of a coincidental correlation to subdirectories is
monumental folly. Get out of programming now!

I think you didn't understand what I was saying which is somewhat expected from
someone who publicly calls other people stupid.
 
L

Lew

... [utter bullshit] ...

Plonk. Zappie.

Bravo! Excellent debating skills you put on display there, Lew! Why
bother with a detailed counterargument against whatever specific things
in Zapotec's fairly long post you don't happen to agree with when you can
just snip the whole thing and simply call it "bullshit" instead?

And the whole sticking your fingers in your ears thing is just the icing
on the cake. That oughta show him! He'll never *dare* to say anything
*you* disagree with again! -- or at least you will be able to pretend he
didn't!

Well, unless someone inconveniently quotes one of his posts and, in
particular, some bit you happen not to agree with. But then, that's easy
enough to solve isn't it -- just killfile everyone else in the newsgroup
too! Why, it's positively brilliant!

Plonk.
 
L

Lew

I hate subdirrs as well. All my java-projects [sic] often have only one package
inside. I like the way .NET classes are configured.

Stupid attitude. They're only subdirectories! And fucking up your Java
package structure because of a coincidental correlation to subdirectories is
monumental folly. Get out of programming now!

I think you didn't understand what I was saying which is somewhat expected from
someone who publicly calls other people stupid.

I am certain that you didn't understand what I was saying, which is that
putting everything in a significant Java program into a single package is a
stupid choice. Packages exist for a reason. They provide organization,
modularity and encapsulation. Putting everything in a single package is only
marginally better than using just the default package. It's a bad idea. A
very, very bad idea. The attitude that it's a good idea is a stupid attitude.

I publicly call ideas stupid, or actions stupid. Did I call you stupid? No.
So untwist your knickers, bub.

You probably should leave programming, too.
 
S

Snorkmeier

On 05/10/2011 11:47 PM, Zapotec wrote:
... [utter bullshit] ...

Plonk. Zappie.

Bravo! Excellent debating skills you put on display there, Lew! Why
bother with a detailed counterargument against whatever specific things
in Zapotec's fairly long post you don't happen to agree with when you
can just snip the whole thing and simply call it "bullshit" instead?

And the whole sticking your fingers in your ears thing is just the
icing on the cake. That oughta show him! He'll never *dare* to say
anything *you* disagree with again! -- or at least you will be able to
pretend he didn't!

Well, unless someone inconveniently quotes one of his posts and, in
particular, some bit you happen not to agree with. But then, that's
easy enough to solve isn't it -- just killfile everyone else in the
newsgroup too! Why, it's positively brilliant!

Plonk.

Good, good ... keep going. You're well on your way now, I think. :)
 
P

Pitch

Pitch wrote:
I hate subdirrs as well. All my java-projects [sic] often have only one package
inside. I like the way .NET classes are configured.

Stupid attitude. They're only subdirectories! And fucking up your Java
package structure because of a coincidental correlation to subdirectories is
monumental folly. Get out of programming now!

I think you didn't understand what I was saying which is somewhat expected from
someone who publicly calls other people stupid.

I am certain that you didn't understand what I was saying, which is that
putting everything in a significant Java program into a single package is a
stupid choice.

Java program != Java project

I said "project" and I ment that my Java program can contain several java
projects. It's called modularity and encapsulation. ;)
Packages exist for a reason. They provide organization,
modularity and encapsulation. Putting everything in a single package is only
marginally better than using just the default package.

I never said everything should be in a single package. You should read more
carefully. I said my projects (which are modules) often (not always) have only
one package, like "com.mycompany.myproduct.mymodule".

But all those files do not really need to reside in the path
/src/com/mycompany/myproduct/mymodule

They can all be in the "src" directory and still keep the original package.

You probably should leave programming, too.

Now, that would be stupid since I'm a very good programmer. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top