Bob Alexander <balexander / rsv.ricoh.com> wrote in message news:<3C8EC7F5.A4B702C7 / rsv.ricoh.com>...

[ good point, but snip!]

> It is a nuisance to almost always have to explicitly skip them when
> scanning a directory:
> 
>     for entry in Dir.entries("myDir")
>         next if ["..", "."].include?(entry)
>         ...
>     end
> 
> Can someone suggest an argument as to why having them in the listed
> entries is useful?

This is really the core of the problem.  Adding a cost to every
directory listing b/c of 2 (rare?) special cases doesn't make sense to
me, and doesn't seem to fit into the way Ruby usually works.

I would like to add that just b/c the base filesystem does something
does not mean Ruby needs to follow.  Ruby gets a big win over java b/c
it doesn't really care whether you use "/" or "\" as file seperators
on Win32; Java forces you to figure out what the
system.ridiculously.wordy.path.seperator.variable is to build paths in
a cross platform manner.

Since we have a object that can have accessors like Dir.cwd (or
Dir.current) or Dir.parent, I don't see the need to cling to archaic
"special" files to get us around the filesystem.  Finally, I feel like
Ruby generally proves that making things simpler tends to find the
right abstractions.

I say try explaining the two methods of getting the parent directory
to your significant other, and pick the one s/he understood more
easily :-)

~ Patrick