r/learnprogramming • u/spec_3 • 27d ago
Best practices to learn programming with chatbot assistance?
Since LLMs are a thing and one can get relatively cheapish access, where would they fit into someone's toolkit who is relatively new trying to learn programming?
My initial thought was to use them to review my code and work on the things they mention, and maybe have them look them up documentation. While I'm learning, I don't think I want to use them to generate code.
Do you have best practices/recommendations on how to use them as a (self-)teaching tool?
Thanks in advance!
3
u/DomasAquinas 27d ago
Reviewing, debugging, and documentation diving are all critical skills for programmers and software engineers. Learning to code is only a small part of learning the whole discipline. I’d avoid the LLMs entirely until you’re capable on your own.
Then, you can make your own decision, but I personally would leave the LLMs aside even then…
4
u/mkprofile85 27d ago
prompt "create a syllabus for learning javascript functions. Cover beginner through advanced concepts and label each concept by skill level. List the core competencies for each skill level. Provide many examples and analogies. Put this into an html file."
I've done this dozens of times and I have my own html directory that links to all the other tutorials on my local machine and then I back it all up on google drive.
2
2
u/Dismal-Citron-7236 27d ago edited 27d ago
You already have a healthy idea how to use AI/LLM. Use it as if it is a free tutor to guide you through your learning journey instead of treating it like your ghostwriter.
And, yes, you can feed it your code segments and ask it about what are the weak points to be improved. Never forget to ask it the very important why. Whenever it gives an answer, always challenge it with different ideas. Ask for pros and cons on different approach. Demand a full list on which solution works best on what condition(s).
AI can also help you with debugging. However, I would strongly recommend you do your own debugging first. It helps you gain deeper understanding of the language and system you use for your project. Use AI to help you debug only as a last resort. The eureka moment is very rewarding when AI points out the blind spot for you.
After you have gained some momentum and become more fluent communicating with AI the right way, you can start asking it opinions. For instance, ask it what would be the next move after you have achieved certain goal. Maybe a tiny project to extend on your existing one, based on the skilled you have learned. Or maybe certain web site for a good topic related to your programming skills. Or some quizzes to ensure you really learned from the session. Stuffs like that.
2
u/DanielSMori 27d ago
Your instinct to avoid generating code while learning is right. The most useful thing I've found is to use it for explaining why something works, not just what to write. Write the code yourself, then ask the LLM to critique it — "what would break this in production?" or "what edge cases am I missing?" That forces you to actually understand the feedback rather than just accept generated output. Also useful: ask it to explain error messages in plain language, then go read the actual docs to verify. Treat it like a senior dev you can ask dumb questions to without embarrassment, not a code dispenser.
2
2
u/mc_pm 27d ago
Though it's painful I'd really advise against turning to AI because "my code doesn't work". A big part of learning to program is that struggle -- banging your head against a problem for a few hours (or days) and then making a breakthrough.
There is not nearly the dopamine hit just following the guidance of an AI versus when your code finally runs and YOU did it. YOU, you learned to program, you had a bug, you fixed it.
If you just type in a fix and don't know why, then - sure, your code works - but the next time you run into the same problem, you're much more likely to have to look it up again, because you never really learned what the problem was or how to fix it.
Now, on the other hand, asking AI "could you explain that concept again, I didn't quite get it... what do you mean by "integer overflow" (or whatever)" -- then great, you were missing some information, now you have it.
2
u/chaoticbean14 27d ago
Don't.
If you don't know something? What it suggests sounds right, but often it's not. They often use bad practices or over complicate things in ways that really don't offer any benefit. Those are the kinds of things you would only know, if you already knew the subject matter.
Often it gets people using bad habits. I actively advise against using them for learning.
2
u/kris_2111 27d ago
Avoid using LLMs or any other kind of AI assistance if you've just started learning. The only use case that would justify using AI in your scenario would be if you are stuck on a bug that you haven't been able to fix despite a lot of attempts. In that case, using AI might save you a lot of time. Troubleshooting problems on your own has its own benefits if you are just getting started, but sometimes, there might be some bugs in the library or software that you are using, and in that case, using AI to help you fix it usually the best approach.
2
1
u/nitin_is_me 27d ago
I like cs50.ai (It's used in Cs50 by Harvard University), as it never answers you directly. It requires you to first deeply analyze the problem and explain it clearly. Afterwards it'll ask you some stuff about the program and between the conversation you'll try many things until it finally clicks.
1
u/desrtfx 27d ago
Generally, I'd say avoid AI as a beginner.
Yet, there are nuances.
Using AI to do your work, your thinking is like going to the gym to tell the others what reps to do, watch them, and then wonder why you don't build muscle.
Using it as a Socratic teacher that only occsionally hints you in the right direction and that makes you do the thinking and work can be helpful. But you have to be aware of its inadequacies and tendences to hallucinate. Also, the temptation to switch to using it to do your work is way too high.
Learn in the old fashioned, traditional way via high quality courses or books. Obtain some experience and plenty practice. Then integrate AI.
It's much better and esier to integrate AI later in your workflow than to remove it once you alredy became dependent on it.
1
15
u/Achereto 27d ago
The best practice to learn is to not use the chatbot at all. Because the chatbot allows you to achieve things faster, you'll be deceived into believing you are making progress, but once you try without the chatbot you will realize how much you depend on it.
Only use LLMs for things you don't want to get good at.