[tpm] February meeting -- correct date is February 29, 2024

Alex Beamish talexb at gmail.com
Tue Jan 30 07:28:15 PST 2024


Hi All,

I have updated the date of our February meeting on meetup.com and sent out
the announcement. It appears that the system still doesn't quite get the
'last Thursday in the month' setting. Perhaps it's challenging because
we're meeting on the leap day.

And I'm reminded of the algorithm in K&R that showed how you could chain
together multiple tests to get a result ..

  leap = year%4 && year%100 != 0 && year%400 == 0;  /* [1] */

The text around this code doesn't even stop to explain this algorithm --
they just assume that everyone knows the leap year rule. The tests are also
ordered from most likely to least likely, since the compiler will
short-circuit the result at the first failure.

Very terse, very elegant. Also, a great interview question.

I have to admit, writing code with variables that don't have sigils is a
little alarming .. but this is from a book that I bought when I could still
part my hair.

Cheers,

Alex

1. Page 104, The C Programming Language, Kernighan & Ritchie, 1978.

-- 
Alex Beamish

Software Developer / https://ca.linkedin.com/in/alex-beamish-5111ba3
Speaker Wrangler / Toronto Perlmongers / http://to.pm.org/
Chair, The Perl and Raku Conference 2023 / Toronto, Ontario / http://tprc.to
Baritone / Toronto Northern Lights, 2013 Champions /
www.northernlightschorus.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20240130/995050ae/attachment.html>


More information about the toronto-pm mailing list