« Return to Thread: 2.8.0 Upgrades

Re: 2.8.0 Upgrades

by Rafael de F. Ferreira-3 :: Rate this Message:

Reply to Author | View in Thread

--
Rafael de F. Ferreira.
http://www.rafaelferreira.net/



On Sat, Jun 27, 2009 at 7:39 PM, Stepan Koltsov<yozh@...> wrote:

> On Sun, Jun 28, 2009 at 00:28, Erik Engbrecht<erik.engbrecht@...> wrote:
>> I think the trait File should be split apart so that files and directories
>> have separate traits as follows because there are operations you can perform
>> on files that you can't perform on directories and vice-versa.
>> trait Path {
>>   // methods common to both Files and Directories
>> }
>> trait Directory extends Path {
>>   // directory specific methods
>> }
>> trait File extends Path {
>>   // file specific methods
>> }
>> I'll post some updates later on tonight.
>
> It is wrong, because of two reasons: performance and useability.
>
> Perfornane: When you listing directory, you only get file names. To
> get file type you have to call isDirectory for each file in that
> directory. It could be slow.
>
> Useability. Some people prefer calling isDirectory than doing pattern matching.
>
> S.
>
>

 « Return to Thread: 2.8.0 Upgrades