December 23, 2024 8:11 PM

How to Know Your Abstractions Need More Work

A lot of folks are using LLMs to help them write code these days. David Chisnall, for one, is unimpressed. He has, however, found LLMs "vaguely useful" in one way while programming, a way that made me smile:

The one place Copilot was vaguely useful was hinting at missing abstractions (if it can autocomplete big chunks then my APIs required too much boilerplate and needed better abstractions).

I love it! An LLM identifies a missing abstraction by showing where it needs to be. It does that by writing the sort of code that the abstraction should hide away.

The cover of the book 'Drawing on the Right Side of the Brain'. The main component of the cover is a pencil sketch of a young woman's profile, facing right, with brown hair down to her shoulders.
The book that taught me
about negative space

This makes me think about the role of negative space in software design, from one of the early posts on this blog. LLMs generate the code we can see when we look head-on at a problem we understand well. If we instead turn the problem upside down, or inside out, we may have a better view of the code we really need. The LLM's code points to that new view.

Following Chisnall's idea, we might set out to create abstractions until the LLM can't auto-fill our code for us. How is this for an LLM-driven design algorithm of sorts:

  1. design a program
  2. while (an LLM can fill in substantial boilerplate)
    1. create a new abstraction
    2. revise the program

Personally, I'm still not all that excited about using LLMs to help me write code. I like to write code, and need more opportunities to do so, not fewer. But if I decide to give them more of a try, I might well use this approach. It tickles my curiosity enough to make the outcome of real interest.


Posted by Eugene Wallingford | Permalink | Categories: Patterns, Software Development

December 22, 2024 1:43 PM

"Printer's Error" Numbers

35 · 1482 · 9760 = 3514829760

This is known as a printer's error. If the typesetter misses the superscripts in a printer's error, the value printed is still correct.

This page lists all kinds of printer's errors, including generalizations across bases, shifting digits, and the like. Much fun.

Hat tip to Futility Closet, which I am happy to have active again in my newsreader after a one-year hiatus back in 2022-2023.


Posted by Eugene Wallingford | Permalink | Categories: General

December 06, 2024 1:54 PM

The Google Vision API Gets Me

Someone on Mastodon posted a link to They see your photos. According to the site, Your photos reveal a lot of private information. To demonstrate this, the author uses the Google Vision API to describe the content of any photo you upload.

I was curious. I uploaded the professional headshot I use on my relatively new home page (*). There doesn't seem to be any negative implication in using this photo for an experiment, as it is already out on the public web and available for anyone, or any program, to see.

Here's the image:

a professional headshot of me, which is best described by text coming later in the page

What do you see when you look at that image? Here's what Google Vision had to say:

The image shows a headshot of a person against a plain white background. The foreground is dominated by the individual, who is the clear focal point. The background is simple and uncluttered, drawing all attention to the subject. The overall setting appears to be a professional portrait studio or a similar controlled environment.

The person in the image is a middle-aged man with light skin, appearing to be of European descent. He wears glasses and a light blue polo shirt. He seems friendly and approachable, with a gentle smile. His expression suggests confidence and approachability. The image seems to be taken in the daytime judging by the lighting, likely for professional purposes such as a LinkedIn profile picture or corporate directory. The camera used appears to be a high-quality DSLR or professional-grade camera, considering the sharp focus and detail.

The slight greying at the temples of his hair and fine lines around his eyes subtly indicate his age and perhaps his professional experience. The simple yet neat background and his attire are consistent with someone who holds a professional position, suggesting a stable economic status and a mature, possibly traditional lifestyle. The image shows no additional objects or accessories, keeping the focus entirely on the person.

Wow. It is not wrong.

I would be happy for someone who sees that image, or who meets me in person, to think "He seems friendly and approachable, with a gentle smile. His expression suggests confidence and approachability." Friendly and approachable are certainly attributes I would like for others to see in me, both professionally and personally. I'd also like to project a humble confidence.

Is it wrong for me to feel flattered by the assessment of a piece of software? I can only hope that people see me the way Google's image processor says they might.

~~~~~

(*) I created this home page last summer while preparing for my second offering of our web development course. Four months old isn't particularly new, but it seems quite new when compared to the thirty-year run of my previous home page, which had changed only in dribbles over its lifetime.


Posted by Eugene Wallingford | Permalink | Categories: Computing, General, Personal