DEV Community

Cover image for Can we replace junior developers with ChatGPT?
Alex Hyett
Alex Hyett

Posted on • Originally published at alexhyett.com

Can we replace junior developers with ChatGPT?

ChatGPT-4 got released this week and a whole host of improvements come with it. The word limit on ChatGPT has now increased from 3,000 words to 25,000 and it can now handle photos and videos.

I tried ChatGPT out in January and wasn’t overly impressed with the results.

When I asked it to write Python code to scrape a website it failed to write code that ran the first time. After several attempts, I managed to get it to fix its own code but it still didn’t give the correct result.

Can GPT-4 do any better?

This is the code that ChatGPT-4 generated for my web scraping example using the same input as before:

import requests
from bs4 import BeautifulSoup

# Send a GET request to the URL
url = "https://books.toscrape.com/catalogue/category/books/self-help_23/index.html"
response = requests.get(url)

# Parse the HTML content using BeautifulSoup
soup = BeautifulSoup(response.content, 'html.parser')

# Find all the book titles and their ratings
book_titles = soup.find_all('h3')
book_ratings = soup.find_all('p', class_='star-rating')

# Store the book titles and ratings in a list of tuples
books = []
for i in range(len(book_titles)):
    title = book_titles[i].find('a')['title']
    rating = book_ratings[i]['class'][1]
    books.append((title, rating))

# Sort the list of books by rating (highest to lowest)
books.sort(key=lambda x: x[1], reverse=True)

# Print the top 5 Self Help books to read
print("Top 5 Self Help books to read:")
for i in range(5):
    print(f"{i+1}. {books[i][0]} (rating: {books[i][1]})")
Enter fullscreen mode Exit fullscreen mode

This code threw an error the first time I ran it, however, this is because the URL that they are using no longer exists. After a quick check on the website, I found the Self Help URL has changed slightly:

https://books.toscrape.com/catalogue/category/books/self-help_41/index.html
Enter fullscreen mode Exit fullscreen mode

After updating the URL and running the program I get the following output:

1. Overload: How to Unplug, Unwind, and Unleash Yourself from the Pressure of Stress (rating: Three)
2. You Are a Badass: How to Stop Doubting Your Greatness and Start Living an Awesome Life (rating: Three)
3. Online Marketing for Busy Authors: A Step-By-Step Guide (rating: One)
4. How to Be Miserable: 40 Strategies You Already Use (rating: One)
5. How to Stop Worrying and Start Living (rating: Five)
Enter fullscreen mode Exit fullscreen mode

ChatGPT has clearly improved compared to its previous version however it has outlined a glaring issue.

The fact that ChatGPT got the URL wrong means it isn’t looking at the website in real-time. It only has knowledge of the data it was fed during the training period.

I asked ChatGPT “Does ChatGPT have access to the internet or is it using a cached copy of data?”

ChatGPT does not have direct access to the internet. It was trained on a large dataset of text from the internet, but once the training is complete, it operates as a standalone model without access to new data. So, it's not using a cached copy of data either. Instead, it uses the knowledge it has acquired during training to generate responses to user inputs.

This isn’t too much of a surprise, you don’t really want an evolving AI to have access to the internet however it does limit its capabilities to past events. At some point however they may start feeding ChatGPT up-to-date information and I assume it is also learning all the time from people using it as well.

ChatGPT has shown that with the correct inputs, it is already very capable of producing working code. Although at the moment it doesn’t always adhere to best practices.

Can ChatGPT replace junior developers?

Junior developers need to be told what to build, need their code reviewed by more senior developers and don’t always follow best practices.

When starting a new job, developers lack sufficient domain knowledge to be able to solve business problems but are more than capable of adding code to a project.

ChatGPT is currently equivalent to a junior developer starting on a new project. Except it also has knowledge of a wide variety of programming languages and can recite documentation from memory.

I asked ChatGPT to create an AWS lambda function in C# for an Amazon Alexa skill. It was able to create the boilerplate code for me and it looks correct.

I then asked it to change the code so that it would call the ChatGPT API and it successfully updated the code to do that as well.

It was missing some best practices such as exception handling and using blocks, although when prompted it managed to add them as well!

What is interesting though is that the code is completely rewritten every time. It doesn’t just add to the previous example and in some cases, the new version is missing things that the previous version had.

Just for fun I even got it to write the same code in JavaScript and Python which it managed with ease. Then I got it to write the Terraform code to add it to AWS!

If I was a junior developer I would be quite worried right now, you have just been replaced.

If this is where we are at version 4 it is scary to think what it is going to be like when ChatGPT is on version 10 or more.

Finally, I asked ChatGPT: “What is the future of software engineering going to be like if all of the junior software developers are replaced by ChatGPT?”

It is highly unlikely that all junior software developers would be replaced by ChatGPT, as there will always be a need for human expertise and creativity in software engineering. However, assuming that ChatGPT did replace a significant portion of junior software developers, the future of software engineering could look quite different.

One possibility is that the role of software engineers would shift from writing code to working more closely with AI language models like ChatGPT to design and test software systems. Software engineers could use AI to automate many aspects of software development, such as testing, debugging, and optimization, which could lead to faster development cycles and more efficient software systems.

Another possibility is that the increased use of AI in software engineering could lead to greater standardization and less variability in the software development process. This could result in more consistent and reliable software systems, but it could also limit the ability of developers to create unique and innovative solutions.

Overall, the future of software engineering is likely to involve a mix of human and AI expertise, with each bringing its own unique strengths and capabilities to the development process.

At least ChatGPT doesn’t think it is going to replace junior developers anytime soon. Although that’s what the robots want us to think.

What can you do as a junior developer?

If your main benefit to society is how well you can write code then I am afraid your days are numbered.

In a few more years it will be AI writing the majority of the code for our applications. With prompting, the AI was able to write code that adheres to best practices and I am sure in a few versions’ time it won’t even need prompting.

We used to laugh that a developer’s job was copying and pasting solutions (from StackOverflow) but it seems we are getting closer to that reality.

It doesn’t seem much of a stretch to have ChatGPT embedded into IDEs and generate whole projects from a written specification.

It will then just be up to senior developers to code review the output and have ChatGPT fix the code in real-time based on the feedback.

If we acknowledge that senior developers are necessary to write specifications and review code, it follows that there must be a continuous supply of junior developers being trained to eventually become senior developers. However, the job is going to look very different to what junior developers are doing now.

As a junior developer, I suggest focusing less on writing better code and prioritising these aspects instead:

  • Understanding best practices, such as exception handling and design patterns.
  • Software architecture. Understand how large-scale systems are built.
  • Domain Knowledge. Build up in-depth knowledge of how your industry works and what problems it faces.

The future of software development is going to be more focused on problem-solving and using AI to help, rather than writing code.

❤️ Picks of the Week

📝 Article - The Most Powerful Decision Making Razors. You have probably heard of Occam's Razor, whereby the simplest explanation is usually the correct one. There are actually many different "razors" that can help make better decisions.

👨‍💻 Latest from me

I have been thinking a lot lately about the direction I want to take with my YouTube channel and writing. In this new AI-driven world, the role of junior developers is changing but the foundational knowledge of building good software doesn't.

My goal for my channel going forward is to help junior developers gain the knowledge that is going to serve them well in their careers. So there are going to be more videos on me explaining complex engineering topics as well as advice for junior developers working their way up the career ladder.

I believe that the nuances of individual programming languages is going to become less important over time. It is more important to understand what you are trying to build and how everything fits together rather than whether you write it in Python or Javascript.

🎬 YouTube - Monolithic vs Microservice Architecture: Which Should You Use? On that note, my latest video is on monolithic vs microservice architecture and which one you should use for your next project.

💬 Quote of the Week

It is much more important to work on the right thing than it is to work many hours. Most people waste most of their time on stuff that doesn’t matter.

From How To Be Successful by Sam Altman. Resurfaced with Readwise.


This post is from my weekly newsletter The Curious Engineer where I share my insights as an engineer turned entrepreneur and the lessons I am learning along the way.

Top comments (9)

Collapse
 
ec_codes profile image
Etienne

Hey Alex, thanks for writing this. It was a great read!

As someone who's still junior in this industry, I've had to change my approach to growth because of the emergence of AI. I don't think we'll ever be able to compete with the breadth of knowledge that AI has. But instead I think we should grow in our depth of knowledge. Here are some of the things that I've been doing:

  1. Focusing on my fundamentals
  2. Working on my soft skills
  3. Improving domain knowledge

We can't deny the emergence of AI. Instead of being fearful of it replacing us, we just have to adapt to it. We need to leverage it as a tool to improve our knowledge, which is what I've been doing with ChatGPT :)

Collapse
 
developerdoran profile image
Jake Doran

Developers will never be replaced by AI, unless of course you are looking for quick prototyping or fast go to market. Generally people are hired on potential and cultural fit and an AI fulfils neither of these. AI is (currently) reliant on the instructions you give it and until Jarvis becomes a reality it has no embodiment to speak of.

Juniors on the other hand aren't just there to be dictated to. They can question the status quo in order to better process, affirm product decision and lead to team growth. They offer different perspectives which will grow and develop as they gain experience.

AI is merely a tool to speed up development and assist with learning. After all if you put garbage in you get garbage out!

Collapse
 
alexhyettdev profile image
Alex Hyett

I wouldn’t say never. AI is advancing at a rapid pace. It won’t be long before companies start taking advantage. If developers start being 10x more productive then some companies will see that as an opportunity to do more with less staff. AI still has a long way to go but it is best not to underestimate what it will be able to do.

Collapse
 
wiseai profile image
Mahmoud Harmouch

You should try coding in Rust, mate! It's like putting on Iron Man's suit; There's no way a thousand GPTs combined could generate a working Rust application.

Collapse
 
alexhyettdev profile image
Alex Hyett

I definitely need to get round to trying Rust!

Collapse
 
nsengupta profile image
Nirmalya Sengupta • Edited

Great article.

However, instead of focusing on today's junior developers, the focus should be on tomorrow's senior developers, if one argues. The juniors become seniors, over time. If the current junior becomes well-skilled in what her/his senior does today, where will current seniors be in the upcoming years?

A point to ponder, no? :-P

Collapse
 
glisa060 profile image
Glisa060

I signed up just to write this comment. You have my attention. Although I disagree with you. First of all ChatGPT is a search engine, nothing more. It searches the web looking for answers that other PEOPLE wrote. I don't consider ChatGPT an AI. It uses machine learning to index the web and optimize search. It's a search engine on steroids. The wealth of knowledge it can access is made by humans. My last point is that it can give you an answer to your question but it doesn't validate the answer for you. It's just gives you the answers somebody wrote out there. Anybody can write anything on the internet. It doesn't think for itself. I think uneducated Youtubers and the like are blowing this out of proportion and people fail to see ChatGPT for what it is, a search engine. No need for drama and for people to think that they will lose their jobs. I rest my case.

Collapse
 
alexhyettdev profile image
Alex Hyett

This was true for GPT 3 and 3.5 but not for GPT-4 which is capable of reasoning and not just regurgitating facts learnt from the internet. There are a few projects like AutoGPT which can also run code and provide feedback on itself.

Collapse
 
glisa060 profile image
Glisa060

Again it depends on what you consider reasoning? If I run a unit test and it passes or fails does that falls under reasoning? It's tricky stuff. Humans don't need programming. Learning is not programming. Clever engineers can make it seem like it's reasoning but it's testing with mock plus some self governing code. I don't believe the hype. This is for public consumption. Like a magic trick, all show. If you believe in it I won't try to convince you otherwise. It's just a bit much to talk about it as AI that thinks for itself. They built validation to spin the story. People where getting wrong answers a lot and it started a bad rep. It's damage control not reasoning.