9 ms·
Alright, let me say that I do not like this part of path. Operator overloading is fine, I mean the + is overloaded all to hell. But seeing the division symbol i
by mattdeboard 14y ago
Alright, let me say that I do not like this part of path. Operator overloading is fine, I mean the + is overloaded all to hell. But seeing the division symbol in weird places in a project I took over was distracting first, then irritating, and by the time I figured out what was going on I did not want it despite seeing some benefit.
- draegtun 14y agoI agree. It reminds me of FancyRoutes which I also found off putting - http://news.ycombinator.com/item?id=1100248 http://news.ycombinator.com/item?id=1100248 Path.py may already do it (docs are limited so I'm not sure) but something like below would be better: my $foo = dir('a', 'b', 'c'); This is how Path::Class works in Perl (https://metacpan.org/module/Path::Class https://metacpan.org/module/Path::Class). This way the path is a filesystem agnostic directory object. NB. Twisting operator overloading isn't all bad though. For eg. IO:All nearly gets it all right and being a little mad I will sometimes use it :) https://metacpan.org/module/IO::All https://metacpan.org/module/IO::All