How can I use ChatGPT or Claude to learn Ruby without it doing the learning for me?
Use the assistant as a tutor that explains and quizzes you, not as a typist that hands over finished code. Write your own attempt first, ask for a hint before an answer, have it explain each line, then run everything in irb. If you cannot predict what a line prints before you run it, you have not learned it yet.
Cite
Poignant Guide Ruby Q&A, "How can I use ChatGPT or Claude to learn Ruby without it doing the learning for me?", https://poignantguide.net/answers/read/how-can-i-use-chatgpt-or-claude-to-learn-ruby-without-it-doing/, accessed 2026-11-27.- Odile MarchettiStaffStaff: Ruby basics, objects and the Poignant Guide ·
Why this needs a plan
AI tools are now an everyday part of programming. The Stack Overflow 2025 Developer Survey reports that 84% of respondents use or plan to use AI tools in their development process, up from 76% the year before. Among people who said they were learning to code, 39.5% used them daily.
The same survey shows why checking matters. More developers said they distrust the accuracy of AI tools (46%) than trust it (33%), and only 3% reported highly trusting the output. Experienced developers were the most cautious. Treat an answer from any assistant as a claim to test, not a fact. Checked on 12 November 2026; the survey is a snapshot of 2025.
Learning is different from finishing a task. If the assistant writes the method, you get a method that works and a head that has not changed.
The method: attempt, hint, explain, verify
- Attempt. Write your own version first, even if it is wrong. A wrong attempt tells you what you are missing.
- Hint. Ask for a nudge, not the solution.
- Explain. Once you have working code, ask for a line by line explanation in plain words, then say it back in your own words.
- Verify. Run it in irb and check each method against the Ruby docs.
Some tools are built to support this. The Claude Code output styles documentation describes a "Learning" style in which Claude explains its choices and leaves small pieces of code for you to write, marking the spot with a
TODO(human)comment. Even without a special mode, you can ask for the same thing in your first message.Prompts that teach, and prompts that do the work
Instead of Try "Write a Ruby method that reverses words." "I wrote this method (pasted). It prints the wrong thing. Give me a hint, not the fix." "Fix this error." "Explain this error message line by line. What should I check first?" "Explain blocks." "Quiz me on blocks with three short questions. Wait for my answers." "Give me the finished script." "Review my script and point out one thing to improve. Do not rewrite it." Checking an AI answer: a worked example
Assistants sometimes invent methods that sound plausible. Here is how to catch one in irb. Say you were told to use
sum_of_squares:nums = [1, 2, 3] nums.respond_to?(:sum_of_squares) # => false nums.respond_to?(:sum) # => true nums.sum { |n| n * n } # => 14respond_to?asks an object whether it has a method of that name. The invented method does not exist, butsumdoes, and it takes a block. The Ruby reference manual is the final word on what Array can do. Look up every method an assistant uses that you have not met before.Mistakes beginners make
- Pasting the whole assignment. You get code you cannot explain. Your instructor may also have a rule on AI help, so read the course policy before using any tool on graded work.
- Believing the confident tone. A fluent explanation can still be wrong. Run the code.
- Skipping the typing. Copy and paste does not build the habit. Type the lines yourself.
Check this in order before you trust an answer
- Can you say what each line does without looking?
- Does it run in irb on your Ruby version (
ruby -v)? - Does every method it uses exist in the docs for that version?
- Can you break it on purpose and explain the error? The thread What does undefined method for nil:NilClass mean helps with that step.
- Can you rewrite it tomorrow from memory?
Two other threads make this checking easier: How do I use irb and binding.irb for poking at code, and How do I write my first Ruby test with Minitest? so a test, not the assistant's word, decides whether code is right. The guide's Expansion Pak 1 on irb is the best place to build that habit.
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.