Programming Leftovers
-
Miguel Young de la Sota ☛ The Art of Formatting Code · mcyoung
Every modern programming language needs a formatter to make your code look pretty and consistent. Formatters are source-transformation tools that parse source code and re-print the resulting AST in some canonical form that normalizes whitespace and optional syntactic constructs. They remove the tedium of matching indentation and brace placement to match a style guide.
-
Eliseo Martelli ☛ Building The New Recommendation System
Creating a personalized recommendation system for a blog doesn't require massive machine learning models or complex neural networks. With some clever mathematics, we can build a robust content similarity engine that runs entirely in the browser (or on the server).
In this article, I'll walk you through the implementation of a lightweight embedding system that powers the “Writing" section of this blog using TF-IDF vectorization and cosine similarity.
-
Daniel Janus ☛ Cleaner codebase, happier mind
Increasingly often, I find myself wondering: why don’t we apply the same thinking to codebases?
Let me stress that I’m not talking about “clean code” in the Uncle Bob sense; I mean the chores that everyone would like to see done, but nobody apparently has time for doing — the cruft that has accumulated as tech debt. Every codebase has something like this, and you know it when you see it. That flaky test that’s been failing once in 20 times or so, for no apparent reason. That legacy component that could plausibly be implemented with more modern infrastructure. That Jenkins instance you keep around just for CI-ing it. Those three in-house libraries that all do the same thing, but in slightly different ways. Those modules that are only there because you ran an A/B test involving them a year ago, which has since been rolled back. And so on.
-
Perl / Raku
-
Rachel ☛ Bugs, bugs, bugs!
Along the way, I obviously didn't internalize the rule that "in XHTML, attribute minimization is forbidden". It sounds like the kind of thing I would have read once back in the 90s when I was trying to get pages to validate as XHTML 1.0 for some cursed reason, and then promptly forgot. So, it would do a bare "controls" attribute and thought it was fine.
In practical terms, it means you can't do this: [...]
-
Ruben Schade ☛ The ISO 639-1 language code for Japanese is ja
I’ve got a longer post about mixed-language support in HTML and XML documents pending, but in the meantime I realised I’ve been defining Japanese wrong for probably years.