Jason Becker
2024-05-11

This is what ChatGPT is supposed to be good at

This morning I had a question that I would normally post online. It was as follows:


Ok, I need a little CSS help. I have a structure like this:

1
2
3
<div class="post-item"></div>
<div class="post-item"></div>
<h2>Stuff</h2>

I want to add a margin after the last .div.post-item prior to an H2. I thought this would work:

1
2
3
div.post-item:last-child {
  margin-bottom: var(--size-step-2);
}

It does not. Advice?


I would have gotten an answer, for sure. But ChatGPT gives me an answer and really taught me something. Here’s what I got back in an instant.

ChatGPT’s wrong answer

The :last-child pseudo-class selects the last child element of its parent, regardless of its class. So in your case, it’s selecting the last child div element, not specifically the last .post-item element.

To achieve what you want, you can use the adjacent sibling combinator (+) to select the h2 element that follows the last .post-item. Here’s how you can do it:

1
2
3
.post-item:last-child + h2 {
  margin-top: var(--size-step-2);
}

This CSS rule will select the h2 element that immediately follows the last .post-item element and apply the margin to it.

The problem is, this doesn’t work. It’ll keep telling me over and over again that .post-item + h2 or other variants will work. None did. I could do a broader selector (div + h2 works for my purpose, though I would prefer to have been more selective).

I still need my brain

The problem I actually had was structural. My page looked like this:

1
2
3
4
5
h2
div.post-item
div.post-item
div.post-item
h2

And although that looks hierarchical, it’s not. The correct “fix” in my opinion, was to change the DOM structure to look like this:

1
2
3
4
5
6
h2/
div.post-list
  div.post-item/
  div.post-item/
/div.post-list
h2/

And then use the following CSS:

1
2
3
4
5
6
7
.post-list .post-item:first-child {
  margin-top: var(--size-step-0);
}

.post-list + h2 {
  margin-top: var(--size-step-2);
}

If I had asked my question on social media, would people have given me a better response? If I had Googled, would I have found my answer?

I’m not really sure if ChatGPT’s false direction saved or cost me time. But I do know that even relatively straightforward seeming coding questions are often hard to answer. Problems are tricky, and making them minimally reproducible and asking the right question is the hardest part. Looking at my page structure and realizing that it was too flat to use selectors how I wanted required understanding and intuition, some of which I had already, and some of which I had to learn and reinforce while playing around with my own site in context.

I have used Copilot a bit and been pretty impressed with a narrow set of specific tasks. But so far at least, most of what I’ve been able to get out of language models for coding is just a tiny bit more than a rubber duck. It’s like halfway between talking to myself and having a real person sit with me for fifteen minutes. Maybe that’s enough to be incredibly valuable. But so far, it’s kind of on the margins. When it hits, it’s magic. But you only get the magic once you know enough to ask really precise, smart, correct questions. And at my stage in my career and with my current knowledge, by the time I can confidently ask the right questions, the problems are as good as solved.

2024-05-06

Do tools become popular because they enable labor arbitrage? Maybe. But I don’t think it’s so simple. All tools are meant to lead to some kind of efficiency– they help us do more and do more complex things than before. If they didn’t it wouldn’t be much of a tool.

In all cases, improved efficiency and efficacy like this can be turned into some form of lowering labor costs.

Of course, Baldur isn’t saying “things that make work easier” are what cause labor arbitrage. Instead, it’s tools that enabled reduced specialization that seem to grow, in his view, problematically. But this just feels like moving the goal posts on an age old argument about “higher level languages”.

Are abstractions good? Often. Is reducing the amount of code and deep understanding you need to solve a problem a good things? Often. I’m so glad we don’t have to solve every problem associated with authorization from scratch and have much more safe defaults these days. I’m also glad we can write for the web without maintaining our own TCP/IP stacks or server (software).

I think it’s hard to point where the line is between “abstraction” and “labor arbitrage”. I’m not surprised at the sort of bimodal distribution on tooling – some aggressively unconcerned, and some aggressively concerned– because (at least in the modern Anglosphere), nuance seems dead. But I think that everyone seems to define the line between what is a useful higher order abstraction and what is labor arbitrage based on what was a “tool” during their formative time in tech and what came afterwards.

It’s Douglas Adams all over again:

I’ve come up with a set of rules that describe our reactions to technologies:

  1. Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works.
  2. Anything that’s invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it.
  3. Anything invented after you’re thirty-five is against the natural order of things.”

Something I should have mentioned about tech and labor arbitrage— if a new framework or tool makes it 10% easier to build a product, it makes it 10% easier for my competitors too. I’m not cutting staff— I’m increasing scope.

2024-05-05
2024-05-04

We talk a lot about the “smart phone era”, but I think the transition from spinning disk to SSD, low to high DPI screens, and X86 to ARM have collectively been just as impactful.

Apparently a pretty cool looking guitar shop opened up walking distance from my house about a year ago and I had no idea!

Yesterday, the Baltimore Flower Mart proved to be the anti-Artscape. Quite obviously was the best weather we’ll see all year.

Kristi Noem becoming unacceptable because of her atrocious treatment of a dog would feel a lot better if she didn’t have a record of public service being atrocious toward people.

2024-05-03

I bought my first guitar at Sam Ash. In fact, it was a Fender Sam Ash 48th Street Special Stratocaster I still own. Crazy that at 100 years, they’re shutting down. Being a musician in New York will be forever different.

2024-05-02

Well. Here’s something that unexpectedly hit hard this afternoon.

A purple harness and black leash hanging from a wall hook. They were Gracie’s, who we put to sleep two days ago.

2024-05-01

I appreciate all the well wishes after Gracie’s passing. I’m experiencing a lot of things today for the first time ever without her. One thing that has helped is looking through thousands of pictures and videos of we have. We are so fortunate to have had her in an age of iPhones.

April in Baltimore concluded with 10 homicide victims, the second-fewest ever recorded here in the month of April. Homicides are down 33% from this time last year and 47% from this time in 2022.

In a city where crime is almost always the top issue, somehow our current mayor may be ousted by a former mayor who left in disgrace for stealing gift cards from needy kids while in office. Make it make sense.

Apple’s Get Up! Mix started with five straight banger tracks.

Sometimes the algorithms are good.

Road to Joy by Bright Eyes, I Was a Kaleidoscope by Death Cab for Cutie, New Zealand by Moonlit Sailor, Cosmos by standards, and In Amber by Maybeshewill

2024-04-30

Gracie is gone. Our love for her was deeper than deep. But she couldn’t live on our love alone, or she would have lived until at least 120.

our dog, Gracie, a golden haired beagle mix, laying on a bed staring a the camera with her mouth wide.

2024-04-28

People often bemoan something is enshitification when it’s actually just a company trying to have a business model and survive. We want jobs that treat us well and are “calm” and we want services and products that serve us well but reject paying the margin needed.

If you’ve never had paronychia, I do not recommend it. The pain is pretty considerable and I have an incredibly mild case (based on the disgusting Google images).

2024-04-27

What am I hoping to do with writing on the web? Well, for one, it’s an outlet for my thoughts that I want to remember and return to. But that alone is a diary or a journal. These are also thoughts that I hope others will read and engage with in some form or fashion. These are ideas that are satisfying to me because sometimes whispering our thoughts quietly to ourselves is important and sometimes shouting them into the void is important and sometimes we hope the void shouts back.

For years, I had Google Analytics on my personal websites because it was free and worked fine. But for various reasons, I got turned off by the service and the idea of analytics for a bit. So I turned everything off. And being hosted on Micro.blog, despite crossposting to Twitter (when it was available) and Mastodon and just about wherever else, I broadly didn’t know about readership, followers, etc. Interactions were my main measure of reach– do people choose to reply to my posts on their platform of choice?

I think that’s largely my goal– I want to know if people are responding to my writing on their platform of choice.

But there’s a huge problem with this idea today– webmentions. Webmentions is a shit show of a standard. It seems to only kind of work. It definitely confuses and perplexes many writers who are bought into the IndieWeb in spirit but are not writing their own (seemingly always PHP) CMS to implement standards. Folks who are writers first and non-developer tinkerers are met with bad plug-ins, inconsistent behavior, poorly documented inconsistencies, and a whole manner of things that cause them to give up 1. Still, others have decided the very idea of a webmention, especially extended to social posts, and specifically displaying that others have linked (publicly) to your blog post is a privacy concern.

Why are webmentions a problem? Because if I want to know that people are responding to my writing on their platform of choice, I want to know when people write on their blogs and link to my content. Of course I do… my own blog is my personal platform of choice for commenting on the web! Webmentions was supposed to solve this– when someone links to my site, they add the right classes to that link and their server lets my server know that they’ve linked to my site or a specific post. Brilliant– pingbacks/trackbacks for the open web. But it’s just not working and it’s not complete enough. Adoption is low and horribly inconsistent. I’m glad I receive webmentions, but they are exceedingly rare.

Which brings me to my defense of analytics and my own use of tinylytics.app. I don’t care about the number of “hits” my blog gets. Considering how many places I post my content and my own hope that RSS is how most people read my site, hits are almost certainly no more than directionally accurate about readership. What I do care about are referrers. Without webmentions proactively telling me when folks on the web mention my content, I can see if anyone who read that post clicked on the link to my site and ended up here. I have discovered at least three blogs in the last year that linked to me that I now follow through this method. Somehow they found what I wrote. They linked to it, either with short commentary or even a fully on response, and then, because at least one person clicked the link over to my site, I learned about their blog post.

Without analytics on referrers, I’d never know these people were a part of my small circle of the internet in conversation with my writing. So for now, I’m all in on having analytics. It’s one of the few reliable ways to know that someone had written about your content. I still want people to respond on their platform of choice, and I don’t want to lose their voice or conversation.


  1. A more dedicated blogger would have linked each of these to examples, but I am not that kind of blogger most days. I’d rather actually publish this post. Suffice to say, if you’re reading this as an IndieWeb person and you think this stuff just works and isn’t confusing, I promise that you are wrong. I’m quite technical and have a strong understanding of what’s going on, and even I can’t be bothered. I see folks struggling and I feel bad for them. I know what they want and why webmentions is supposed to precisely deliver that, but it just fails today for a host of reasons. It’s solvable, but remains unsolved. ↩︎

Micro.blog covers all of the features of EchoFeed that I’d want today. But I’m grateful it exists, because if I ever decide to write my own blogging engine (as I’ve often threatened), there’s a whole set of features I no longer need to build.

I’ve been living this life for some time (I’ve had a Mac mini as my main personal computer for over a decade) and agree with almost all of this. The only thing is, I don’t need any extra ports because the current Mac mini + Studio Display has me covered.

2024-04-26

At first, I was pretty disappointed only energy production has lowered carbon emissions in the US. But then I saw how much room we have to go de-commissioning coal and then reducing natural gas and I got a little hopeful. We need major investment in more efficient industry (and living).

April is a good month for “good enough”. Most years, including this one, April is when I celebrate Passover. During the seder, we sing an over 1000 year old song, Dayenu – “it would have been enough”.

This year “enough” has been on my mind. My parents are nearing retirement and I am nearing middle age. Both of those feel like milestones to think about “what is enough”.

I feel bombarded with messaging about “enough”– all the new crop of pop-financial advice is about “enough”. Die with Zero, Living Your Rich Life, and FIRE are all, to a degree, about understanding what is “enough” when it comes to money. My own experience, being fortunate enough to see my income and wealth grow over time, is it’s hard to feel “enough”. My mind knows that I can live with less fear, but my body still feels nervous, like ruin and catastrophe is always around the corner.

My two nervous systems have a different idea about what is enough.

I’ve continued to struggle with my weight and my body like I have all my life. For me, it’s not what I eat so much, but it’s about portion control. I am hungry– often. It’s hard to feel satisfied. I want to be entertained by my food and can’t make myself have a purely instrumental relationship with food.

My mind and my stomach and my body all have different ideas about what is “enough”

I let this blog post sit in almost this exact state for most of April. I sat on my blog redesign for almost 6 months before just releasing it as is for the same reason.

My energy level to write and my idealized version of this blog post (and blog) have different ideas about what is “enough”.

This month’s indieweb carnival is actually about “good enough”. But I don’t really have problem with the “good” part– I have problems with the “enough” part. If it’s enough, it’s always good. And my problem is really about allowing myself to recognize and feel when we’ve hit “good” so that I can say “enough”.

I deeply admire Cleo Abram’s optimism and storytelling talent.

2024-04-25

People who speak at large dinner events when someone else is on the mic are bad people.