FileDirectory was updated in 2009, but since Pharo had already forked
off Squeak prior to that you didn't know that FileDirectory was
already a lot like FileSystem is today before anyone knew FileSystem
even existed.  Today these examples are almost identical.

> Example #1:
> file := FileDirectory directoryEntryFor: '/path/to/file'.
> FileDirectory extensionFor: file name.
>
> vs.
>
> file2 := '/path/to/file' asFileReference.
> file2 extension.

file := FileDirectory directoryEntryFor: '/path/to/file'.
file extension

> #2:
> (FileDirectory on: 'path') entryAt: 'nohup.out'.
> vs.
> 'path' asFileReference / 'filename'

(FileDirectory entryFor: 'path') / 'filename'.

I agree we should add String>>#asDirectoryEntry to avoid the keyword
message and parenthesis, so both examples would be just as nice as
FileSystem:

  'path' asDirectoryEntry / 'filename'.

I think we agree about what good design is, we just differ about which
path to take there, the more-compatible or the more-beautiful path.

Reply via email to