Performance testing — like sailboat racing — depends on the conditions along the racecourse

sail boats floating on water with shades of orange and yellow light shining on them
sail boats floating on water with shades of orange and yellow light shining on them

I used to live on a boat. A question that comes up is “How fast does it go?” It’s a pleasant enough question with a tricky, evasive-sounding answer. It’s a sailboat, meaning the speed varies — to an extent — with the wind. It also varies with the sails being used, weather and sea state, and the relative angle between boat and wind. So answering “it depends” always felt awkward.

It’s not that I wanted to be evasive, but measuring performance is nuanced. There’s no simple “it goes this fast” for boats. Nor is there one when writing software in…


Four over-engineered examples of how type hints can improve your code

blue and white sea foam
blue and white sea foam

Type hint analysis, like unit tests, and static code analysis, all serve to give people an appropriate level of confidence that the code works as expected. They can be a helpful part of a Python program and are one of many tools we use to establish the overall quality of our code.

In this post I want to explore different ways type annotations can help write better software. In order to do this, I’m going to need a problem to solve. You can probably guess from the title what I’m going to tackle: the fizz-buzz problem. Several times. Four times…


After Python 2.7 Sunsets, Will Your App Be Cast Adrift?

sailboat floating on a lake
sailboat floating on a lake

I Used to Live on a Sailboat. ⛵️

Sounds Romantic, Right? 💌

Sunsets. 🌄

Tropical Islands.🏝

Life on a boat also includes dealing with a litany of things which are actively wearing out. The ocean is beautiful. The gentle rocking at anchor is pleasant. But it’s also cyclic loading on components that will — eventually — fatigue. Some good features of life at sea also have monsters lurking just below the surface. Going to sea means you enter the food chain, and you’re not the apex predator. …


Performing in the Key of Python

Once upon a time, I played bass in a bar-band. We had some medley transitions between songs that — to us — were signature rock ’n’ roll. For me, however, the medleys were gut-wrenching. Some nights there would be a tiny moment when I was thundering along with one beat, and I suddenly began to wonder where I was in the song and what was going to happen next. Was this the intro to Gloria? Or was this the outro?

To make it a little worse for me, whenever we rearranged the set lists during the first gig I would…


There are some things we cannot compute. Or perhaps I should say we should not try to compute them using an algorithm based on simple brute force and ignorance. Let’s take a quick trip through the galaxy of of algorithms and complexity. Along the way, we’ll pick up some tips on making our software run faster.

My vague understanding of the Big Bang includes a (possibly incorrect) idea that it expands and gets colder. The fact that sticks in my head is that the Andromeda galaxy will collide with our galaxy in about five billion years, 5E+9. On average, there…


Confession #1:

I like dill pickle sandwiches. Yes. Dill pickles. On rye bread. My daughter enjoys them but my son-in-law? He’s not tickled by pickles. “That’s so wrong. A pickle is a side dish. Or a garnish. Something you put on hamburgers. But not a sandwich filling.”

Confession #2:

I wrote Functional Python Programming — Second Edition, available from Packt Publishing. I wrote most of the code examples to include type hints, so I have an idea or two about the appropriate use of hints, and how to use the mypy tool.

These confessions are related — In Python 3, type hints are kind…


A Relay Play based on Swagger and OAS

The phrase “Spec to Gherkin to Code” almost sounds like sportscaster calling out a baseball double-play from shortstop to second baseman to first baseman. The ideal of well-synchronized teamwork is how we move from an API description written to the OpenAPI specification (OAS, formerly Swagger) to a Gherkin-based acceptance test to actual working code. What’s interesting to me is the details of the hand-off and how information is preserved in each stage of the process.

This seems to parallel the essence of building a team by balancing strengths and weaknesses. The rules for a sport lead to a need built…


Can we talk about that old hoodie you’re wearing? Yes, it’s got an obscure logo with a complex, personally significant story. Yes, it keeps the sun off your head. Holding the pockets together with duct tape doesn’t really seem to be optimal though. And there’s that hole in the elbow. And what’s that stain. If you were to wash it, would anything be left…

Let’s admit it, an application that looks like a free hoodie from a defunct web site doesn’t create a lot of confidence. How the application looks is important, just like with clothes. So lots of software…


Artisanal donuts > artisanal data

If I offered you an artisanal donut, it would probably earn an emphatic, “Yes, please!” But what would your response be to my offer of artisanal data? Irregular, unique data isn’t very appealing so I’m guessing you’d be less enthused. What is artisanal data? Imagine the data from each business transaction being written up as color commentary from a sporting event, “Today an older couple bought a box of our finest…” and then being asked to categorize, sort, and interpret this. This is what artisanal data looks like - and it’s not terribly useful. …


A “Python to the Rescue” Story That Never Gets Old

That Feeling when your application is so big — and so important — that you just know there’s going to be a dramatic expansion in the storage needs sometime soon. “The ‘Cyclopean’ analysis tool is about to be walloped by another line of business, an acquisition, and a spirited level of organic growth all at the same time. Oh, and the doubling time was just cut in half.” Looks like someone needs to build the new database server farm.

Viewed from a distance, the idea of provisioning a NoSQL database server farm in a situation like this seems pretty simple…

Steven F. Lott

Programmer. Writer. Whitby 42 Sailor.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store