‹ Takaisin Blogit-pääsivulle

Coding with AI?

· Blogi · In English · Mari Sinkkonen

Bit of a disclaimer to start with: I have used ChatGPT to make up bedtime stories with my kids, to help me understand why our dog barks at random things, for instant-pot recipes to try out, and I am sure there are endless ways to utilize AI. But with this new tech there are pros and cons, ways to misuse it, and questions of it becoming/being sexist, racist.. and these are topics I feel strongly about, but am not covering in this post. This is a scratch to the surface, not a deep analysis on AI.

In a world where technology keeps on evolving, we humans have endless opportunities to seek tools that streamline our ways of working. With AI models like ChatGPT and code-generation tools like GitHub Copilot the ways of working as a developer (and actually work in general) are evolving. I got curious to see how smoothly I could develop a working project paircoding with Copilot and ChatGPT. I have experience with JavaScript and React, so I have knowledge of the process. But for this experiment, I changed my “I gotta google this” and “lemme think, how did I do this the last time”-thoughts into just asking the ChatGPT a lot of questions.

Project overview

I wanted to make a quick webapp. Plain and simple, with a page that has a button. When you push the button, the page shows you a random.. something from an JSON array. Actually, this was my first Ahaa!-moment. For every hobby project I have made (or started, oh the pile of unfinished projects..), the first wall I seem to hit is the idea part. Usually you need some sort of data, and surely there are random data generators out there, but now I used GPT.

The owls are not what they seem..

I asked GPT for an array of 50 quotes from Twin Peaks. The fifth time the array had “A damn fine cup of coffee”-in it.. I understood that the poor AI gave me repetitive data, and doesnt have all the episodes memorized. So I asked it to “Give me 50 random facts about humans”. The array looked good and off we went into “how do I start a React project” and “Could you create a function that fetches data from..” adventure.

Copilot take the wheel

Copilot is a tool I am grown fond of. It helps out on repetitive work, and can make good suggestions as you type into you code editor. Confession: When I am feeling overwhelmed by a block of code I am trying to understand, I hit “//” and just see how it writes out comments about the function I am struggling to grasp. (Sometimes one just needs somebody else to “read out loud” and help you unstuck your brains.)
In my small project, Copilot was helping out on writing functions. But it also got a bit annoying when it offered an idea for a totally useless function, so I am not giving it much credit on this project.

Webpage with a button, yay!

So there was coding “blindfolded”, bugs and debugging with GPT. And after a while I got the basic webpage up and running, but it looked real plain. So I asked AI to generate some css (a gradient background and make it look nice) for my code. And that let me into the rabbithole of trying out even more and more obscure things. I ended up asking it to genereate some css  for the button so that it looks like a round button with catface with pointy ears. It failed. After some corrections and more fails, I discovered that GPT didn’t know that it couldn’t succeed in this. So no “catEaredButton” for me today.

Ta-daa!(and whoops)

The app got finished quick. The end result is a basic web page with a button (no ears, a bit sadge) and a quote. And this brings me to my Ahaa!-moment number whatever.
You see, in the beginning of this experiment, I was thinking about app with quotes. So there is a button for New Quote. But fairly early I changed my data into facts about humans. So I ended up coding a webapp that has a button that reads “New Quote” and as you push the button, it gives you New Fact about humans. And this mistake is all on me(que Taylor Swift – Anti-Hero). So actually, my project would’ve benefited from some project-managing, product designing  or actually thinking with my brain a bit.. did I just end up learning that in fact I am the weakest link?

screenshot with 2 pictures of the webapp and some code showing.

ps. For this blogpost, I asked Midjourney (Ai that generates pictures from word prompts) to give me a picture of a young girl who is imagining herself as an engineer. And a picture of a middle aged female software developer who is trying to figure out if AI is a good or a bad thing.

Leave a Reply

Your email address will not be published. Required fields are marked *