Coding 2020-03-11

By Max Woerner Chase

I let things go late today, so I'm going to have to wrap things up quickly. For the latest attempt at conlang software, I think I mentioned that I'd like to try using an existing conlang as test data. For now, I just grabbed Verdurian. We'll see how that goes when I actually work on it instead of playing Snakebird.

I've also been thinking about coding standards and exercises, like Object Calisthenics, and the fact that I'm still kind of iffy on the wemake-python-styleguide. One thing that I keep on mentally nitpicking is the justification for wrapping lines at 80 characters. Now, to be clear, I don't mind that kind of length limit, though I would like it if I could remember that docstrings are supposed to wrap at 72 instead, I think. I mean, I think the wrapping that makes sense for code samples on this blog, when (when) I remember to do it, is like 40 characters. I don't mind the limit. What I take issue with is the idea that "The first and the most obvious complexity metric for a line is its length." (Complexity Waterfall) Complex lines have internal structure that allows for easy splitting onto multiple lines. In trying to use (more or less) WPS, I pretty consistently got that the lines of problematic length were extremely simple, but involved long names or literals.

Also, I still think it's rich to criticize black for violating PEP 8 from the same project that mandates always having an encoding comment. (black criticism, encoding comment violation, PEP 8 on encoding comments) (Or, I guess they're getting rid of that in the next version? Or something?)

Also, WPS451 is getting disabled the instant I have to deal with it. It's not impossible to replicate def method(self, an_arg, /, **kwargs) without using positional-only syntax, but it is highly unpleasant, and worse code. Code is better when the surface appearance reflects the intent, and "using the syntax" reflects the intent far better than "weird decorator where you have to define the kwargs dictionary as a positional argument".

Anyway, before I mess around with rewriting the auto-roller any more, actual tests, right, yes. But that's not happening now, because it's already way too late.

Good night.