Tech EDGE, AI in the Classroom: Debugging Code in Claude
Tech EDGE
Author
05/14/2025
Added
0
Plays
Description
In this installment of AI in the Classroom, discover how AI assists the code debugging process in Claude. University of Nebraska-Lincoln (UNL) | College of Education and Human Sciences (CEHS) | Department of Teaching, Learning and Teacher Education (TLTE)
Searchable Transcript
Toggle between list and paragraph view.
- [00:00:00.270]Coming up on "AI in the Classroom,"
- [00:00:02.580]we are the debugging codes in Claude.
- [00:00:04.353](upbeat music)
- [00:00:09.930]Hi, my name is Guy Trainin,
- [00:00:11.640]a professor here at the University of Nebraska Lincoln.
- [00:00:14.670]And my name is Boakye Williams, a grad student at UNL.
- [00:00:18.570]And today, Williams is actually going to teach me
- [00:00:22.410]how to debug code in Claude,
- [00:00:26.880]which is one of our favorite AI.
- [00:00:32.460]So let's go. Show me what you've got.
- [00:00:34.500]So Claude is one of the favorite programming
- [00:00:38.803]or one of the AI that is best
- [00:00:42.690]in debugging or creating codes.
- [00:00:45.450]And so as teachers,
- [00:00:48.450]sometimes we will try to help our students with some codes.
- [00:00:54.300]If you want them to know what to do with a certain code
- [00:00:57.870]or what to do,
- [00:00:59.040]we can give them a list of code that is having errors.
- [00:01:04.500]And I'll ask them to debug them
- [00:01:07.830]to find those errors that are in the code.
- [00:01:10.590]And so, here I give Claude the first prompt
- [00:01:13.170]that I'm going to provide it with some codes
- [00:01:16.890]that I would need it to debug it for me.
- [00:01:19.170]And it said, okay, sure.
- [00:01:20.760]First I need to specify the programming language,
- [00:01:24.840]what the code is supposed to do,
- [00:01:27.090]any error messages that I've been seeing.
- [00:01:29.880]But I didn't do any of that,
- [00:01:31.410]but I just provided it with the list of the codes.
- [00:01:34.560]And here you can see the first code.
- [00:01:38.880]You can copy the code from the programming language
- [00:01:41.040]that you are working on, whether in C++,
- [00:01:45.060]or even if an HTML document or any programming language.
- [00:01:49.740]You can just copy the code and provide it with Claude
- [00:01:54.240]to find the errors for you.
- [00:01:56.370]So here I have the first code, one, age_1 = "23"
- [00:02:02.970]and the second code is 2surname = Boakye,
- [00:02:07.710]and the last code is Firstname = Williams.
- [00:02:10.650]So it assessed the code
- [00:02:13.170]and found nothing wrong with the first code,
- [00:02:17.130]which is age = "23."
- [00:02:20.550]And that is the correct code,
- [00:02:22.110]but with the surname,
- [00:02:25.440]it actually added quotation marks around the name,
- [00:02:29.970]seeing that the name is a string,
- [00:02:35.010]and strings should come with quotation marks.
- [00:02:39.150]And the last one, first name.
- [00:02:41.490]So here we can just see what Claude said.
- [00:02:46.710]If you want to use number in variable names,
- [00:02:49.560]you can put it at the end of the line
- [00:02:53.400]instead of at the beginning.
- [00:02:55.020]For example, surname2 rather than just saying 2surname.
- [00:02:59.340]So that was the error that was found in the code.
- [00:03:03.630]So before we jump to the next thing,
- [00:03:05.700]because, so you gave it code, it asked what language,
- [00:03:09.600]but actually it was able to detect the language on its own.
- [00:03:13.050]Now, you don't want to trust it
- [00:03:14.880]because we do have computer languages
- [00:03:17.550]that are somewhat similar,
- [00:03:18.930]and you wanna make sure that it's reading the right one.
- [00:03:22.290]You want to make sure that it knows this is Python,
- [00:03:24.810]this is Java, this is HTML, whatever we're using,
- [00:03:29.430]just to make sure that it's not steering you
- [00:03:31.410]in the wrong direction.
- [00:03:32.340]What I love though, that you showed me
- [00:03:34.860]that I didn't know it did is it actually explains,
- [00:03:38.130]and it doesn't just fix it,
- [00:03:40.320]it actually explains what you need to do,
- [00:03:43.800]and as a result it becomes a great learning device.
- [00:03:47.250]Because now it's not just saying here's, you know,
- [00:03:50.580]here's the right code. Here is our code.
- [00:03:52.140]But actually it walks you through the thinking.
- [00:03:55.110]It's like, okay, if you want integer,
- [00:03:57.210]it needs to be this way.
- [00:03:58.200]If you want it to be a string, you need to do that.
- [00:04:01.170]If you want it numbers part of the variable name,
- [00:04:05.040]it's got to show up after, not before.
- [00:04:07.290]So it really is, you can see how
- [00:04:10.050]after you interact a few times, you take those pointers
- [00:04:14.370]and you can start implementing it in your code.
- [00:04:16.800]So it really does scaffold a little bit of the learning.
- [00:04:23.160]So what's the next thing?
- [00:04:25.560]These are the few codes that I provided,
- [00:04:27.750]but actually you can add a long string of code
- [00:04:31.110]for it to debug it and find the errors for you.
- [00:04:35.430]And you can do this as an assessment
- [00:04:37.650]for your students in the classroom.
- [00:04:39.960]You give them a list of codes,
- [00:04:41.760]let's say 1 to 10 with errors,
- [00:04:43.860]and then they will debug it and find the errors themselves.
- [00:04:47.520]And they will also learn something
- [00:04:50.550]from what Claude will provide them with the result
- [00:04:54.720]and the explanations in the solution and the code.
- [00:04:59.460]And I love what you're talking about here
- [00:05:01.560]because one of the things
- [00:05:02.700]that we struggled with the most with AI
- [00:05:04.830]is if it just gives me an answer, then I'm not learning.
- [00:05:08.550]One of the things we can do as teachers
- [00:05:10.350]is we can give that text,
- [00:05:13.170]allow students to debug individually and then with Claude,
- [00:05:18.690]but then we have to insist on them actually explaining it.
- [00:05:22.530]So it's not enough that you got it right,
- [00:05:24.960]tell me what you learned from it
- [00:05:26.940]or tell me what the mistake was
- [00:05:28.980]and how you would avoid it in the future.
- [00:05:31.230]So that creating that discussion,
- [00:05:34.200]that instructional conversation
- [00:05:37.050]is really where understanding happens.
- [00:05:42.300]Because when you have to explain it to somebody else,
- [00:05:45.090]you have to actually properly process the information.
- [00:05:49.290]Whereas here, sometimes you can just, yes, yes, yes,
- [00:05:52.230]there's an explanation,
- [00:05:53.250]but I'm just going to grab the answer and put it in.
- [00:05:56.010]So it's through instructional conversation
- [00:05:59.070]that the magic of learning, deep learning, actually happens.
- [00:06:04.290]So this is with short snippets of code. Can you do it?
- [00:06:07.440]You started saying about longer snippets of code.
- [00:06:10.050]What happens with longer snippets of code?
- [00:06:12.630]Yes, so actually you can even ask Claude
- [00:06:17.700]to give you some codes yourself.
- [00:06:19.890]You just give it give me a list of some error codes
- [00:06:23.370]in Python using variables or when teaching variables.
- [00:06:27.780]And it can give you that
- [00:06:29.370]and you can use it to assess your students.
- [00:06:31.350]So it can give you a long snippet of code
- [00:06:36.090]and then you can provide it
- [00:06:39.090]or give it to your students to debug it for you.
- [00:06:43.050]All right. Yeah.
- [00:06:44.070]So today on "AI in the Classroom,"
- [00:06:46.770]we did a little bit of debugging your code with Claude.
- [00:06:52.710]And what is really, really fascinating is thinking about it
- [00:06:57.120]as a support for teaching computer science,
- [00:06:59.430]not just as a way to fix your own code, which is important.
- [00:07:02.670]But as a way, what do you do with it
- [00:07:04.770]as a teacher who teaches computer science,
- [00:07:06.870]who teaches coding,
- [00:07:07.920]and wants students to start using the debugging features
- [00:07:12.720]without losing the ability to do the work themselves.
- [00:07:17.070]And we'll see you next time.
- [00:07:18.136](upbeat music)
The screen size you are trying to search captions on is too small!
You can always jump over to MediaHub and check it out there.
Log in to post comments
Embed
Copy the following code into your page
HTML
<div style="padding-top: 56.25%; overflow: hidden; position:relative; -webkit-box-flex: 1; flex-grow: 1;"> <iframe style="bottom: 0; left: 0; position: absolute; right: 0; top: 0; border: 0; height: 100%; width: 100%;" src="https://mediahub.unl.edu/media/24853?format=iframe&autoplay=0" title="Video Player: Tech EDGE, AI in the Classroom: Debugging Code in Claude" allowfullscreen ></iframe> </div>
Comments
0 Comments