We won’t learn how to do step 4 until the next chapter, but we bet you can already recognize when the code is blatantly wrong. For example, Copilot might give you only comments to fill the body of the function. Comments don’t do anything —- they are not code! —- so a bunch of comments with no other code is clearly not the right thing to do. Or it might just write a single line “`return -1`”. Or, our personal favorite, “`Your code here`”. Copilot learned that one from us professors when we provide students partial code and ask them to write the rest with “Your code here”. Those are all obviously incorrect, but in the next chapter, we’ll go over how to read code, so you can more quickly spot when more complicated code is incorrect and, perhaps more importantly, see where and how to fix it. In later chapters, we’ll keep expanding on this cycle to include effective debugging practices, and we’ll keep practicing how to improve prompts.
0 commit comments