I'm really enjoying the advent of compiler optimization from @mattgodbolt, but Day 11 ("Counting Bits") has been my favorite so far, just for the trick I'd never heard of:

// Clear the least-significant set bit
value &= value - 1

With 30 seconds of thought and a little scribbling, it's obvious why it works. But… wow. Yeah; it really is that easy. Sometimes I think I know a lot of things, and sometimes I discover how many things I was this old when I learned.

youtube.com/watch?v=Hu0vu1tpZnc

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/cocoaphony/statuses/115721228932850978 on your instance and quote it. (Note that quoting is not supported in Mastodon.)