I feel like I want to start creating some posts related around how I, as a software engineer, personally use generative AI tools. I think they are a huge boon for increasing productivity, exploring new ideas, and even learning new things
Reading Reddit, Hacker News, and various other forums, there’s a lot of anxiety among software engineers about how AI is going to steal our jobs. It’s not without merit:
- Mark Zuckerberg says that Meta hopes to have AI do the work of mid-level engineers later this year.
- OpenAI is working on a system that can carry out tasks and thinks like a level 6 engineer (ah ha, the joke is on them — we mostly go to meetings, write lots of documentation, and review pull requests)
- Google says 25% of new code contributed to their repositories is written by AI.
A recent blog post by Dustin Ewers adds some needed sanity to the discussion. In a post titled, “Ignore the Grifters – AI Isn’t Going to Kill the Software Industry“, he argues that:
He argues that we should ignore the grifters, AI
I feel like half of my social media feed is composed of AI grifters saying software developers are not going to make it. Combine that sentiment with some economic headwinds and it’s easy to feel like we’re all screwed. I think that’s bullshit. The best days of our industry lie ahead.
It’s highly unlikely that software developers are going away any time soon. The job is definitely going to change, but I think there are going to be even more opportunities for software developers to make a comfortable living making cool stuff.
I am inclined to agree. Hey, I will drink this Kool-Aid!
—
Well, let’s get to the real reason I’m making this post. I posted about my 2024 reading list and shared all the books I had read during the year. Try to compile that list and add links by hand would be a huge pain. There has to be an easier way. (Cue super hero music)
There is!
If you go to my GoodReads “read” list, it looks like this. And it keeps going. It’s a lot of data.
If we open up the browser console, we can see that it’s just a good old fashioned HTML table.
So, using an AI tool like ChatGPT or Claude, how do you get this data in a manageable way? One area that I’ve personally seen people struggle with is how to write a prompt in a way that helps them. You need to provide context. You say:
- Describe the problem: “I want to output a list of books from an HTML table into a JSON object using a JavaScript function that I can paste into the browser console.”
- Provide some example date: “Here is the table’s head with names for each column: [paste block of code]. Oh! Here is also an example row of data: [paste block of code]”
- Provide an example of the output: “Can you create a JSON object in the following shape?”
Using Claude as an example, here is what that looks like and you can also see the generated output:
Moment of truth — does it work? Let’s paste it into the browser console and see the result:
Yes! Victory! One problem though. I did not read 60 books in 2024. Oh, no. We are pulling all books visible from the page. This isn’t a problem. We can fix it by simply asking a followup question: “Can we modify the function so that it only returns books where date read is in the year 2024?”
Claude modifies the function to add a filter for 2024. If we paste that into the browser console, we now get the correct number of hooks: 30!
There is still another thing to do. I want to make this into a nice, unordered list that I can just add into my blog post. Again, we follow the steps outlined above:
- Can you create an unordered HTML list that shows links to each book? Please add a link around the title, but keep the author name unlinked.
- Here is my JSON object: [paste block of code]
- I essentially want a list that looks like this: <li><a href=”[booklink”>Book title</a> by Author</li>
Hot diggity! It works. It generates a block of code that I can just paste into my blog’s text editor. Pretty neat. It took a total of 5 minutes. (Hey, writing this post took a lot longer than that.)
Anyway, this has been a production of “How I use AI”. Stay tuned for more exciting updates, coming to a blog near you.