How Would I Study to Code with ChatGPT if I Needed to Begin Once more

Coding has been part of my life since I used to be 10. From modifying HTML & CSS for my Friendster profile in the course of the easy web days to exploring SQL injections for the fun, constructing a three-legged robotic for enjoyable, and currently diving into Python coding, my coding journey has been numerous and enjoyable!

Right here’s what I’ve discovered from numerous programming approaches.

The best way I be taught coding is at all times comparable; As folks say, principally it’s simply copy-pasting. 😅

On the subject of constructing one thing within the coding world, right here’s a breakdown of my technique:

  1. Select the Proper Framework or Library
  2. Study from Previous Initiatives
  3. Break It Down into Steps
    Slice your undertaking into actionable merchandise steps, making growth much less overwhelming.
  4. Google Every Chunk
    For each step, seek the advice of Google/Bing/DuckDuckGo/any search engine you like for insights, steerage, and potential options.
  5. Begin Coding
    Attempt to implement every step systematically.

Nevertheless, even probably the most well-thought-out code can encounter bugs. Right here’s my technique for troubleshooting:

1. Verify Framework Documentation: ALWAYS learn the docs!

2. Google and Stack Overflow Search: search on Google and Stack Overflow. Instance key phrase could be:

web site:stackoverflow.com [coding language] [library] error [error message]

web site:stackoverflow.com python error ImportError: pandas module not discovered

– Stack Overflow Options: If the difficulty is already on Stack Overflow, I search for probably the most upvoted feedback and options, usually discovering a fast and dependable reply.
– Belief My Instinct: When Stack Overflow doesn’t have the reply, I belief my instinct to seek for reliable sources on Google; GeeksForGeeks, Kaggle, W3School, and In direction of Knowledge Science for DS stuff 😉

3. Copy-Paste the Code Answer

4. Confirm and Check: The ultimate step contains checking the modified code completely and testing it to make sure it runs as meant.

And Voila you simply resolve the bug!

Photograph by Stephen Hocking on Unsplash

Isn’t it stunning?

However in actuality, are we nonetheless doing this?!

Recently, I’ve observed a shift in how new coders are tackling coding. I’ve been educating easy methods to code professionally for about three years now, bouncing round in coding boot camps and visitor lecturing at universities and company coaching. The best way coders are entering into code studying has modified a bit.

I normally inform the recent faces to stay with the old-school technique of searching and googling for solutions, however persons are nonetheless utilizing ChatGPT finally. And their alibi is

“Having ChatGPT (for coding) is like having an additional research buddy -who chats with you want an everyday individual”.

It is useful, particularly once you’re nonetheless attempting to wrap your head round issues from search outcomes and documentation — to develop what’s so-called programmer instinct.

Now, don’t get me unsuitable, I’m all for the fundamentals. Shopping, studying docs, and throwing questions into the group pot — these are strong strikes, in my e book. Relying solely on ChatGPT could be a bit a lot. Positive, it could whip up a speedy abstract of solutions, however the standard searching strategies provide the freedom to choose and select, to experiment a bit, which is fairly essential within the coding world.

However, I’ve gotta give credit score the place it’s due — ChatGPT is lightning-fast at giving out solutions, particularly once you’re nonetheless attempting to determine the proper from the unsuitable in search outcomes and docs.

I notice this shift of utilizing ChatGPT as a research buddy just isn’t solely taking place within the coding scene, Chatgpt has revolutionized the best way folks be taught, I even use ChatGPT to repair my grammar for this submit, sorry Grammarly.

Saying no to ChatGPT is like saying no to engines like google within the early 2000 period. Whereas ChatGPT might include biases and hallucinations, just like engines like google having unreliable info or hoaxes. When ChatGPT is used appropriately, it could expedite the training course of.

Now, let’s think about a real-life situation the place ChatGPT might assist you by being your coding buddy to assist with debugging.

State of affairs: Debugging a Python Script

Think about you’re engaged on a Python script for a undertaking, and also you encounter an sudden error you can’t resolve.

Right here is how I was taught to do it — the period earlier than ChatGPT.

Shopping Method:

  1. Verify the Documentation:

Begin by checking the Python documentation for the module or perform inflicting the error.

For instance:
– go to https://scikit-learn.org/secure/modules/ for Scikit Study Doc

2. Search on Google & Stack Overflow:

If the documentation doesn’t present an answer, you flip to Google and Stack Overflow. Scan by numerous discussion board threads and discussions to discover a comparable concern and its decision.

StackOverflow Thread

3. Belief Your Instinct:

If the difficulty is exclusive or not well-documented, belief your instinct! You would possibly discover articles and sources on Google that you just’ve discovered reliable prior to now, and attempt to adapt comparable options to your downside.

Google Search Consequence

You may see that on the search consequence above, the outcomes are from W3school – (trusted coding tutorial web site, nice for cheatsheet) and the opposite 2 outcomes are official Pandas documentation. You may see that engines like google do counsel customers take a look at the official documentation. 😉

And that is how you should use ChatGPT that will help you debug a problem.

New Method with ChatGPT:

  1. Have interaction ChatGPT in Conversations:

As an alternative of solely navigating by documentation and boards, you possibly can interact ChatGPT in a dialog. Present a concise description of the error and ask. For instance,

“I’m encountering a problem in my [programming language] script the place [describe the error]. Are you able to assist me perceive what could be inflicting this and counsel a doable resolution?”

Have interaction ChatGPT in Conversations

2. Make clear Ideas with ChatGPT:

If the error is expounded to an idea you might be struggling to understand, you possibly can ask ChatGPT to clarify that idea. For instance,

“Clarify how [specific concept] works in [programming language]? I believe it could be associated to the error I’m dealing with. The error is: [the error]”

Make clear Ideas with ChatGPT

3. Search Suggestions for Troubleshooting:

You ask ChatGPT for normal tips about troubleshooting Python scripts. For example,

“What are some frequent methods for coping with [issue]? Any suggestions on instruments or strategies?”

Utilizing ChatGPT as coding buddy

Potential Benefits:

  • Personalised Steerage: ChatGPT can present customized steerage primarily based on the particular particulars you present in regards to the error and your understanding of the issue.
  • Idea Clarification: You may search explanations and clarifications on ideas immediately from ChatGPT leveraging their LLM functionality.
  • Environment friendly Troubleshooting: ChatGPT would possibly supply concise and related suggestions for troubleshooting, probably streamlining the debugging course of.

Potential Limitations:

Now let’s discuss in regards to the cons of counting on ChatGPT 100%. I noticed these points rather a lot in my scholar’s journey on utilizing ChatGPT. Publish ChatGPT period, my college students simply copied and pasted the 1-line error message from their Command Line Interface regardless of the error being 100 strains and linked to some modules and dependencies. Asking ChatGPT to clarify the workaround by offering a 1 line error code would possibly work generally, or worse — it would add 1–2 hour manhour of debugging.

ChatGPT comes with a limitation of not having the ability to see the context of your code. For positive, you possibly can at all times give a context of your code. On a extra advanced code, you won’t have the ability to give each line of code to ChatGPT. The truth that Chat GPT solely sees the small portion of your code, ChatGPT will both assume the remainder of the code primarily based on its information base or hallucinate.

These are the doable limitations of utilizing ChatGPT:

  • Lack of Actual-Time Dynamic Interplay: Whereas ChatGPT gives useful insights, it lacks the real-time interplay and dynamic back-and-forth that boards or dialogue threads would possibly supply. On StackOverflow, you may need 10 completely different individuals who would counsel 3 completely different options which you’ll examine both by DIY ( do it your self, attempt it out) or see the variety of upvotes.
  • Dependence on Previous Data: The standard of ChatGPT’s response is determined by the data it has been skilled on, and it will not be conscious of the most recent framework updates or particular particulars of your undertaking.
  • May add additional Debugging Time: ChatGPT doesn’t have a context of your full code, so it would lead you to extra debugging time.
  • Restricted Understanding of Idea: The standard searching strategies provide the freedom to choose and select, to experiment a bit, which is fairly essential within the coding world. If you understand how to handpick the proper supply, you most likely be taught extra from searching by yourself than counting on the ChatGPT normal mannequin.
    Until you ask a language mannequin that’s skilled and specialised in coding and tech ideas, analysis papers on coding supplies, or well-known deep studying lectures from Andrew Ng, Yann Le Cunn’s tweet on X (previously Twitter), just about ChatGPT would simply give a normal reply.

This situation showcases how ChatGPT is usually a useful software in your coding toolkit, particularly for acquiring customized steerage and clarifying ideas. Bear in mind to steadiness ChatGPT’s help with the strategies of searching and ask the group, protecting in thoughts its strengths and limitations.


Remaining Ideas

Issues I’d suggest for a coder

In the event you actually wish to leverage the autocompletion mannequin; as a substitute of solely utilizing ChatGPT, attempt utilizing VScode extensions for auto code-completion duties resembling CodeGPT — GPT4 extension on VScodeGitHub Copilot, or Google Colab Autocomplete AI instruments in Google Colab.

Auto code completion on Google Colab

As you possibly can see within the screenshot above, Google Colab robotically provides the consumer recommendations on what code comes subsequent.

One other different is Github Copilot. With GitHub Copilot, you will get an AI-based suggestion in real-time. GitHub Copilot suggests code completions as builders kind and switch prompts into coding recommendations primarily based on the undertaking’s context and magnificence conventions. As per this launch from Github, Copilot Chat is now powered by OpenAI GPT-4 (a similiar mannequin that ChatGPT is utilizing).

Github Copilot Instance — picture by Github

I’ve been actively utilizing CodeGPT as a VSCode Extension earlier than I knew that Github Copilot is accessible without spending a dime if you’re in schooling program. CodeGPT Co has 1M obtain to this date on the VSCode Extension Market. CodeGPT permits seamless integration with the ChatGPT API, Google PaLM 2, and Meta Llama.
You may get code recommendations by feedback, right here is how:

  • Write a remark asking for a selected code
  • Press cmd + shift + i
  • Use the code 😎

You may also provoke a chat through the extension within the menu and bounce into coding conversations 💬

As I replicate on my coding journey, the invaluable lesson discovered is that there’s no one-size-fits-all method to studying. It’s important to embrace a various array of studying strategies, seamlessly mixing conventional practices like searching and group interplay with the progressive capabilities of instruments like ChatGPT and auto code-completion instruments.

What to Do:

  • Make the most of Tailor-made Studying Assets: Profit from ChatGPT’s suggestions for studying supplies.
  • Collaborate for Downside-Fixing: Make the most of ChatGPT as a collaborative associate as if you’re coding with your mates.

What To not Do:

  • Over-Dependence on ChatGPT: Keep away from relying solely on ChatGPT and guarantee a balanced method to foster unbiased problem-solving expertise.
  • Neglect Actual-Time Interplay with Coding Group: Whereas ChatGPT provides useful insights, don’t neglect the advantages of real-time interplay and suggestions from coding communities. That additionally helps construct a fame in the neighborhood
  • Disregard Sensible Coding Observe: Stability ChatGPT steerage with hands-on coding follow to bolster theoretical information with sensible software.

Let me know within the feedback how you employ ChatGPT that will help you code!
Joyful coding!
Ellen

🌐 Comply with me on LinkedIn
🚀 Try my portfolio: liviaellen.com/portfolio
👏 My Earlier AR Worksliviaellen.com/ar-profile
☕ or simply purchase me an actual espresso ❤ — Sure I really like espresso.

In regards to the Writer

I’m Ellen, a Machine Studying engineer with 6 years of expertise, presently working at a fintech startup in San Francisco. My background spans knowledge science roles in oil & fuel consulting, in addition to main AI and knowledge coaching applications throughout APAC, the Center East, and Europe.

I’m presently finishing my Grasp’s in Knowledge Science (graduating Might 2025) and actively searching for my subsequent alternative as a machine studying engineer. In the event you’re open to referring or connecting, I’d actually recognize it!

I really like creating real-world influence by AI and I’m at all times open to project-based collaborations as effectively.