DEV Community

Cover image for Sloan's Inbox: As a beginner, should I use AI as a tool and how?

Sloan's Inbox: As a beginner, should I use AI as a tool and how?

Howdy folks! Sloan, DEV Moderator and mascot, coming back at ya with another question submitted by a DEV community member. 🦥

For those unfamiliar with the series, this is another installment of Sloan's Inbox. You all send in your questions, I ask them on your behalf anonymously, and the community leaves comments to offer advice. Whether it's career development, office politics, industry trends, or improving technical skills, we cover all sorts of topics here. If you want to send in a question or talking point to be shared anonymously via Sloan, that'd be great; just scroll down to the bottom of the post for details on how.

Let's see what we have this week...

Today's question is:

I'm still a beginner dev and trying to learn the basics, but I'm already getting tempted to use AI to help me write code. On one hand, I feel like I should resist, but on the other, it feels like I should experiment with whatever tools are available to me. Does anyone have any guidance on how to approach this?

Share your thoughts and let's help a fellow DEV member out! Remember to keep kind and stay classy. 💚

Want to submit a question for discussion or ask for advice? Visit Sloan's Inbox! You can choose to remain anonymous.

Top comments (10)

montyharper profile image
Monty Harper

I've made it through Udacity's iOS Developer course, and they provide a "Udacity GPT" AI chat window in their online classroom. I used it a lot, and found it very helpful, sometimes... First of all, know that ChatGPT always wants to please. It will act as if it knows the answers, even when it doesn't. So take whatever it says with a grain of salt and verify with some other source. Having said that, here are some ways I've used it that were helpful:

  • "Tell me about ___": For general topics like MVVM it can give a very useful overview. You can even delve into more detail by asking about one of the bullet points. This is likely to be good information.
  • "Please explain the following error message": If the error includes codes or keywords you don't understand, ChatGPT will explain pretty well, along with some reasons the error might occur. You'll at least get a start on troubleshooting.
  • "Please find any errors in the following code" OR "Please explain what this code should do" OR "I'm trying to do x; why won't this code work?": These are a bit hit or miss, but I often try them when my code isn't doing what I thought it should, or when I get a run-time error. Sometimes ChatGPT can point out a simple mistake I overlooked. Sometimes it leads me on a wild goose chase. Sometimes re-thinking the question is helpful; "What's the best way to x?" might work better than "Why doesn't this do x?" I've learned over time how to pretty quickly know if I'm getting a helpful response or not.
  • "Write some code to do x": I don't use this often, but if I'm trying to solve a specific problem, especially if it's an aspect of the code I'm not focused on learning at the moment, or it's something I'm struggling to understand, this can be of help. For example once I was trying to make a Struct that would accept some JSON, and really not understanding the mis-match. I asked ChatGPT to write the struct, and that helped me see what I was missing. Also, be prepared to make your own corrections to the code. ChatGPT doesn't always get the details right.
  • "How can I accomplish x?": If you aren't sure how to approach a problem, a question like this can give you some options. For example, "I need my view to update when the time changes from day to night; how can I make that happen?" The more specific your question is, the more specific the answer will be.
  • Here's one I thought was non-obvious and surprisingly helpful: "I'm writing an app to do x. What are the ten most important features I should include?" Asking ChatGPT to brainstorm about anything can turn up ideas you wouldn't have thought of on your own.
jess profile image
Jess Lee

These are some seriously helpful prompts.

robindn profile image
Robin De Neef

Professional Software Engineer for 7 years here. This is the way you should use it IMO.

Don't rely blatantly on generated code. First of all, understand what is generated but use AI to get a better understanding. Use it to brainstorm and further your horizon. Generate different approaches, learn from their pros and cons and decide for yourself the best approach.

Critical thinking will be the differentiating factor between you and an AI code generator.

I just started on a new project trying to refactor and optimise an older codebase. The original authors have left so I feel like a junior again trying to understand the way they implemented it. Asking the questions you are asking on this code base has increased my progress a lot more compared to 5 years ago when I had a similar use case.

A thing I'm doing now to take it a bit further is to make a wiki and write a lot of notes along the way. I'm feeding these as a knowledge base to a GPT chatbot for colleagues but also for the business owners. It lowers the amount of queries we get along the way.

stefanmoore profile image
Stefan Moore

I'm a beginner and I'm not using AI because I need to go through the process of learning. There's nothing like finding that simple mistake somewhere and that code runs as intended.

web3underbelly profile image

For me there was nothing like finding out how to use a language's API Docs... At first I would go to sites like Dream in Code (I love DIC) lol, but when I foun JAVA's API docs I was in heaven! Our teacher had shown us the page in class but I had forgotten about it. Once I saw it's usefullness I never forgot again

theaccordance profile image
Joe Mainwaring • Edited

Generally speaking, you should use whatever tools you have at your disposal to complete your tasks in a time efficient and quality manner. However, as a beginner, I would recommend caution with using AI for a few key reasons:

  • Chances are, you will be prohibited from using AI tools during an interview, so you need to be able to pass those competency tests on your own.
  • AI tends to be multi-tenant, meaning multiple users share the same AI instance. This has caused some companies to have reservations about the use of AI, as their proprietary information could be accidentally leaked to other tenants (companies) on the instance.
nasheomirro profile image
Nashe Omirro • Edited

Personally I use them for learning but rarely for automation or quick snippets.

Given that they feed on content across the internet, the more basic/fundamental your questions are, the more rich and consistent the AI's answers will be. For example I've asked it for things like JWTs, common attacks and vulnerabilities, SSR and how it handles subsequent requests, and even asking the details on how content is delivered to the users from the moment they enter the URL.

I'd be cautious on using it to write code however, the first thing to worry about is if it actually wrote good code, again it depends on the prompt but if you don't understand what it spit out maybe don't use it until you do. I wouldn't even compare it to copying code from StackOverflow because in that case we could rely on the author's real-world knowledge and the community to tell us if its a good solution or not.

Also probably the main downside as a beginner is you don't really learn/practice code if you use it excessively, it's true that you could still understand and learn from the code it generates, but you weren't the one to come up with the solution, so that problem-solving muscle in your brain doesn't get a full work-out. I wouldn't say not to use it at all though, but maybe just sparingly.

With all that said, it seems you understand the risks in using it so I think you'd have a good sense on whether or not you're using it appropriately, so I say go for it kek

nasheomirro profile image
Nashe Omirro • Edited

Just a quick tip on questions though, probably avoid asking questions that are framework-related, maybe the big ones like react is fine but you should probably read their documentation instead. A lot of the problems has to do with API changes, changes in strategies/patterns, and a lack of content to feed on, which all lead to confusing and low-quality answers from the AI.

kaamkiya profile image
Kaamkiya • Edited

I recommend no. The best time for using AI in coding as a beginner is to come up with ideas to challenge yourself. It's not a great thing for debugging, because you won't learn to find your own errors. It's also not a very good thing for writing code, because you'll have no clue what it spit out and how to read/understand it.

@stefanmoore said something similar, although they are a beginner too, so check out their answer as well.

web3underbelly profile image

AI is a great tool for beginners if they can understand how to use it correctly. Some warnings for beginners:

  1. ChatGPT and other generative LLMs (Large Language Models) are not all-knowing! They are trained with a large amount of data and they call it generative as it generates "tokens" which are essentially words (to simplify my answer). They look at all the data that they have read and their answer to your question is created by predicting the next possible token and choosing the one with the to degree of probability. Although this is a great advance inthe way we see AI's funtionality, it sometimes, (often) leads to ansers that simply are not true. Example: If you ask it about a company it does not know about since it opened after the ai's trining cut-off date, it will still generate an answer. What you don't know is that the degree of probability that the tokens it generates are true may be 0.5-3%... It's basically just taking the name you gave it, figuring out what industry that company might be in and then just winging it and making up a story about the company.

But as for programming, it's a much more efficient machine since it has been trained on all the data from all the programming courses, Dev sites (like this one), textbooks... so aside from some small mistakes it makes (which can be avoide through some prompt engineering) it's a great tool. Here are some of the ways AI can help you... just for fun I had the AI give you the following response :)

AI can be instrumental in creating personalized programming courses, leveraging its capacity for customization and adaptability to cater to individual learning needs and styles. Here's how AI can design a programming course tailored to your requirements:

Initial Skill Assessment: AI starts by evaluating your current programming skills. This could involve a questionnaire, practical coding tasks, or problem-solving exercises. The assessment helps determine your proficiency level and identify specific areas where you need improvement or further learning.

**Customized Learning Path: **Based on your skill assessment, AI develops a personalized course outline. For beginners, this might include fundamental concepts like variables, loops, and data structures. For more experienced learners, the focus might shift to advanced topics like algorithm optimization, design patterns, or specific programming languages and frameworks.

**Interactive Coding Exercises: **AI can generate a range of coding exercises tailored to your learning stage. These exercises can adapt in complexity as you improve, ensuring you're always challenged but not overwhelmed.

Real-time Feedback and Debugging: While you code, AI can provide instant feedback. It can point out syntax errors, suggest optimizations, and offer tips to enhance your coding style. This immediate feedback is crucial for learning and correcting mistakes early.

Project-Based Learning: AI can suggest and guide you through hands-on projects relevant to your learning goals. For instance, if you're interested in web development, it might propose building a website using HTML, CSS, and JavaScript, providing step-by-step guidance and resources.

Adaptive Learning Pace: AI adjusts the course's pace based on your progress and understanding. If you master a concept quickly, it moves on to more challenging topics. If you struggle with a topic, it provides additional resources and exercises to reinforce learning.

Language and Framework Recommendations: Based on your interests and industry trends, AI can recommend programming languages and frameworks to learn. For example, if you're interested in data science, it might suggest Python and introduce libraries like Pandas and NumPy.

Integration with Real-World Tools: AI can incorporate lessons on using essential development tools and environments, such as Git for version control, various IDEs, and debugging tools.

Gamification and Motivation: To keep you engaged, AI can include gamification elements in the course, like earning badges for completing modules or building streaks for consistent daily practice.

Community and Peer Learning: AI might also connect you with online forums or coding communities where you can discuss concepts, share code, and get feedback from other learners.

Continuous Progress Tracking: AI monitors your progress, providing insights into your strengths and areas that need more focus. This continuous evaluation helps in tweaking the course content to best suit your evolving needs.

In summary, AI can create a highly effective and personalized programming course by continuously adapting to your learning style, progress, and interests. This approach ensures that the learning experience is efficient, engaging, and closely aligned with your personal or professional goals in programming.