http://qs321.pair.com?node_id=571551


in reply to Re: what's a proper way to code method synonyms
in thread what's a proper way to code method synonyms

I'm developing a module CGI::PathRequest (seemed like the best name). It's an object that encapsulates various queries to a resource being accessible in a cgi environment. Usualyl a http accessible file.

You optionally initiate it by passing it a relative path.. And as you query it, it gives you info like relative path, absolute path, prettied up filename, is_text, is_dir, is_image, get an excerpt (if a text file) some other things that are really useful to me when I code CGI.

I want to give a coder using this module a lot of freedom. I want it to be intuitive.

How should someone query the instance for an absolute path? The more conservative way is: $object->get_absolute_path , but it could be more intuitive for someone to ask for $file->abs_path - so I have both. Someone should not *have* to read the documentation to use a module that serves such basic data. Is *one* way to pitch this.

It doesn't *need* to have that many synonims. I remember reading somewhere that a good application is liberal about what it accepts and conservative about what it outputs. I am trying to be liberal about what it accepts- about how you can ask it questions.

Yes, they can look at the documentation (which i wrote first).. But I want it to be intuitive. I almost would like to be able to ask $object->get_me_the_absolute_path and let the thing resolve by itself what the heck i want ( i know there's a module for that.. was it Sam Treggar?).