How Would I Learn to Code with ChatGPT if I Needed to Start Again

-

Coding has been an element of my life since I used to be 10. From modifying HTML & CSS for my Friendster profile throughout the easy web days to exploring SQL injections for the fun, constructing a three-legged robot for fun, and recently diving into Python coding, my coding journey has been diverse and fun!

Here’s what I’ve learned from various programming approaches.

The best way I learn coding is at all times similar; As people say, mostly it’s just copy-pasting. 😅

In terms of constructing something within the coding world, here’s a breakdown of my method:

  1. Select the Right Framework or Library
  2. Learn from Past Projects
  3. Break It Down into Steps
    Slice your project into actionable item steps, making development less overwhelming.
  4. Google Each Chunk
    For each step, seek the advice of Google/Bing/DuckDuckGo/any search engine you favor for insights, guidance, and potential solutions.
  5. Start Coding
    Attempt to implement each step systematically.

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

1. Check Framework Documentation: ALWAYS read the docs!

2. Google and Stack Overflow Search: search on Google and Stack Overflow. Example keyword could be:

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

site:stackoverflow.com python error ImportError: pandas

– Stack Overflow Solutions: If the difficulty is already on Stack Overflow, I search for probably the most upvoted comments and solutions, often finding a fast and reliable answer.
– Trust My Intuition: When Stack Overflow doesn’t have the reply, I trust my intuition to go looking for trustworthy sources on Google; GeeksForGeeks, Kaggle, W3School, and Towards Data Science for DS stuff 😉

3. Copy-Paste the Code Solution

4. Confirm and Test: The ultimate step includes checking the modified code thoroughly and testing it to make sure it runs as intended.

And Voila you simply solve the bug!

Photo by Stephen Hocking on Unsplash

Isn’t it beautiful?

But in point of fact, are we still doing this?!

Recently, I’ve noticed a shift in how latest coders are tackling coding. I’ve been teaching code professionally for about three years now, bouncing around in coding boot camps and guest lecturing at universities and company training. The best way coders are entering into code learning has modified a bit.

I normally tell the fresh faces to follow the old-school approach to browsing and googling for answers, but individuals are still using ChatGPT eventually. And their alibi is

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

It is useful, especially while you’re still attempting to wrap your head around things from search results and documentation — to develop what’s so-called programmer intuition.

Now, don’t get me mistaken, I’m all for the fundamentals. Browsing, reading docs, and throwing questions into the community pot — those are solid moves, in my book. Relying solely on ChatGPT is likely to be a bit much. Sure, it may possibly whip up a speedy summary of answers, but the normal browsing methods offer you the liberty to choose and select, to experiment a bit, which is pretty crucial within the coding world.

But, I’ve gotta give credit where it’s due — ChatGPT is lightning-fast at giving out answers, especially while you’re still attempting to determine the correct from the mistaken in search results and docs.

I realize this shift of using ChatGPT as a study buddy isn’t only happening within the coding scene, Chatgpt has revolutionized the way in which people learn, I even use ChatGPT to repair my grammar for this post, sorry Grammarly.

Saying no to ChatGPT is like saying no to engines like google within the early 2000 era. While ChatGPT may include biases and hallucinations, much like engines like google having unreliable information or hoaxes. When ChatGPT is used appropriately, it may possibly expedite the training process.

Now, let’s imagine a real-life scenario where ChatGPT could assist you to by being your coding buddy to assist with debugging.

Scenario: Debugging a Python Script

Imagine you’re working on a Python script for a project, and also you encounter an unexpected error which you can’t solve.

Here is how I was taught to do it — the era before ChatGPT.

Browsing Approach:

  1. Check the Documentation:

Start by checking the Python documentation for the module or function causing the error.

For instance:
– visit https://scikit-learn.org/stable/modules/ for Scikit Learn Doc

2. Search on Google & Stack Overflow:

If the documentation doesn’t provide an answer, you switch to Google and Stack Overflow. Scan through various forum threads and discussions to search out an analogous issue and its resolution.

StackOverflow Thread

3. Trust Your Intuition:

If the difficulty is exclusive or not well-documented, trust your intuition! You may explore articles and sources on Google that you simply’ve found trustworthy previously, and check out to adapt similar solutions to your problem.

Google Search Result

You may see that on the search result above, the outcomes are from W3school – (trusted coding tutorial site, great for cheatsheet) and the opposite 2 results are official Pandas documentation. You may see that engines like google do suggest users take a look at the official documentation. 😉

And that is how you should use ChatGPT to assist you to debug a difficulty.

Latest Approach with ChatGPT:

  1. Engage ChatGPT in Conversations:

As an alternative of only navigating through documentation and forums, you’ll be able to engage ChatGPT in a conversation. Provide a concise description of the error and ask. For instance,

“I’m encountering a difficulty in my [programming language] script where [describe the error]. Are you able to help me understand what is likely to be causing this and suggest a possible solution?”

Engage ChatGPT in Conversations

2. Make clear Concepts with ChatGPT:

If the error is expounded to an idea you’re struggling to understand, you’ll be able to ask ChatGPT to elucidate that idea. For instance,

“Explain how [specific concept] works in [programming language]? I believe it is likely to be related to the error I’m facing. The error is: [the error]”

Make clear Concepts with ChatGPT

3. Seek Recommendations for Troubleshooting:

You ask ChatGPT for general tips about troubleshooting Python scripts. As an illustration,

“What are some common strategies for coping with [issue]? Any recommendations on tools or techniques?”

Using ChatGPT as coding buddy

Potential Benefits:

  • Personalized Guidance: ChatGPT can provide personalized guidance  concerning the error and your understanding of the issue.
  • Concept Clarification: You may seek explanations and clarifications on concepts directly from ChatGPT leveraging their LLM capability.
  • Efficient Troubleshooting: ChatGPT might offer concise and relevant suggestions for troubleshooting, potentially streamlining the debugging process.

Possible Limitations:

Now let’s talk concerning the cons of counting on ChatGPT 100%. I saw these issues so much in my student’s journey on using ChatGPT. Post ChatGPT era, my students just copied and pasted the 1-line error message from their Command Line Interface despite the error being 100 lines and linked to some modules and dependencies. Asking ChatGPT to elucidate the workaround by providing a 1 line error code might work sometimes, or worse — it’d add 1–2 hour manhour of debugging.

ChatGPT comes with a limitation of not with the ability to see the context of your code. Obviously, you’ll be able to at all times give a context of your code. On a more complex code, you would possibly not find a way to present every line of code to ChatGPT. The undeniable fact that Chat GPT only sees the small portion of your code, ChatGPT will either assume the remainder of the code based on its knowledge base or hallucinate.

These are the possible limitations of using ChatGPT:

  • Lack of Real-Time Dynamic Interaction: While ChatGPT provides beneficial insights, it lacks the real-time interaction and dynamic back-and-forth that forums or discussion threads might offer. On StackOverflow, you would possibly have 10 different individuals who would suggest 3 different solutions which you’ll compare either by DIY ( do it yourself, try it out) or see the variety of upvotes.
  • Dependence on Past Knowledge: The standard of ChatGPT’s response will depend on the data it has been trained on, and it is probably not aware of the most recent framework updates or specific details of your project.
  • Might add extra Debugging Time: ChatGPT doesn’t have a context of your full code, so it’d lead you to more debugging time.
  • Limited Understanding of Concept: The normal browsing methods offer you the liberty to choose and select, to experiment a bit, which is pretty crucial within the coding world. In the event you know handpick the correct source, you most likely learn more from browsing on your individual than counting on the ChatGPT general model.
    Unless you ask a language model that’s trained and specialized in coding and tech concepts, research papers on coding materials, or famous deep learning lectures from Andrew Ng, Yann Le Cunn’s tweet on X (formerly Twitter), just about ChatGPT would just give a general answer.

This scenario showcases how ChatGPT could be a beneficial tool in your coding toolkit, especially for obtaining personalized guidance and clarifying concepts. Remember to balance ChatGPT’s assistance with the methods of browsing and ask the community, keeping in mind its strengths and limitations.


Final Thoughts

Things I’d recommend for a coder

In the event you actually need to leverage the autocompletion model; as a substitute of solely using ChatGPT, try using VScode extensions for auto code-completion tasks comparable to CodeGPT — GPT4 extension on VScodeGitHub Copilot, or Google Colab Autocomplete AI tools in Google Colab.

Auto code completion on Google Colab

As you’ll be able to see within the screenshot above, Google Colab routinely gives the user suggestions on what code comes next.

One other alternative is Github Copilot. With GitHub Copilot, you’ll be able to get an AI-based suggestion in real-time. GitHub Copilot suggests code completions as developers type and switch prompts into coding suggestions based on the project’s context and elegance conventions. As per this release from Github, Copilot Chat is now powered by OpenAI GPT-4 (a similiar model that ChatGPT is using).

Github Copilot Example — image by Github

I actually have been actively using CodeGPT as a VSCode Extension before I knew that Github Copilot is accessible without cost in case you are in education program. CodeGPT Co has 1M download to this date on the VSCode Extension Marketplace. CodeGPT allows seamless integration with the ChatGPT API, Google PaLM 2, and Meta Llama.
You may get code suggestions through comments, here is how:

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

It’s also possible to initiate a chat via the extension within the menu and jump into coding conversations 💬

As I reflect on my coding journey, the invaluable lesson learned is that there’s no one-size-fits-all approach to learning. It’s essential to embrace a various array of learning methods, seamlessly mixing traditional practices like browsing and community interaction with the progressive capabilities of tools like ChatGPT and auto code-completion tools.

What to Do:

  •  Benefit from ChatGPT’s recommendations for learning materials.
  •  Utilize ChatGPT as a collaborative partner as in case you are coding with your folks.

What To not Do:

  •  Avoid relying solely on ChatGPT and ensure a balanced approach to foster independent problem-solving skills.
  •  While ChatGPT offers beneficial insights, don’t neglect the advantages of real-time interaction and feedback from coding communities. That also helps construct a status in the neighborhood
  •  Balance ChatGPT guidance with hands-on coding practice to strengthen theoretical knowledge with practical application.

Let me know within the comments how you employ ChatGPT to assist you to code!
Completely satisfied coding!

🌐 Follow me on LinkedIn
🚀 
👏 : liviaellen.com/ar-profile

ASK ANA

What are your thoughts on this topic?
Let us know in the comments below.

0 0 votes
Article Rating
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Share this article

Recent posts

0
Would love your thoughts, please comment.x
()
x