r/ChatGPTCoding • u/AsianDoraOfficial • Apr 22 '24
Discussion I'm still learning how to code. Should I learn how to use AI for coding now or later?
Title. I still want to learn the fundamentals to not be dependent on AI, but should I learn how to use AI as a tool for coding while learning how to code myself? Or later after I'm proficient?
I think it mainly depends on how AI is even used as a tool for coding (which I don't know). But pls lemme know your thoughts and advice :)
EDIT:
I think I should clarify: I meant learn how to prompt AI "on the side" as I learn programming. For example, I spend some time learning language X and little bit of time learning how to prompt the AI the right way in order for it to generate the code I want.
7
u/SicilyMalta Apr 22 '24
Learn the basics. If you love to code, then learn to code.
7
u/LaughingLaura0 Apr 22 '24
Learning both simultaneously can help you develop a deeper understanding of both coding and AI, but it ultimately depends on your learning style and goals.
14
u/Just-Hedgehog-Days Apr 22 '24
You should not be using it generate code. Code generation today REQUIRES that you understand the output, because it's not 100%, and trying to build a machine with a bunch of parts milled to 90% expected tolerances won't work. You have to know how to file down the widgets or send them back.
Things you absolutely should use LLMs for when learning to program
1
u/dogscatsnscience Apr 23 '24
It's not possible to use AI (LLM's) to generate code if you don't understand how to code. You'll have no way of knowing when you have gotten bad results, and trying to fix them will take too long or not be possible.
But LLM's are incredibly helpful for super-charging your learning. The challenging part is knowing when you need to research something independently, and when you can use the LLM to teach you.
If at any time you can't figure out how to solve a problem, it's important to recognize that you may have to go back and find good study resources. Relying entirely on the LLM to learn and code will box you in too much, and you will probably get stuck with a very junior understanding.
Knowing what I do now, I would start using the LLM and doing tutorials side-by-side right away. LLM's are excellent teachers, BUT you have to learn enough to know when they are giving you bad information.
3
u/Stock_Complaint4723 Apr 22 '24
Do both. Learn to manage between the two approaches
3
u/Cautious_Cry3928 Apr 23 '24
Keep learning to code, but also learn to use AI in your workflow. We're coming upon the era that Natural Language Programming has been made possible. If you know the fundamentals behind code, you can prompt AI in plain English to write code for you.
Do NOT get AI to generate all of the code for you unless you're prompting it step by step. For example you should not tell chatGPT "Write a program that does XYZ" you should carefully prompt it with instructions like,
"I want you to write an [LANGUAGE NAME] script using the namespace "XYZ". In this script I would like you to write a for each loop that iterates through five names (Bobby, Joey, Lisa, Cory, Stacy), and prints each name to the console."
You need to walk it through every step to get your desired code, or GPT will loosely generate code that requires further editing or refining. This way you are actually programming just in Natural Language. This probably isn't the best example, but it should convey the gist of it.
5
u/kumingaaccount Apr 22 '24
I wouldn't touch chatGpt for the first year of coding. There are some great youtube series and courses online that hand hold you enough already.
Plus even if you use chat gpt at that point you would have to understand the code it prints and you simply wouldn't. You also wouldn't know what questions to ask to begin with besides pasting the prompt and keep playing guessing games with whatever it spits out until and IF it works. And if you are doing that, I simply can't think of a bigger waste of time. Yes doing this guess and reguess method MIGHT work but in terms of efficiency, you are better off doing a quality youtube/course.
2
u/AI_is_the_rake Apr 23 '24 edited Apr 23 '24
Should you learn prompt engineering for producing code? There’s no engineering needed. If you’re working on a specific project give the AI a bit of the surrounding code for context and just ask your question. Expect AI to produce no more than small functions that follow the single responsibility principle. The only prompt “trick” worth considering is to ask the AI to “output a statement that rewrites the user’s query in your own words followed by a statement that outputs the problem that will actually give the user what they’re wanting instead of what they’re asking for, then solve the real problem”
Besides that, use AI for learning, not for coding. If you have a paid subscription, when you read a book or blog and don't understand, copy the whole page for context and start asking questions.
I like ChatGPT Pro. You can ask it to check 5 internet sources to give it the context it needs for accurate information. It's like having a conversation with a book. This makes learning more enjoyable and interactive.
If you don't get code, have the AI explain it. I'm an experienced developer and used this approach last night. I made the AI explain the code it generated for me. Be careful with hallucinations, though. What I needed was terminal commands and usually, —help works best. Sometimes, I copy and paste the —help output into chat because the interaction is more enjoyable.
2
u/__ChatGPT__ Dec 19 '24
Using AI to code is definitely a learned skill. You should start as soon as possible and it will also accelerate your learning. AI is an accelerator right now, and it allows you to hit the ground running with most new projects. You do have to be careful to understand the code being written though. If you don't then when you INEVITABLY need to debug an issue, you may get stuck. Of course you can always have the AI walk you through the code to understand it, but it's better for you and your learning if you just get used to doing this process with each change/addition to your codebase.
I have written several blog posts on this issue of learning with AI and how to use it more effectively. I'd love to know if you find them helpful or if I should cover any other topics that may not be mentioned.
1
u/BobFellatio Apr 22 '24
Im gonna go against the current and recommend start using it right away, but only if you use it as support with the aim of learning. Meaning: Try to think for yourself first, and when you use it, tell it to explain how the code it gave you works (if you dont understand it yourself). Combine this with Googling and reading on stack overflow.
Its a really nice tool to help you get unstuck and keep you motivated by being able to do alot of things. But as mentioned, its only good if you use it to learn.
1
u/scottix Apr 22 '24
It's like using the calculator when your learning basic arithmetic. You are not going to learn anything, if your just going to cheat. With that said, once you have mastered the concepts, then you can use it to either speed up your programming or learn new tactics. I always told people, treat it as like a friend who knows a lot but can't always trust.
1
u/Thinklikeachef Apr 23 '24
My approach is to get a well respected text book. Then use the AI to help you understand. Treat it as a private tutor, who won't do the work for you, but help if you are stuck.
1
u/MrDevGuyMcCoder Apr 23 '24
Later for any core logic, but do use it to help you write test cases on the code you crafted. And feel free to ask it for clarification on your code / check for any optimization, but only after initially written and you understand the process
1
u/gybemeister Apr 23 '24
There's nothing stopping you from using AI and learning to code at the same time. If you rely only on AI to code it would be like wanting to learn a language using Google Translate. It helps but you will miss a lot of the subtleties and the structure behind the language.
I understand the posts about not using AI to code if you can't code but coding today relies heavily on AI and it will only grow; the cat is out of the bag. I suspect we are entering a new era in this profession and you surely want to be up to speed on the tools.
1
u/[deleted] Apr 23 '24
I started using it right away and it helped me learn what code was incorrect/suboptimal pretty quickly. It had days where it spat out almost perfect methods and days where I could see it was incorrect.
1
u/[deleted] Apr 23 '24
I used ChatGPT to help me learn an entirely new tech stack and it was absolutely the coolest thing. You can ask it questions without fear which I think made me even more excited to learn! I would never ask it to write a full program, but little snippets will be suggested that I will sometimes use in certain circumstances, but really it’s only syntax based questions that it can help with. I have also gotten help with errors as well. It really was helpful in so many areas for me and I think it has helped me grow a lot.
1
u/FosterKittenPurrs Apr 23 '24
If you're just learning to program, there is no useful prompt learning here. You could just copy paste the textbook exercise to e.g. ChatGPT and it will just generate the full code for you.
Learning how to prompt will be more relevant once you have a program with thousands of lines of code, spanning across several files, as then you won't be able to just tell it "add X functionality" and that's that (though by the time you learn enough programming to get here, it may just be able to do that, so any prompt techniques you will have learned early on will be useless anyway)
Use it like a teacher, ask it anything you would a teacher or TA, if you thought that person had infinite time and patience.
1
u/surim0n Apr 23 '24
I have a community of people tinkering with AI for coding purposes. I 100% believe you should learn coding with AI now. Yes, learn the basics of the language as you go as well but ignoring it won't get you places. I may get downvoted - but Jensen (CEO of Nvidia) himself has said learning natural language is more important.
Take what he said as you will.
1
u/TackleInfinite1728 Apr 26 '24
use copilots to write tests
1
u/an732001 Jun 26 '24
You can try something like Athens: https://www.tryathens.com/
1
u/violet_zamboni Apr 22 '24
You really should find the upper limit of what you can handle BEFORE you even touch generative code.
That means the most complicated algorithms, the most layers of technology and tiers, the most difficult to deploy, the craziest library integrations. Learn TDD. Because you will need all of those to make generated code work!
I believe in the future where more code is generated, the lower performing programmers are going to be a lot more replaceable. Debugging generated code or figuring out exactly how to constrain a request are going to be the big skills in demand.
1
u/[deleted] Apr 22 '24
[removed] — view removed comment