Shelter-in-Place Journal, Day 342

One of our neighbors has a number of raised beds in their front yard. During the summer, they are mostly devoted to fruit and veggies, but during the winter, they grow flowers, like these – it’s worth making sure our walk goes past their house!

 

What else did I do today? I started writing code to generate an easier-to-read weather update to send to Pushover each morning, which is forcing me to learn about Pillow. I could go into more detail, but it’s not terribly interesting – perhaps it’ll be worth writing about when I’m finished.

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….