Matthias Lüdtke's better-idea.org

jsonnormalize

I have written jsonnormalize a while ago, but I am surprised at how often I need this helper to compare some json: https://github.com/mat/dotfiles/blob/master/bin/jsonnormalize

PyData Berlin 2025 Notes

I just came back from the PyData conference in Berlin and apart from meeting a lot of great people, I took some tidbits away:

  1. Docker’s Cache mounts can be used to solve the problem of a single pip dependency change invalidating the entire Docker cache. So instead of doing:

    RUN pip install -r requirements.txt
    

    You can do:

    RUN --mount=type=cache,target=/root/.cache/pip \
        pip install -r requirements.txt
    

    Or, equivalently, for uv

     RUN --mount=type=cache,target=/root/.cache/uv \
         uv sync
    

    This will cache the pip downloads and speed up subsequent builds.

  2. You can, through the magic of WebAssembly, run DuckDB in the browser: https://shell.duckdb.org

  3. For documentation, people (e.g. like Github, Cloudflare, basically everyone) are more or less following the Diátaxis framework. I have a Dejavu feeling that I have seen this somewhere before under a different name. The idea is to split documentation into four categories: tutorials, how-to guides, explanations, and references. Tutorials and how-to guides are task-oriented, while explanations and references are information-oriented (on a need-to-know basis).

  4. How did I miss WebLLM before?

  5. For PDF/HTML parsing and text extraction docling is the new hotness and already very promising.

patience

Sometimes, with flaky tests, you just have to have some patience. I have written this helper script recently to use git bisect with a somewhat flaky test:

https://github.com/mat/dotfiles/blob/master/bin/patience

Unicode Symbol as Text or Emoji

Unicode symbol as text or emoji

Append codepoints.net/U+FE0E to make a Unicode symbol render as text.

When tech is fully adopted, it disappears

When tech is fully adopted, it disappears.

Mobile Is Eating the World

Alfred: UIColor from Hex

Being tired of manually creating UIColor instances from hexadecimal representations (and not always having a category on UIColor handy for this) I finally hacked together this humble Alfred script to do just that:

E voilà, we now have this string waiting in the clipboard:

[UIColor colorWithRed:19.0f/256.0f green:55.0f/256.0f blue:66.0f/256.0f alpha:1.0f]

Download Workflow from GitHub: UIColor-from-Hex.alfredworkflow

Incremental Development — No Silver Bullet

Incremental development — grow, don’t build, software.

I still remember the jolt I felt in 1958 when I first heard a friend talk about building a program, as opposed to writing one. In a flash he broadened my whole view of the software process. The metaphor shift was powerful, and accurate. Today we understand how like other building processes the construction of software is, and we freely use other elements of the metaphor, such as specifications, assembly of components, and scaffolding.

The building metaphor has outlived its usefulness. It is time to change again. If, as I believe, the conceptual structures we construct today are too complicated to be specified accurately in advance, and too complex to be built faultlessly, then we must take a radically different approach.

[…] Some years ago Harlan Mills proposed that any software system should be grown by incremental development. That is, the system should first be made to run, even if it does nothing useful except call the proper set of dummy subprograms. Then, bit by bit, it should be fleshed out, with the subprograms in turn being developed–into actions or calls to empty stubs in the level below.

I have seen most dramatic results since I began urging this technique on the project builders in my Software Engineering Laboratory class. Nothing in the past decade has so radically changed my own practice, or its effectiveness. The approach necessitates top-down design, for it is a top-down growing of the software. It allows easy backtracking. It lends itself to early prototypes. Each added function and new provision for more complex data or circumstances grows organically out of what is already there.

Fred Brooks, No Silver Bullet, 1986

Marco Arment on 'interesting' features

Geeks like us are always tempted to implement very complex, never-ending features because they’re academically or algorithmically interesting, or because they can add massive value if done well, such as speech or handwriting recognition, recommendation engines, or natural-language processing.

These features — often very easy for people but very hard for computers — often produce mediocre-at-best results, are never truly finished, and usually require massive time investments to achieve incremental progress with diminishing returns.

http://www.randsinrepose.com/archives/2011/01/25/interview_marco_arment.html

Fowler on Craftmanship

The software shouldn’t be at the center of a programmer’s world, instead a programmer should focus on the benefit that the software is supposed to deliver.

http://martinfowler.com/bliki/CraftmanshipAndTheCrevasse.html

Fowler on Productivity

I assert that any true measure of software development productivity must be based on delivered business value.

http://martinfowler.com/bliki/CannotMeasureProductivity.html

Fowler and Rebecca Parsons on DSLs

http://www.drdobbs.com/architecture-and-design/228200852

Good overview, Q&A style. Remember to keep your DSL simple (otherwise it might morph into just another L)

Advanced Regular Expressions