Is it a good idea to use Copilot or other AI code completion tools as a beginner to front end dev?

A bit of a more open-ended question. I've started to learn front end development. As a beginner, would it be harmful to my learning and development to use AI code completion tools like GitHub copilot? I understand that copying and pasting code without understanding it is a bad idea, how should I use AI tools as a beginner, or should I avoid them?
8 Replies
Joao
Joao•7mo ago
You've answered your own question: copying code without understanding is a bad idea. That includes code generated by AI. I've found that it's mostly useful for repetitive tasks but struggles with most things, in the sense that I always have to review the code and adjust it anyway. It helps once you use it for things you already know how to do, not so much for learning. It's also designed to assist, not teach. As beginners we write a lot of stuff from scratch and that's where you will see very early rewards with this, but not only you won't learn nearly as much, you will also notice that later on most of your time is spend reading code instead of writing it. To be completely and brutally honest with you, I have the feeling most beginners asking this question are simply looking for someone to tell them that it's ok... everyone has an opinion, and mine is to avoid it at first and use sparingly later because is nothing but a tool, not a know it all deity.
Jochem
Jochem•7mo ago
To add to the list of people saying "bad idea", yeah, fully agree. I've been programming for a long time (my first JavaScript book is from the 90s), and even then chatgpt/copilot can come up with code that I might think I understand but is subtly wrong. Debugging is 10x harder than writing code, so instead of taking a shortcut you're actually making your life a lot harder. I'd honestly recommend not touching AI tools until you can comfortably write a medium sized project without following tutorials (googling for info is fine, everyone does it, even the most senior seniors)
Kasenom
Kasenom•7mo ago
sorry for the late reply Joao, thank you for your answer! Yes that makes sense, it seems a lot of people online are pushing ai tools all the time. That's why I was unsure if I should jump on the boat rn or wait. But I agree with you, it makes more sense for me as a beginner to wait Thanks for the response Jochem I appreciate it! I'll follow your advice
Joao
Joao•7mo ago
If you have questions, this is a great place to ask for help and advice. You'll learn a lot only by seeing different people taking different approaches to the same problem. Just remember to ask good questions https://discord.com/channels/436251713830125568/1022288836715356180 (describe the expected result, error messagse, provide code, perhaps some screenshot if you think it's necessary, etc). Asking good questions is absolutely critical. Not only it will make you re-think about the problem (a lot of times you'll answer your own question as you try to explain it), but it'll also allow you to better understand the problem itself and help others understand it and thus give you a better chance of helping you. Incidentally, understanding the problem better will help enter better queries in a search engine which is also a very useful skill to have. And, with time, also to AI code assistants. As you know, these two tools (search engines and code assistants) are only as good as the initial query. So you see, everything is related. Ultimately though you should focus on reading the documentation from whatever library or framework you're using. More often than not, the answer will be right there. One more thing, sorry 😄 Try to look at it this way: anyone can take chatGPT and start building a website or whatever. But someone who already knows how to code a website also can take chatGPT, so ignoring all other factors, the one who has the knowledge to ask for specific questions will come on top. So don't think code assistants will be replacing anyone any time soon.
Kasenom
Kasenom•7mo ago
that's a good way to put it, thank you again for your responses :) I'll try my best to answer good questions, and I wont shy away from reading documentation
Joao
Joao•7mo ago
Best of luck!
DanKaplanSES
DanKaplanSES•7mo ago
I think it's only a bad idea if you move on. If you don't understand it and use it to understand it, maybe it can be useful? But I'm only playing the devils advocate by saying that: every time I've asked ChatGPT to help me with some code, it's taken more time to figure out what I did wrong than it would to write it from scratch.
Joao
Joao•7mo ago
Sure, after all, it's not an evil entity that wants to trick you or anything. It's just a tool, and like any other tool you must know when and how to use it. The biggest downside is that you have no guarantees that what it outputs is correct. Even the developers of ChatGPT themselves have said so, that it's designed to produce text no matter what it comes up with, with great confidence. In contrast, with code from random strangers on the internet, there is another human with a specific use case that tested the code. This already gives you a much better guarantee, even if the code itself doesn't adjust fully to whatever your use case is at the moment, and it has a context that helps understanding why something was written in such a way. ChatGPT's responses will be only as good as your understanding and ability to express the problem. It's like watching tutorials after tutorials and understanding everything, until you are left to code by yourself and realize you didn't actually learn anything.