Intro
Hello, world! Welcome to another blog post for Anthony’s Techie Thoughts! If you’re new here, my name is Anthony and I’m studying programming to make a career change from mathematics teacher to a frontend web developer. In my blog posts, I reflect on my journey and share things I’m learning along the way. You can find me on GitHub, LinkedIn, Hashnode, DEV.to, and CodeNewbie.
In this blog post, I’ll offer a quick reflection on my progress this week and share some thoughts on how I used ChatGPT as a coding buddy.
Weekly Reflection
This past week has been productive for me. This is mostly because I’m currently on a mid-term break from work and I have extra time I can dedicate to my studies. Which I am thoroughly enjoying. Here’s a quick list of my accomplishments this week:
-
Completed the solo project for Module 6 of Scrimba’s Frontend Career Path
- GitHub Link: https://github.com/ananfito/learning-journal
- Live link: https://ananfito.github.io/learning-journal/
Started Module 7 of Scrimba’s Frontend Career Path
-
Published a blog post on how I used a Python script to automate a part of my teaching job
- This might seem small, but I had written this post weeks ago and just never published it so I’m glad I got it out there.
I played around with using ChatGPT as a coding buddy and it helped me figure out a problem I was having with the code for my Learning Journal project (more thoughts on that below)
Using ChatGPT as a ‘coding buddy’
On a whim, I decided to make use of ChatGPT as a ‘coding buddy’ by asking it questions when I got stuck or needed a sounding board. As a self-taught dev, this is one of the things I’ve struggled with the most. Sometimes I wish I could just tap someone on the shoulder and say, “Hey, what do I need to make this work?” Or “This is what I’m thinking for this problem. Is that the right approach?” However, this isn’t always an easy option so this week I tried something different: I asked ChatGPT.
For example, I was working on a function earlier this week for my Learning Journal project where I needed it to return the first three elements of an array, but I couldn’t figure out what method I needed to use. Initially, I thought I could use the .filter()
method, but further down you’ll see how ChatGPT corrected me on that idea. First I asked it, “How do I write a function in JavaScript to return the first 3 items in an array?” Here is the response I received:
When I asked my ‘coding buddy’ this question the first thing it mentions is the .slice()
method and I was like, “Oh! duh! Of course, why didn’t I think of that?” As requested, it did write an entire function for returning the first 3 elements of an array, but I didn’t need the entire function. I just needed that little hint to use .slice()
instead of .filter()
. When I asked it if I could use the .filter()
method it explained why it wasn’t possible and why I should use the .slice()
method instead:
(NOTE: While writing this blog post, I noticed that my initial question here has a typo in the first part of the question. I’m not sure why my brain decided to write “Is it possible to write return …” but ChatGPT seems to have correctly interpreted this to mean “Is it possible to write a function that returns the first …” This is interesting, but could also just be a random occurrence. In the big picture, I’m not sure if ChatGPT is always good at interpreting human miscommunication.)
This second explanation helped me realize the error in my initial approach and redirect toward a solution that worked. Of course, this is information could have obtained from someone in a Discord community, a forum, or even through reading through webpages and documentation, but those come with a longer time commitment. Here, in a few minutes, I got some advice on the direction I needed to go as well as some examples to reference. In fact, in this case, I just needed a nudge in the right direction. As a self-taught dev, this is particularly useful because I can’t just lean over to the next cubicle and ask a coworker quick questions like these. But, for now, I can ask ChatGPT and it (might) give me an answer to ‘nudge’ me in the right direction.
Closing thoughts on ChatGPT
As impressive as it ChatGPT is (and other AI software like it), we’ve already seen examples of where it will hallucinate and present incorrect information. With that in mind, I do not think it is a good idea to ask it to do a specific task for you.
For example, I’m sure I could have given it more information and context about how and why I needed a function to return the first three elements of an array, but that would have defeated the purpose of studying. To me, that is the equivalent of having someone else do your work for you. Which doesn’t help you become a better developer.
I tell my students, “the person who holds the pencil learns the math.” Meaning, the person who is sitting there going through the steps (and perhaps struggling a bit) to solve the problem is the one who will learn and remember it. In this case, the person who types on the keyboard learns to code.
All that said, I do think this could become another tool within our developer toolbox. We have a plethora of resources already at our deposal: freeCodeCamp, Stackoverflow, W3 Schools, YouTube, Discord Communities, and more! This is an addition to that and perhaps it might fill in some gaps that the others don’t provide or don’t meet the needs of the learner. I think this is how I’ll use it moving forward (and continue to use it as long as it proves useful). It’s one tool in a vast toolbox of tools to help me learn how to code and get better at achieving my goal of making a career switch.
Thanks for reading
Thanks so much for reading this post. Have you used ChatGPT in your studies? If so, how have you been using it? Has it been helpful? Leave your thoughts in the comments below. Hearing your thoughts makes this more of a conversation and helps everyone learn.
Top comments (0)