|XP is just a number|
Confession of a hard headed Monkby Lady_Aleena (Curate)
|on May 06, 2017 at 03:43 UTC||Need Help??|
Over the last few days, I've been doing a project that is forcing me take a new harder look at everything I've written: code and markup. One of the items which came up in my audit was a little subroutine which takes a number (usually scalar(@list)) and returns how many columns the list would be in according to exponential calculations. The default behavior of this subroutine is to return a word number not an integer. When I looked at it again, a voice in the back of my head told me the subroutine should return the integer by default because integers are more useful. I also had the sinking feeling someone here probably pointed that out to me, and I ignored it. I wanted what I wanted, and no one was going to make me change my mind at the time. I had to change my own mind and pay the price for it later.
So, this is my confession. I am a doofus. I am hard headed and obstinate when it comes to attaining my short term goals. I crawled into my shell to avoid any good advice about coding for the future.
So here is my old sub...
And the new more useful sub...
I feel bad for only now realizing returning a integer by default would be more useful than returning a number word. I think I spoke aloud when I called myself a doofus for returning a number word by default.
I've been doing a lot of rethinks lately. Some of my "utility" scripts seem useless in a broader sense.
The great advice I got from Monks long ago is finally settling into my head. I hope I am better with future advice, but that is to be seen.
No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!