Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: GetOpt::Long usage style

by Abigail-II (Bishop)
on Mar 08, 2003 at 23:11 UTC ( #241454=note: print w/ replies, xml ) Need Help??


in reply to GetOpt::Long usage style

Assuming that you actually use the variables you can set with a command line switch, if you rename one of those variables, you'd need to change the variable at least twice, even with style you are discussing.

I've used that style for years (but not always), but not for the reason you mention. Renaming a variable more than once requires only two keystrokes per extra occurrence in an editor like vi (n.), so that expect doesn't bother me at all. Of course, that's assuming :g/$oldvar/s//$newvar/g wouldn't do the trick, in which case there wouldn't be any extra keystrokes.

Abigail


Comment on Re: GetOpt::Long usage style
Re: Re: GetOpt::Long usage style
by demerphq (Chancellor) on Mar 09, 2003 at 10:18 UTC

    I suppose tis amatter of coding style, but often the process that occurs is like this: I know I need to handle options, x, y, z and that I want them have defaults. I write the Getoptions code, and then start working on the code that uses those options. If during that process I realize that the names i have chosen for the vars dont have the right names, I change them then and there, once finished the code that uses the vars, (and settling on the right names) I go back and adjust afterwards. Why not search and replace? Usually these vars are lexical for me, and usually I dont want to change every instance at once, yes I could hover on the search/replace button, changing the appropriate ones, but often I dont bother, its less effort to go to the one place in my code that I know is relevent and make he changes by hand, and quickly.

    Having said that your suggestions are welcome, but even more welcome would be an explanation of the motivations you had for using this style, and the motivations for not chosing it as well.

    Cheers,


    ---
    demerphq


Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://241454]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2014-07-22 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (119 votes), past polls