Showing posts with label Society. Show all posts
Showing posts with label Society. Show all posts

2026-04-16

Maybe good coding practice will still be a thing after all

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
Martin Fowler

Consaider this (fictionalized) exchange about the abilities and limitation of LLM coding tools

Enthusist:
See, the model can write code for you!
Skeptic:
Well, it does seem to be correct, but the code quality isn't that great.
Enthusist:
It doesn't matter, those "code quality" rules were for people, and now the machines will write all the code.

And that might be the case, but I see two potential barriers. First, even if Claude is not as frail as—say—me, it does have limitations. Second, we don't yet know what the unsubsidized cost of machine coding will look like. And sitting at the intersection of those concerns: while it is technologically possible to work around some of the limitations those efforts probably drive the cost up. Alternately, if cost is your big concern you could try running locally but the cost-capability trade-off could be punishing.

Okay, the model can comprehend spaghetti code, but how much?

My experiment with machine coding have been pretty limited: any given session starts with a few hundred lines of human written, or machine-written-but-human-reviewed-and-tweaked code. Then as the session proceeds, the machine generates a few dozen lines of new or changed code. The generated code is sometime perfectly acceptable and sometimes not really up to production standards. But the interesting thing is that I can continue with the session without manually fixing so-so code generated in the last round, and the machine can comprehend it just fine. Nice

That's promising, the model is not confused by a small amount of spaghetti code. That said, I could handle that much (and in my younger days routinely did). I fix messy code pretty early in my work not because I can't work with it up to a point, but because I know it's easier to fix in small batches and it also prevents me from forgetting to go back to some section or another.

But there is a limit to how much bad code a human can deal with, and we should expect there to be a limit for the models as well (though it could by a bigger limit). And that is where size fo the code base comes in. A lot of coding class assignments and similar toy problems can be done in a few hundred lines. A hobby project might be a few thousand lines. A small, focused tool might be a few tens-of-thousand lines. A small production applications (like my main project at work) might be in the low hundred-thousands. Any seriously large project will exceed a million lines.

How much poorly organized code can a LLM (even a big one) actual maintain in the long run? I don't think our current experience is much of a guide to that yet.

And yes, we see regular reports of big, capable models working in largish code bases, but the code they're starting with was (at least initially) laid down by and organized by humans. And often humans with quite stringent standards at that. The model being able to work in that code base is a different thing from the model being able to work in one that isn't so carefully tended. Unless the models can write quality code, or they are subject to constant supervision by humans who can, projects they work on will succumb to entropy over time. And then we'll see.

Can you afford it?

It's widely reported that all the big LLM providers (OpenAI, Anthropic, etc) are still subsidizing users with venture capital. No surprise, really, the lock-in-then-enshitify strategy has been the way to make serious money in tech for decades. But it means that the last couple of years of corporate experience in the economic viability of machine coding may not be representative of the after-the-llm-market settles down situation.

Does code-quality matter to the model?

The interesting case for the code quality situation comes up when two things are true: (a) the model can comprehend and work in "nice" code better than "messy" code1, and (b) the cost situation isn't a complete blowout in either direction. Under those conditions, there is a clear incentive to keep the code base in a less expensive state. Either the models will have to learn the lessons we teach to human beginners, or the human supervisors will need to steadily manage the chaos introduced by machines that haven't learned better for themselves. Honestly, the latter possibility sounds like a brutal and unrewarding job.

It's early days yet, just you wait

We've been hearing some variation on "Today is the worst it will even be again" since the whole idea roared into the mainstream a few years ago. And that's not wrong, but it doesn't tell us anything about where (or if) the tech will plateau.

It is certainly true that, as time passes (and money gets spent like its going out of style), the state of the art models are getting bigger, and that models of every size are getting more capable. Though I may play the grumpy contrarian at times I am genuinely impressed. But if we're not looking at some kind of run-away self improvement, then there will be both hard limits and probably a cost function that grows rapidly as one approaches the hard limit. Either could represent a barrier to the dominance of machine coding.

Or not. But I'm not taking the hype machine as a guide. Their incentives are all too plain for them to be trustworthy.

Variations

Up to this point I've been focusing on understanding the future shape of programming on the assumption that the models will be good enough to write all the code. In that model, economically motivated programming will be shaped mostly by economic factors: things like "how much do models cost compared to skilled humans?" and "How does the cost of getting the model to do a nice job compared to the cost of letting it spend time grinding through a huge and complex context?". But we can also throw some other assumptions against the wall and see what the resulting mears look like.

Models master the small picture, but not the wide view

We can image that the models never really get the hang of both understanding a big project on the scale of interacting modules and then writing code on a modest scale with that design in mind. That when they work in a big project without supervision they make a mess by violating architectural separation that were designed in, by losing track of existing utility code and duplicating it locally, by putting routines in less than optimal parts of the module tree, and so on.2 In a world like that we might need to have human supervisors even if we're handing most or all of the coding over to the machines. And the codebase need to be comprehensible to those supervisors, so code quality will still be a thing that people care about.

The state-of-the-art is good enough, but it's expensive

In another scenario, the best models available can produce and maintain software as well as a expert team of programmers, but the cost per unit-code is higher than a typical human team supported by less able models. We might see the most valuable project done almost entirely by machines, while more marginal projects use non-trivial human input. We'll probably have a smaller industry and with different skills in demand: humans will need to drive and supervise models which are doing most of the grunt work.3 And here the code quality issue is driven by the understanding of who need to comprehend each individual project: if it's only models then we just pay what it costs if the readers include humans then we exercise the discipline. And man, if you have to downgrade a project from machine-only to machine-assisted there is going to be a heck of a bill...

A word of caution

Even if machine code is objectively worse in some sense it could crush human coding as an economic activity. There are multiple cases from the industrial revolution of craft industries being pushed almost completely out of existence by worse-but-cheaper machine-made goods. The small number of practitioners that stayed in business were serving either luxury markets or special use cases and many of them came under increasing pressure as the industry got better at the task. That is a thing that could happen to human coders, too.


1 I haven't seen anyone on-line addressing this question yet, and am just getting started on my own investigations of machine assisted code so I don't even have a feel for it yet. But it feels right to me: with a messy code base you're going to need more context for for the machine to address any given problem, and context means processing.

2 You know, like people do? Occasionally I assign people working on my project (including myself, of course) to look through the module they're working in, find any stray utility code and see if it needs replacing with centralized tools, or ought to be moved to the make it more widely available. Likewise, I look closely at change sets that touch build files for evidence of potential harmful added inter-connectedness. It's an ongoing effort because it's often easier to do the wrong thing than the right one.

3 My biggest worry in that kind of scenario is what does the pipeline for training new human experts look like. It's not clear that anyone knows yet and there could easily be a lean time as existing experts retire and an insufficient number of new experts are emerging to take their place.

2026-01-30

The limits of manipulations for "their own good"

It's OK, because Duggee has his gas-lighting badge!

It's an endless question for parents about their children, isn't it? How much pressure and distortion can I, legitimately, use to teach them things,1 to buy a little space, and so on? Some, I suppose, but it must be an ever moving target as the kiddo grows, develops, and just gets better at seeing through our BS. We try to keep in mind that the kiddo must one day stride forth to meet the world with her own skills, opinions, and point of view. We'd like that to go pretty well, so the scaffolding must be dismantled and some kind of model of good-person-in-a-hard-world needs to be offered.

I'll just get right on that.2

But, wait! There's more! My wife and I are smack is the middle of the sandwich, so it's also applies to interactions with our elders. And the answer to that, too, will be an evolving thing. Right now it's just one set, but there is every reason to suspect the others will need support sooner or later. So that's a whole different take on the same kind of questions.


1 In my prior, professional life, it even had a name: "lies to children".

2I wonder who in their right mind would sign off on our being parents in the first place?

2022-10-13

On being "that guy"

I contacted a support desk with an issue that I should have had instructions for but didn't. So far so good.

However, I followed up by asking a question about their response that I'd have answered for myself if only I'd scrolled beyond the page break. Not a good look.

In my defense there was a huge blob of whitespace at the botom of the page and I thought I'd reached the end of the document.1

Alas, after they poliely didn't tell me what an idiot I was being, I commited the "didn't read far enough" error again. Sigh.

Sorry guys. I did frontline support for a while and I feel for 'ya.


1 Because Word is paricularly crappy at layout even by word processor standards. One of the things I miss about academia is LaTeX: the typesetting and layout might be boring but they will avoid the easy misakes by default.

2022-03-13

Recycling categories

My wife and I try to take advantage of whatever recycling options are available to us (and we compost, too), and because I've dragged her around the country following my jobs for the past couple of decade we've lived in places with varied levels of availability. Travel has brought us in to contact with still more way to organize the process.1

Now, I'm far from an expert on this industry, but I know it can be a challenging domain to work in. The work of sorting mixed waste into coherent categories is non-trivial and costs real money if done in bulk after the material is turned in or depends on ordinary people's willingness and ability to get the sorting right. And sorting errors are significant:2 batches of material are often diverted to landfill due to "contamination"; a word which apparently covers a lot of sins from including food-waste (pizza boxes in your cardboard recycling, anyone), to mixing different categories of material together, or carelessly tossing plain garbage in a recycling bin.

Our local arrangements require individuals wishing to recycle to bring recyclables to a central facility3 and load them into dumpsters and big bins in six different categories (paper, cardboard, glass, plastic, aluminum, and ferrous metals4). Which leads us to some questions:

  • Just what plastics are allowed?

    At least these are generally marked with the numbered recycling trefoil, but we're encountered places with an added requirement specifying only bottles with necks. Huh? And in most places I've lived plastic bags can't be recycled in the municipal system. You have to take those to the various stores that accept them.

  • What is the difference between paper and cardboard?

    How do I decide? Does it matter if the paper is glossy or not?

  • What aluminum items are accepted?

    In some places it's just cans; in others you can bring foil and disposable cookware (if clean). What about substantial pieces of structural meta?

  • Glass?

    Does is need to be sorted by color? What if it's broken?

  • About that food waste thing...

    Does it rule out greasy paper? What about bottles and cans with beer or soda remnants?5

  • Batteries?

    These are a significant source of hazardous waste in landfill streams, but in most places they are hard to recycle. It's generally the case that you have to sort by chemistry and that cracked and leaking batteries are an extra pain.6

And so on and so forth. It's not trivial to know what is expected. You have to find, read, and indeed pay attention to the documentation supplied by your locality. Uhg.

Then there is the matter of what to do if you're not sure (or if, say, you and your spouse disagree about what the rules are). Should you submit things which you are unsure of at the possible cost of "contaminating" a load or contributing to a contractor terminating a contract? Or should you knowingly send things to landfill to insure that other stuff gets recycled?

I haven't traveled widely enough recently to have a good notion of how they do these things outside of the USA, but when I was going to Japan regularly in the noughties they seem to have a much more unified system (same bins and iconography in Tokyo and Osaka airports, JR station in several places, and in the small villages in Toyama prefecture. Europe was more varied than Japan but more consistent than the US.


1 When we attended a wedding on the big island of Hawaii just after the turn of the millennium the resort provided us with a laminated copy of the island's waste disposal guidelines card, listing approximately thirty different categories of trash, recyclables, and hazardous waste and detailing how/where each was to be disposed of (there were three categories of used batteries).

2 In one place we lived the city recycling unit made yearly reports on actual the levels of waste in various categories and the target's their upstream contractors would accept. And you can learn something about the process just be examining those targets: they would accept a much higher rate of ferrous metals in the aluminum then other types of contamination, so you have to figure that magnets were employed to divert the unwanted metals to the correct processing chain.

3 At least the lot in question is open 24/7. In one place the lot was open about seven hours a days (except on Sunday) with some days of the week including morning hours and others evening hours.

4 They mean iron and steel. I've checked because, the bin is labeled "tin cans" even though no one has used tin for cans in many decades. Linguistic habits can linger long after they are no longer strictly applicaable.

5 Not rinsing is a pet-peeve of mine. Not so much because of the smell, but because the aluminum bins at our local places are often swarming with bees. But I've met people who argue (not without a point) that we live in a desert currently experiencing a drought and they don't want to waste water on the effort.

6 I've had at-work arrangements for batteries when I worked on-site at national labs, and in my last job where we had an environmental health professor who knew all the right people and maintained a drop-off site in has departmental office. Which gives you some idea of how arcane that process can be.

2021-09-03

Observation of the day

We all come into this world with our Pleistocene brains, ready to take on the information age.

2021-08-23

Objective knowledge is ... subjective?

I recently finished Jonathan Rauch's The Constitution of Knowledge: A Defense of Truth. I found most of the book pretty depressing: it relentlessly examines the ways in which trolls, propagandists, well meaning activists, and shameless bullshitters have been succeeding in attacking the foundation of collective certainty that is the legacy of the enlightenment and subsequent advances. It does make the effort to end on a optimistic note with a exhortation to action in the defense of objective truth.

I recommend it; but hang onto your sense of purpose in the world: it's a rough road.

But I want to point out an oddity in the author's conception of the world (one freely admitted in the text, by the way). One of several guide-stars it the text is what Mr. Rauch calls "the reality-based community" and the rules under which it operates (which he dubs "The Constitution of Knowledge").

We should stop to note that Mr. Rauch's conception of this community encompasses a pretty broad swath including not only scientists but also many other scholars, journalist, intelligence analysts, various members of evidence-based judicial systems, and some governmental and no-governmental policy wonks. Basically everyone who approached the creation of knowledge using The Constitution of Knowledge as a foundation.

One of the key rules of the "knowledge" produced by these systems is that anyone else honestly and diligently following the same rules and using the same base of existing facts should come to the same conclusions. A condition you know you've reached when a strong consensus emerges in the community itself.1

But that leaves us in the epistemological interesting positions of having "objective" knowledge be the product of consensus (among a suitably trained set of investigators), which is at some level a subjective entity.2

The reason this doesn't bring the whole structure down in ruins is the allegation that the processes is what generates the reliability. Have trained in a physical laboratory science I have recourse to highly repeatable experiments for much of the grounding of my discipline,3 but the idea that persuasion through open, earnest, and largely no-personal argumentation is the legitimate route to authority works more broadly that the experimental sciences.


1The author presents a number of examples.

2 Indeed, the author talks about the ways consensus forming can fail or be subverted.

3 Even in physics you get into places (like quantum foundations) where interpretational issues become important in the way we teach, relate, and apply the things we know.