Creativity and AI Models

Since I’ve retired I’ve taken up reviving a project that I co-wrote over 20 years ago, bringing it into the modern age. The project is Dabo: a framework for writing cross-platform, database-centric apps. Nowadays things like this are done over the web, but in 2004 the state of web applications was pretty limited as far as UI flexibility and database integration. And there were many companies who ran their business on a networked application rather than over the internet, so the market for desktop apps was there.

The project was written using the tools of the day: Python 2.4, wxPython 2.x for the UI classes, along with the database drivers of that era. So bringing Dabo to modern times would take a lot of work. Updating to Python 3.10+ was straightforward enough; I had already worked on several 2->3 projects over the years. Updating the database drivers was also straightforward; most had current versions with the same interface, and the others had been replaced with new products that also shared a similar interface (thanks, Python DB-API!).

The biggest hurdle by far is updating to the current state of wxPython. This is a Python wrapper around the wxWidgets project, which is a C++ cross-platform framework for creating native GUI widgets. wxPython inherits a lot of the C++ feeling and style, and as a result is very un-Pythonic. So when we wrote Dabo, we made our UI layer a wrapper around wxPython. In other words, it’s a wrapper of a wrapper of a C++ library.

You’ve probably never heard of wxPython or wxWidgets – they are relatively obscure these days. And that’s where I think there’s a problem.

I was trying to debug a crash that happened in a part of an app: clicking a button on one tab of a pageframe ran some code, and then switched to a different page. Without fail, switching the page caused a crash with no Python traceback. I asked Claude to debug this for me. It spent a lot of time reading through my codebase, then the entire Dabo framework, and then the entire wxPython project before it could understand where the fault lay. It then confidently pronounced that it understood the issue, and coded the fix. I ran that fix, and it also crashed. Fed that crash report back into Claude, and it went through the same “thinking” steps before pronouncing the new fix. Well, you can guess where this is going. I went through this loop six more times until it finally got a fix that worked. The trouble is, it was one of the ugliest hacks I had ever seen: removing several event bindings, switching the page, and then restoring those bindings.

I’ve seen a lot of reviews of vibe coding where they say to consider Claude and others as “junior developers”, but I would never expect such an ugly hack from anyone, no matter how inexperienced; they would have come to me and said they can’t figure it out, so could I help them with it?

I had an idea as to what caused the crash, as I’ve seen similar crashes before and they almost always involved the event loop. Briefly, events fire all the time, and the framework handles them in the order they are received. So in a case like this, where the code changed the active page, under the hood it fired several events that control updating the UI. These events can sometimes conflict with others that happen around the same time, and cause a weird appearance at best, and a system crash at worst. The trick is to use the “call after” invocation, which instead of firing the events immediately, tells the app to wait until all pending events are processed before handling this one.

I told Claude that its “fix” was unnecessarily hackish and ugly, and had it revert those changes. (Tip: always have tools like Claude work on a development branch just in case it blows up like this). I then changed the one line that set the active page to use the call after design, and the crash went away.

Now I’m not trying to disparage tools like Claude; I’ve used them successfully in the past. What I think is different this time is unfamiliarity: there just isn’t that much code out there that uses wxPython for them to get sufficiently trained on in order to determine the correct approach. You can get great results with apps written in Python, JavaScript, Rust, Go, etc., because there are tons of repos in GitHub in those languages for LLMs to train on. There just isn’t enough training material for wxPython.

Which brings me to the main thought that resulted from this: creativity. How can we ever expect LLMs to come up with something new? They are designed to draw on what’s already been created, and if it hasn’t seen something yet, it is very unlikely to ever come up with that. I’m guessing that there was nothing in the crash report that had a link to a fix using call after, or else Claude would have come up with it as a solution. So in the next few years – the era of “vibe coding”, where LLMs generate the majority of new code – how do we expect new solutions to come about? New versions of the models will be trained on increasingly greater proportions of LLM-generated code; an inbreeding process that can only make newer models more repetitive.

Given this, can we ever expect an LLM to be creative? To propose an approach that has never been done before?

Day 53: An Engineering Mindset

I have spoken out many times about how much I dislike software developers granting themselves titles that include the terms “engineer” or “architect” in them. Those are titles that are earned through years of hard study and certification, just like doctors and lawyers.

Software development is not engineering. If I want to build a vaulted ceiling in my home, there are tables of the properties of materials that give the acceptable spans for any given size of component. If I have a 20-foot span, I can look at those tables and determine what I would need with steel beams, engineered wood beams, or plain 2×10 lumber.

Engineered Lumber & Beams | NICHOLS LUMBER AND HARDWARE
Each of these engineered wood beams has a known maximum span.

There’s no need to debug this; these are known values, along with gravity, weight, and all the other things that go into building design. And you could use a table for materials from 100 years ago, and it would still work today. Knowing how to apply these values in the structure behind the design of buildings takes years of study before one can legally call themselves an architect or an engineer.

The most apt term I’ve heard for a software developer is “gardener”. It’s accurate, as gardens take up-front planning, and like software, they need to be maintained. Both also have their share of bugs!

So while I won’t call myself an engineer, I do have an engineering mindset. What I mean by that is I strive to be methodical about things like program structure, testing, code review, version control, and the like. I enjoy working with teams who are like-minded in that regard.

An engineering mindset isn’t limited to software development, though. I find I do that with every task I do. Take washing dishes, for example. We don’t have a dishwasher, so they all need to be washed by hand. Nor do we have a drainboard, so they have to go on a towel by the sink. I don’t just wash them in the order that they are piled in the sink; instead, I re-arrange them so that they are stacked in the order to be washed in the left sink basin, with the right sink basin empty. Why? Because the drying area is on the right, and this makes for a neat left-to-right flow. First the flat dishes get washed and placed in the right sink. They are then rinsed off, then placed vertically leaning against the wall to help them dry evenly and quickly. Then the bowls and other things with depth are washed, with the eventual placement in the drying area determining the order. Finally the small things like utensils are washed and placed in any available spot left on the towel. This allows the most efficient use of the limited drying area while still allowing things to dry fully.

The other thing I try to optimize for is to minimize the use of hot water. I’ve come up with some routines for group wetting and rinsing that has cut the amount of hot water usage. I’ve even played around with how an item is handled while being rinsed in order to get the most efficient rinsing of all surfaces.

I have been developing this process over the 4 years since we moved into this small house, and I believe I have it down to as efficient a flow as possible. I’ve mentioned this to people, and their reaction is along the lines of “wow, you’re pretty OCD!”. But this isn’t anything like OCD: people who suffer from that condition say that they are perfectly aware that their actions are silly or even harmful, but are unable to stop doing them. I choose every one of these steps because it makes sense. If someone were to show me an even better way to do it, I’d switch in an instant.

That’s an engineering mindset: taking a process, even one as mundane as washing dishes, and always thinking of ways to optimize it. It doesn’t feel like work, though, it’s more like solving a puzzle. Some people like crossword puzzles or jigsaw puzzles; I like solving dish washing puzzles!

Day 49: Little Courtesies

Someone recently told me of the shopping cart test to gauge a person’s level of consideration for others: when you unload your groceries into your car, what do you do with the empty cart? Most people return them to one of the cart collection areas set up for that purpose, but many do not. They just leave it in an empty space by their car, and drive off. Sometimes they make a minimal effort to reduce the risk of the cart accidentally rolling away and denting another car by propping in on a nearby curb, but many times they simply leave it.

How difficult is it to walk the cart to a collection area? Some suggested that a person might have a disability that would make that difficult, but it does seem odd that they would be able to use the cart to do their shopping, and then push it to their car, but not be able to return it.

To me, this displays a lack of basic courtesy, rooted in selfishness. The cart served your needs, so it is just abandoned. There is no thought about potential damage to others’ cars, or making the employee work harder to gather the carts from the far-flung corners of the parking lot. It’s a simple test of one’s consideration for others.

There are many such things where you need to acknowledge that you are just one person in a common environment with others, and when we do, things just go much smoother. Did you use the last of the toilet paper roll? Or leave just a tiny bit? If you don’t make the small effort to replace it with a new roll, you’re making life more difficult for the next person. Same thing with cleaning the lint screen of the dryer after your load. It’s a small effort on your part to make someone else’s experience much better.

What do you think about people who can’t be bothered to do these little things? Sure, everyone forgets once in a while, but I’m talking about people who consciously choose not to do them.

I’m writing this in the shadow of the biggest social effort in some time: stopping the spread of COVID-19. Everyone is asked to do something very simple: wear a face mask over your nose and mouth to reduce the potential for spreading the virus, since people can be infectious before they have any symptoms at all. It’s not much to ask, but man, the way that some people react makes it sound like the worst oppression ever experienced by a human being!

My parents lived through World War II (my dad fought in the war), and I grew up hearing stories of the rationing that the entire country was expected to follow. I can’t imagine something like that working today, for one simple reason: back then people saw themselves as belonging to the same side against a common enemy. That’s no longer the case: too many people see themselves as a persecuted group

It’s sad, but that’s to be expected with the polarization that has spread across this country. Too many people have rejected the American vision of inclusion that we’ve been striving for for centuries, and want to return to the days of straight white male dominance, even if it means embracing our enemies.

Me? I’m going to continue to return my shopping cart to the cart return area.

Day 45: Composing Music and Code

I am not a musician. Yeah, I was a vocalist in a couple of bands in high school and college, but all I really did is copy the original song. The notion of coming up with a new approach to a song was way beyond my imagination.

I am amazed by people who can write their own original songs. How can you create a melody from… nothing? It really is beyond my ability to comprehend. Lyrics seem straightforward enough, but the music?

A few years ago at a conference I was hanging around in the evening with some friends, several of whom were musicians that had brought their guitars. One of them played a song, and I asked him where the song was from. He replied that it was one of his own. “Wait: you wrote that yourself?” That surprised the hell out of me!

Now that my curiosity was piqued, I couldn’t help but ask him how he does it. He replied that sometimes he has some little bits of music in his head, just a couple of notes. When he’s practicing his guitar, he’d just sit around playing some small riffs; just a few notes here and there. He’ll play one, then change it up a little bit, and if it sounds better, he’ll start working with that. Over time he’ll have a few more such bits floating around in his head, and every now and then he’ll play a few that just start to flow together. At that moment he can hear the overall melody, and he has to write it down, or record it – anything to capture it before it fades. It doesn’t matter what time of day it is, or what else is happening; he can’t do anything else until he has it down on paper/tape/whatever.

Now I understood: his process for composing music was very similar to what I experience when coming up with a coding design to a given problem. I’ll play around in my mind with a few approaches I’ve used in the past, changing them around as needed to see if that would work. At some point, though, the pieces seem to align themselves into the solution I need, and I can see it clearly in my mind. At that point, I have to write down what I’m seeing before I lose it. I can remember times when I missed appointments because I was heads-down writing such a solution.

The act of creation is remarkably similar for both cases: playing around with ideas/riffs, and once the solution “appears”, a furious effort to record it. And it’s that “playing around” part that is really hard to explain to others: to them, it just looks like you’re screwing around instead of working.

I do my best thinking when I’m walking, not when I’m planted in front of a keyboard. If you’re ever stuck trying to come up with a solution, try changing what you’re doing. Go for a walk, work on your garden, vacuum the floor – anything to move away from the computer and get your body moving. That act alone helps free the brain to make connections that it might otherwise never make.

Day 43: Scarcity and Value

How do you price art?

There is one aspect of economics that everyone understands: the law of Supply and Demand. It’s pretty obvious: useful/desirable things will be valued more highly than stuff that isn’t as in demand, and scarce things will cause people to offer to pay more.

I’ve found something
No one else is looking for
I’ve found something
That there’s no use for
And what’s more
I’m keeping it to myself

Wire, Single K.O.

For this discussion let’s assume that the art in question is “desirable”, so that there is a certain level of demand for it. The determinant for price will therefore be how scarce it is.

There is a fundamental difference between a painting, in which the creative effort results in a single item, and a recording of a performance, which can be duplicated and replayed an infinite number of times. The artist can only sell their painting once, but can sell as many videos as people want.

This same issue comes up with media such as photography and print making: there really is no limit to the number of copies of a single art work that can be made. In the days of negatives, the act of making a positive print was itself part of the creative process, because the printer (usually the photographer) had to have a feel for how to balance overall exposure with local dodging and burning. The great photographer Edward Weston trained his son Cole to learn his precise printing techniques, so that Cole could continue to make prints that would be as close to the artist’s vision as possible. So while in theory an infinite number of prints could be made, there is a practical limit.

But digital photography throws all of that out the window. The artist can make whatever corrections or other changes they want to the digital file, which can then be reproduced without loss forever. So how does one determine a price for something like this?

I’ve recently begun to submit my work to several galleries, and have had some success – just yesterday I got notice that one of my photos was accepted for a show! But I’ve seen several Calls for Entry for exhibits that have a requirement that any submitted work be part of a limited edition. A Limited Edition is when the artist decides that there will only ever be a certain number of prints made, and each print is “numbered” so that they buyer knows that they are one of the few owners of that piece.

I call bullshit.

Art’s value is in the piece itself. If it moves you, makes you think, or just is stimulating to look at, it has value. The fact that only a few other people can enjoy that particular piece doesn’t change the experience; it just creates an artificial scarcity to prop up prices that otherwise can’t be justified.

Paintings are scarce, by their very nature. Digital photographs are not.

I’m not playing this game. Sure, this might keep me out of some galleries, but those are probably not compatible in spirit with me. With a calibrated monitor, I can create a digital file that can be printed exactly the same anywhere in the world. If you like my work and want a print, I will sell you a print. I won’t say “sorry, but I’ve sold all the prints I can make of that image. You’ll have to find one from some art dealer or collector”.

The digital transformation calls for new ways of thinking about art. The music business learned that lesson with the advent of the .mp3 file. The photographic business will need to grow to accommodate this new digital reality.