Diary 2019-04-11

By Max Woerner Chase

Exercism status update: probably fast but definitely confusing state machine has been replaced with a few strategic calls to library functions. I believe the resulting code is more correct for input not covered by the test cases, insofar as it now accepts all whitespace and all text that differentiates glyphs by case. It might do something weird if you pass it German, or Turkish. In other words, it's code that cares about case.

The key thing that I needed to grasp to kick off the refactor was, I managed to represent a binary output with three-value business logic that was modeled by two booleans. So I just kind of... converted four to three, then three to two. This simplified the core logic enough that I was able to separate out the different conditions to test, and, as I said, to replace them with library functions, thereby making the code, like, probably less than half as long.

That was a nice exercise in refactoring. Might or might not be all the way done, but it should be much easier to make any further updates.

On a Python packaging note, I installed Poetry and configured it with my PyPI account. This was super easy, very straightforward installation and configuration, great job. I'm interested in Poetry because it's one of several tools that aim to, among other things, replace setup.py when it comes to Python package development, but it's the only one I've found so far that supports the src layout.

I'll get back into that tomorrow. For now, good night.