Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re (tilly) 2: Frivolous function names

by demerphq (Chancellor)
on Dec 06, 2001 at 18:51 UTC ( #129919=note: print w/ replies, xml ) Need Help??


in reply to Re (tilly) 2: Frivolous function names
in thread Frivolous function names

I admit I didnt take a lot of time to write my code snippet as my point was to avoid naming problems and use a flag. The choice of name for the flag variable would be the authors call. Although on second thought I wouldnt use $will_create but probably $create_on_demand

Anyway, point well taken though, in future Ill put more thought into variable names in my snippets...

:-)

UPDATE
<bad_excuse>
On second thought there is a point here actually. You were talking about externally available names, whereas $flag while poorly named is internal and thus less of an issue. This isnt to say that $flag was a good name, it is not. But there is more room for error in internal use code than external use code, especially if said variables/code are properly scoped. </bad_excuse>

Yves / DeMerphq
--
This space for rent.


Comment on Re: Re (tilly) 2: Frivolous function names
Select or Download Code
Re (tilly) 4: Frivolous function names
by tilly (Archbishop) on Dec 07, 2001 at 00:50 UTC
    I call that a really bad excuse.

    Flipping flags in internal code is an incredibly easy and common error to make. There are some estimates suggesting that it is actually more common than off-by-one errors - but not as often caught because it is much harder to see the error. (According to legend I heard the very first Fortran compiler made this error - the flag determining whether to compile carefully or not was reversed. No idea whether that is true.)

    As far as I am concerned the entire question of whether summon/get is OK is much less important than getting flags reversed. As matters stand, I don't think people would accidentally call summon, and most of the time get is right. But flipping flags is a basic error that you will make again and again...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2015-07-02 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (29 votes), past polls