I major concern I have these days is, while I author code in languages I cannot manually code, are they any good?
Over years, I have worked with a number of languages: C, C , Fortran, MATLAB, JavaScript
But Python was my go-to language since more than 10 years. Well that changed last summer
So while I have strong opinions on how Python code, should be, conventions and all, I don't have so strong opinions on other languages. That means I am producing slop by default in Rust, Go and TypeScript
To solve that problem, I created
github.com/dutifuldev/slopha…
Its aim is to be "the only tool and resource your agent needs, to minimize slop"
It is inspired by the recent bathrobe rants of
@unclebobmartin, a.k.a. the author of clean code
It enforces a minimum test coverage, maximum cyclomatic complexity, mutation tests, code style across different languages
But I have a major issue: How do I know that Slophammer itself isn't slop?
One way is to implement and use it for Python, the language I know better, and judge what kind of changes it enforces
So for this weekend experiment, I used Slophammer to refactor, improve coverage and merge new features to one of my old Python projects, Manim Voiceover
github.com/ManimCommunity/ma…
The result is... mixed. We now have types everywhere, which is great. But the constraints have also made it write garbage code like this one. It works fine, even though it's not elegant. The new feature also works
What do you think? Does code still need to be aesthetically pleasing to the human eye? Should it still be human readable?
If an agent writes slop in the forest, and there is no-one to read it, is it still slop?
If anything, I should use its output in Python to reason about other languages, and add more and more constraints. The more the constraints, the less the slop