in reply to (tye)Re2: Converting Seconds to Nice Format
in thread Converting Seconds to Nice Format

Whoops! Didn't mean to sound confrontational. Mostly I was looking through and saw a place I thought
%
would be better used -- and I will admit I'm fuzzy on the actual under-the-hood implementation of this in Perl. I had it pegged as at least as fast as the multiplication and subtraction but it might be slower -- I just don't know. It fits my eye, end of story.

Regarding the 60*60*24*365 issue, I still think it's best to just explicitly code 60, 3600, etc (and perhaps include the product notation as a comment).

I will add that your example is creative and exploits the power of Perl, but at the same time some of the others are more transparent to casual perusers of the code. For enthusiasts I like yours, but if you're sharing with other maintainers a more "obvious" might be appropriate.

  • Comment on RE: (tye)Re2: Converting Seconds to Nice Format

Replies are listed 'Best First'.
(tye)Re3: Converting Seconds to Nice Format
by tye (Sage) on Nov 14, 2000 at 20:22 UTC

    I was torn on whether to just /msg this but decided there is a small chance that others might be interested.

    Whoops! Didn't mean to sound confrontational.

    Yeah. Ditto. For the record, I couldn't decide if you were feeling confrontational or not, but it crossed my mind.

    Yes, if I was writing this anywhere else, I probably would have used zero maps instead of two and one ?: instead of four. But I definitely would still not have repeated the seconds/minute (etc.) constants more than once. (:

            - tye (but my friends call me "Tye")