Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

RE (tilly) 3: On elegant coding...

by tilly (Archbishop)
on Oct 16, 2000 at 17:00 UTC ( #36892=note: print w/replies, xml ) Need Help??

in reply to RE: RE (tilly) 1: On elegant coding...
in thread Just thinking ...

I am not the greatest fan of state variables either. But the state variable always was initialized, information on what values were legal appeared fewer times within fewer lines of code than the original, and I was only resorting to it to remove something else that I disliked even more. And I note that it is an idea that you tossed around as well. :-)

To tell the truth, were this my problem with my stuff I would look at the logic and reconsider whether I need to be fancy and fork. Since my stuff likes to run in crons and long-running jobs, I would be able to say "no" and get drastic simplifications. Down to "until it is safe to read, become writer and be sure it is fixed, once safe to read then read".

But there is an obvious solution that doesn't involve state, and that is to make your loop into a real function, and then return out of the function rather than call a function that exits. Combine with runrig's organizational skills... :-)

As for the diner, yeah, that hits home. And you know it. So let me explain.

It has to do with my learning style. I found out many years and subjects ago that I learn best by going out and finding out everything that I can, trying to integrate that into a solid understanding, and then articulating my understanding in the presence of people who know better than I do. If they correct, then analyze the corrections, integrate *that* into my understanding. Wash, rinse, and repeat until satisfied.

Which boils down to one thing. I am a lot like that guy at the end of the counter except in one huge detail. I learn!

Besides which, I have been more places than you might think...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://36892]
[LanX]: jeez Singapore, Indonesia and the Philippines inherited 3 different kinds of plugs from their former colonial overlords

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2017-02-19 12:56 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (292 votes). Check out past polls.