Shelter-in-Place Journal, Day 341

The biggest excitement today was cleaning up some of the code I’m passing along for Toastmasters. I have to wonder what, if anything, I was thinking in one place – the original code looked like this:

foo = ”˜  this  that the   other thing’.split() 

The string was actually about 18 words long, with lots of extra spaces. It extended way past the right side of the screen, so the .split() was invisible. And I couldn’t figure out how foo became an array instead of a string for a couple of minutes until I realized what I’d done: written code that was not only inefficient but also hard to understand (I’m sure I cut-and-pasted the string in from somewhere – at least I hope I did).

I got the value of foo and put it into the statement, like so:

foo = [”˜this’, ”˜that’, ”˜the’, ”˜other’, ”˜thing’] 

I had to break it into three lines to make sure each piece was visible, but that was easy enough – and now the code is obvious and faster.

Sometimes I wonder….

Shelter-in-Place Journal, Day 340

We took a photo walk today so I could try playing with my camera in preparation for Africa; naturally, all I photographed was flowers. But I liked the results, so here you are.

Tulip
Aloe comptonii (probably)

Beyond that, it was a busy day, mostly taken up with two meetings about Toastmasters (one to help with District alignment, one to prepare for a club contest on Monday). I have a bit of programming to do in the near future as part of my turnover process.

And I did my part to help Santa Clara County’s statistics – I took a COVID-19 test yesterday and it came back negative. The test was painless and easy; figuring out the traffic pattern in the parking garage was the biggest hassle!