Giter Site home page Giter Site logo

Should mkpath be renamed? about path-tiny HOT 5 CLOSED

dagolden avatar dagolden commented on August 28, 2024
Should mkpath be renamed?

from path-tiny.

Comments (5)

preaction avatar preaction commented on August 28, 2024

My opinion would be "yes", since I just got bit by this migrating from File::Path (using make_path) to Path::Tiny.

from path-tiny.

ggl avatar ggl commented on August 28, 2024

Either rename mkpath or rename remove_tree to rmtree. I like mktree | rmtree better because it's more concise, but it requires renaming both methods. Also you should not worry too much about mapping Path::Tiny method names to File::Path function names, because they are called differently anyway.

from path-tiny.

xsawyerx avatar xsawyerx commented on August 28, 2024

I like make_path. You can keep mkpath for compatibility (either with older versions of Path::Tiny or with File::Spec), and possibly remove later.

from path-tiny.

ap avatar ap commented on August 28, 2024

Possibly, it should be "make_tree" for proper parallelism.

They are not parallels though: remove_tree really does remove an entire tree, whereas it‘s odd to call foo/bar/baz/quux a “tree”. It’s just a single chain of subdirectories… basically, well, a path. So in that respect the names seem fine to me.


For me it’s the remove_tree name I don’t like: it seems needlessly verbose. I would favour renaming that one to rmtree (while leaving an alias in place essentially forever yada backcompat yada). I’ve rewritten some shell scripts in Perl with the aid of Path::Tiny before and the fact I had to spell out remove_tree over and over in densely FS-modifying code was irritating (to read, not just write).

Or possibly both synonyms for both of the methods should go in? I can see that spelling things out in less dense code looks nicer, and the code-wise cost of aliases is trivial. So the question is, do they increase the burden on the maintenance programmer later… on which I learn towards no.

from path-tiny.

xdg avatar xdg commented on August 28, 2024

mkpath was deprecated in 0.125

from path-tiny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.