YouTubevideo· Sep 2, 2025· 21:36

The New Way to Learn to Code

Watch on YouTube ↗

transcript

52 moments
  1. Now, I'm really glad I'm not learning to code from scratch right now because I honestly don't know how I would do it. So, when people ask me how should I learn to code who are looking to get into development, who are looking to be developers, I don't know what to tell them. Why? Because I think AI is so prevalent and it's so good that really you should just learn how to work with AI. But I think Claude Code is actually starting to work with it.

  2. And I've been a Claude Code fan for quite a while, but now I'm actually using it to teach me things that I'm either digging into, maybe wanting to learn more, or just experimenting with instead of just, you know, inputting a prompt and then grabbing some coffee or going to the bathroom, come back, I'm working with Claude code. It's become my most expensive uh co-orker, I guess.

  3. It all started with this blog post, or rather this tweet that Claude put out about using this learning for Claude to occasionally pause and ask you to code some of the to-do tasks. It's like pair programming with a mentor that helps you learn while getting real work done. Now, I have never worked in an office with other developers in the sense that I have not had someone over my shoulder saying, "Hey, no, actually think about that." I have done pair programming but it's a little bit different when it is virtualized and it doesn't feel as I don't know as intense.

  4. So when I saw that claude code had put this out I wanted to start using it and I've been using it for almost every single thing that I'm learning the past couple of weeks in the sense that uh hey I want to learn more about shaders and canvas element. I want to learn about the web audio API. Those things I could just have Claude start to I don't know vibe code for me. But then where's the actual learning part come in?

  5. So yeah, it is expecting me to code, but it's actually telling me how to code and leaving parts for me to code so that I'm not just blindly trusting it. Now, I'll give you a little sneak peek before we actually look at what this looks like in real life, how I normally would use it. This is probably how I would want people to learn how to code right now. learning what happens, but also using AI to help teach you what you might need to do.

  6. Because really, as with all computers, AI is just another computer. Learning how to get the computer to do what you want it to do is the basics of learning how to code. And if that means getting AI to do what you need it to do, then that's learning to code. So, if I was to have a open directory in this case, I want to learn more about shaders. How do shaders work within the WebGL canvas element 3D element within the canvas element? And instead of just vibe coding this, saying, "Hey, this is what I want to make me a cool demo."

  7. And then I can look through the code. That's a little bit tedious. Instead, I'll plop into Claude. I'll change the output style.

  8. Now, this is something I change pretty frequently because sometimes I do just want to code a new feature, something I've done many multiple times. Maybe it's something I don't necessarily need to learn, but there's multiple output styles. An explanatory output style. I haven't messed around with this too much, mostly because if I'm wanting to explain it something, I'm wanting to learn something. And so learning is a little bit better for me. Now, you can have your own custom output style, a new output style. I have not messed around with this, but that might be something you're interested in.

  9. So now that we have this, you know, this learning style generated for us, Claude is going to take breaks and say, "Hey, I've done this. Why don't you step in? It's your pair programmer." So if I want to say something like, "I want to learn about shaders where I can make a cool demo showing how to use canvas."

  10. And when I hover over an image, the shader uh pixelizes or blurs the image. Good part is AI doesn't really care too much about how you're spelling. Uh it's a good mentor in that regard.

  11. Now, I have found this output style a little bit better than if I was to tell it to make me a lesson or teach me to do it with the standard output style or the default output style, I should say, because I think this has a little bit more nicities built into its system prompt where it is waiting for you to complete something before it continues instead of making a five-step demo application for you that you then have to follow along in a markdown file, for example.

  12. So this is what I would say is the boilerplate for stuff like this where we're not actually doing any coding just yet. It's just starting it off. And the demo application looks like it's going to give us more information so that we can learn as we go. And so if I'm making a video about a specific topic, most of the time I'm using learning output mode to build a demo and then make sure I understand everything clearly so that I can do it from scratch.

  13. And of course, I still might use cloud code in default mode to whip up some specific parts of a demo to do that. But now I have a better understanding of, you know, how specific parts of code works, what parts are better for me to type out by hand or show you typing by hand, and what parts are just best to, I don't know, copy and paste. That's where my philosophy might differ a little bit than other teachers where I think it is still great especially in today's day and age to copy and paste specific things if that is not the central focus of what you are learning right then and there.

  14. If you're wanting to learn how CSS works, you can copy and paste the HTML that gives you the boilerplate for then styling it with CSS. But if you're wanting to learn how, you know, HTML works with CSS, then starting from scratch is great. Now, it's giving me a bunch of shaders, and typically within a standard uh learning output, it's started to ask me questions by now or started to have me do something by now, but I'm going to trust the process. I will say though that now that I've seen code from shaders, uh, this is very boilerplate.

  15. I don't know if I would want to be writing most of this by hand, and it does give us a little bit of insight here and there, where the vertex shader transforms 2D positions to clip space for GPU rendering. Fragment shaders run once per pixel. Then the blur shader samples neighboring pixels with a box filter. As I understand it, if I'm taking this learning process of what claude code is doing, it's giving me the ability to understand a little bit about what this boiler plate stuff that you might not want to write by hand every single time.

  16. At least a better understanding of what is happening. So that's why we have things like vertex shaders, uh pixel shaders, blur shaders. We have a main.js js file that it's whipped up for us right now. And this is just uh kind of implementing the shaders that has already been implemented for us in shaders.js. Now, it still hasn't asked me to start writing out code just yet, but there's a lot to learn about shaders. So, I imagine we might be starting from scratch. I do maybe I want to give it a little bit more hints saying I do not know anything.

  17. Help me, you know, build this out myself or learn by building. And there we go. We have our first assignment. And this is what learn by doing looks like within the learning output within Claude Code. I've set up the WebGL shader system with pixelation and blur effects that respond to mouse position. The shaders calculate effect strength based on distance from the mouse cursor. Currently, the effect radius is fixed at 150 pixels, but we need dynamic control to create engaging hover interactions.

  18. Your task, and this is starting to feel a little bit like a a job um application in main.js, implement the calculate effect radius method. Look for to-do human. This method should smoothly animate the radius based on hover state and transition speed settings. Guidance.

  19. Consider using easing functions for smooth transitions. When hovering, you might expand the radius gener gradually, perhaps 100 to 200 pixels. When the mouse leaves, shrink it back. And I don't know what it is about uh maybe not wanting to mess up the teaching output and teaching style that's given, but here's where I would then start to feel like I'm doing a little bit more learning instead of immediately having it implement that for me. This effect of calculate effect radius.

  20. I would start searching for it maybe in Google, maybe another instance of cloud code, maybe just a chat GPT. And that way I'm learning by finding the information. And so yes, I think this learning output is less about, you know, doing a few things by hand or copying and pasting what it gives you in the output because it doesn't really do that. It giving specific moments of time for you to have to do the task yourself.

  21. And every single time I've had to do that, usually that's when I've learned the most when I've had to put effort and time into researching the thing that I'm wanting to get done. So if I was taking you along this journey with me of how I normally have done this in the past with other elements, different uh frameworks, different packages, instead of just having claude code read the documentation and kind of give me a TLDDR, I have used this learning output to be able to say, okay, we need this calculate effect radius. I would then go into my code editor.

  22. I would search for the calculate effect radius to do implement this. And this is what I need to get done. smoothly transition the effect radius when hovering not hovering. Use this.transition speed to control the animation speed. And then we return the appropriate radius value for the shader. Now, here's where I want to learn more about what uh this.transition speed looks like. So, maybe I'll take a look at this transition speed. And so, we do have, you know, a transition speed setting. This is a variable. Okay.

  23. And that transition speed is actually going to be an input on the element. So, do we have an effect radius? No, we do not.

  24. So, we need to calculate that effect radius. And when it's hovering and not hovering is when we increase it or decrease it. So, here's where um I might just start typing. So, um I might say that this is a function of calculate effect radius and it needs it doesn't need any kind of props in there. And here's also where I would probably start to use uh inline editing for me in the sense of I'm still learning because I'm physically having to think through okay what needs to happen in this step.

  25. It's for things I'm not as familiar with.

  26. Well then I can have code walk it through with me instead of generating a whole bunch from the scratch. So in this case, if I was to press uh tab and accept this, we need to calculate the effect radius based off the mouse position based off the hovering. And then uh the distance is going to be math square based off the uh position and canvas height. I don't think that's necessarily it because we do need to use this transition speed as well. So I'm actually going to remove this. And now this is where the actual learning comes in.

  27. I might search up something like what this transition speed if we already saw and we already know that that's a value. But now we need to transition the effect rate. That's a keyword right there. So how might we do this in JavaScript? Well, we might see maybe a different function that is already doing this. Well, yeah, where the animated intensity is automatically controlled by the transition speed or being calculated with the transition speed. So I don't think there's any harm in getting some extra help.

  28. If this was 5 years ago, I would have looked on Stack Overflow or looked in any forum. And so now I can start to think through specific individual aspects of what I'm learning.

  29. Instead of trying to grock, trying to understand everything all at once, now I'm thinking through, okay, this math that goes into shaders, well, we're having to think through what that effect radius actually looks like when you're hovering over something and then the mouse position of that object. So it looks like this needs a min radius and a max radius. I don't know if those are things that we have, but we can check a min radius. We don't. So we don't necessarily need that. So what I might do is I might just take this whole class and say um I already have an existing class.

  30. How could I make this work within that class? Now yes, this might to some seem like a copout way. you're not, you know, thinking through reading documentation and finding the exact way to do this. But I think that Claude in a roundabout way is kind of forcing me out of that bubble of just having it generate it for me in the context that it already knows. And now I'm thinking through a specific context in order to then place it into the context that is generated.

  31. This reminds me of the very first SAS application that I built and I used Chad GBT. I believe it was three at the time, might have even been 2.5 or something like that. And I would just take chunks of code that was not that did not have any context because context was so small within chatgbt at the time.

  32. And I would take it and I would paste into chat GBT and I would try to figure out a best way to then maybe get uh another snippet of code that I could put into my code. And then I would write some more in my layer of application and I would take a good chunk that wasn't working or that I needed a new I don't know job or background job for and I would put that into chat GBT. And I think I learned a lot in the process because I did not have the benefit that current AI models have where you have unlimited context for the most part with things like the ability to chunk and compact everything.

  33. And instead I had to learn piece by piece. But I wasn't writing all the code. It was just allowing me to learn by telling me how things worked within the little context that I might know. And then it forced me to know, okay, why would this not work? So this is telling us that we have to have a couple of fields in our constructor for the bounds and state. Um, and then we implement the calculate effect radius as a class method and not a function inside that class. And I did know that. I just didn't think about it because I didn't know the full context.

  34. I wasn't reading and writing all the code. But now I have a little bit more understanding even just for a snip simple snippet in my code. All right. So we have a min radius, we have a max radius, a proximity radius, and then effect radius. And last time frame rate independent easing. Okay, that's interesting. That's something that I might take a note of just to make sure I fully understand it later on. Then we want this calculate effect radius and this might go before the render method where we're clearing the color and then we're using this program. Looks like that is all in the same but we also need to add this radius.

  35. So we're saying uh this compute animated radius we need to pass this to the shader. This is where we can do this right around here. And this is the radius that we then calculated or the calculate effect radius is that uh function that method that we created right then I like this I think I understand this a little bit better because we are grabbing the mouse position we are grabbing the hovering as a value as a attribute and then based on the specific time is when we can

  36. calculate the proximity of where the mouse position is versus where it exists on the screen. So this radius is going to grow when it's close when the mouse position is hovering over it. It's going to shrink otherwise. Then we did have some transition speed, some exponential smoothing as well. Now it's going to add a little bit of CSS. And it looks like this demo is complete. Sometimes Cloud Code Learning Output has given me the option of uh maybe two or three back and forths.

  37. Uh but usually I continue the conversation most of the time especially if I'm wanting more insight as to okay we did this but uh how would you have done it or how would you have done it simpler and usually the simpler method allows you to work together in a lot of ways to say when does it fail when does it work great so now that it's given us the demo I don't necessarily see an image so I'm curious what that looks like if I was to open up uh our code in the index.html HTML. Looks like we have the canvas. Okay.

  38. Now, how are we getting the image? So, in main.js, we should get the canvas. And where does the image actually come in? So, image.

  39. So, we do have a load image, which should be an SVG. And now I'm starting to see a little bit more about how WebGL works where we have this particular image source that is an SVG, but for some reason, I'm not seeing that uh in this particular instance. So I might ask cloud code before I ask it to continue learning. Uh I don't see any image to blur or pixelate.

  40. So instead of loading that SVG image, it looks like it's going to uh ask for a image upload or we just have a bunch of different I don't know geometric shapes that it is loading in onto that canvas. And then finally, it's using some uh some event listeners to wait for that image upload before adding that to the target file. So, we do have some errors and that's maybe why the original image was not showing.

  41. And so, this specific error looks like it wasn't necessarily related to what we might have input um in terms of WebGL rendering as well as the resolution differ between vertex and fragment shaders. This just looks something like it originally told us about how there are different shaders. There are the vertex, there is the fragment shaders, and then the blur shaders as well. We have a little bit more math to say that this vertex should have a float precision integer. Okay, there we go.

  42. Got zoom out a little bit. So, we can upload a specific image or we can blur none. Blur effect intensity pixelate transition speed. That transition speed is what we put in. I feel like I contributed to this a little bit, but now I'm not done because usually that's where the real learning begins. We only implemented a little piece of this, but now I want to know just give me a little TLDDR. What should I know about this?

  43. Again, I'm taking this from a standpoint of if I was doing the same thing like I have in the past couple of weeks, how would I then tell you how to do that? And so we implemented this calculate effect radius. I just want Claude code to tell me how would you have implemented this one? And we asked Chad GBT to help us with this. Um, and I I understand it, but I wanted to tell it to us so that we can even understand it a little bit more. In this case, usually some of these comments help, but it's nice to know if we were to breaking this down a little bit more.

  44. All right, we have a little lesson from our favorite AI tutor/mentor. Uh, so I just usually go through something like this. I'll read through it. I'll make sure I try to understand it and then trying to put it in my own words as well. things like the GPU pipeline, the factory assembly line, things like texture sampling, all this.

  45. I'm not going to read it to you to spare you the details of all this, but this is how I would learn. I take these elements that Claude Code helped me walk through or at least give me a piece to feel like I'm a part of it and then send me on my way to try to learn and figure out myself. So in my own words, WebGL then allows you to say, okay, instead of the actual thing that exists in a given position, let's lie about it. Let's say this actually exists in the given position.

  46. In this case, our mouse hover changes the effect based off of what we tell WebGL, this is actually what exists at the position. Okay? And so this is what it was kind of looking for. a very simplized aspect of just using JavaScript instead of trying to calculate uh the specific instance and then calculating um you know this proximity scaling effect.

  47. It's the simple version where we're basically giving the shader the effect radius and calculating that based off of the target radius which is where the mouse position is hovering and the exact speed of the effect radius as well. So it's something that you might be able to use the output style of learning for within cloud code.

  48. I think generally it works great for those areas or maybe new packages, new languages, new frameworks where for the most part you understand and you could dive into the documentation and maybe copy some things from there and tweak some things. But it's also great for you to uh have some hands-on say and how does that then affect the context of the whole project at large.

  49. And like we showed here, I think demo applications work great for that and claude code works great within that learning style because it generates everything I need and I don't want to learn how every single element of a shader or or uh WebGL works within canvas element. I get a grasp of it when I do need something like that. But now I know exactly how that coexists with the translation of something like a mouse or how specific pixels are individualized.

  50. They exist on their own entity within a shader.

  51. Learning's fun. AI makes learning a little bit easier but a little bit harder at sometimes too because do you fully understand it if you know that the knowledge to understand it is just, you know, a couple clicks away. But why not use it together? So maybe something like cloud learning is perfect for you where for the most part you just want to learn how that fits into what you're doing or maybe you want to just have a better grasp of what your mind might think through of okay what is the actual answer I need.

  52. Again, I think it's learning how to work with AI and learning how to make AI do the things that you want AI to do rather than necessarily learning every single aspect of how code works. Regardless of how you learn, regardless of how often you use AI, I hope you continue to learn and keep creating.

just you here