When I started working on the new edition of First head C# In 2023, AI tools such as Chatgpt and Copilot were already changing the way developers write and learn code. It was clear that I needed to cover them. But that raised an interesting challenge: how is new and intermediate developers taught to use AI effectively?
Almost all the material I found was aimed at upper developers, people who can recognize patterns in code, detect subtle errors that are often found in the code generated by AI and refine and refractor the output of AI. But the audience for the book, a developer who learns C# as its first, second or third language, does not yet have these skills. It became clearer that they would need a new strategy.
Learn faster. Dig deeper. See further.
Designing an effective AI learning route that worked with the head of the head of the head, which involves readers through active learning and interactive puzzles, exercises and other elements, took months of intense research and experimentation. The result was SensorA new series of practical elements that I designed to teach developers how to learn with AI, not just generate code. The name is a play in “Sensei”, which reflects the role of the teacher or instructor instead of only one tool.
The key realization was that there is a big difference between use AI as a code generation tool and use it as a learning tool. That distinction is a critical part of the learning route, and it took time to completely understand. Sens-Ai guides students through a series of incremental learning elements that make them work with AI immediately, creating a satisfactory experience from the beginning while progressively learn the incorporation skills in which they will support as their development skills grow.
The challenge of building a learning route that works
I developed sens-ai for the fifth edition of First head C#. After more than two decades of writing and teaching for O’Reilly, I have learned a lot about how new and intermediate developers learn, and so importantly, which runs them through. Somehow, AI-AI coding is just another ability to learn, but it comes with their own challenges that make new and intermediate students difficult. My goal was to find a way to integrate AI on the learning route without letting the learning process short circuit.
Step 1: show students why they can’t trust AI
One of the biggest challenges for new and intermediate developers who try to integrate AI in their learning is that an excessive dependence on the code generated by AI can really prevent them from learning. Coding is a skill, and since all skills are needed, therefore First head C# He has dozens of practical coding exercises designed to teach specific concepts and techniques. A student who uses AI to do the exercises will have difficulty developing those skills.
The key to use AI safely is Trust but verifyThe explanations and the code generated by AI may seem correct, but often contain subtle errors. Learning to detect these errors is essential to use AI effectively, and developing that ability is an important trampoline on the way to become a senior developer. The first step in Sens-Ai was to leave this lesson immediately. I designed an early sens-ai exercise to demonstrate how AI can be confidantly wrong.
This is how it works:
- At the beginning of the book, students complete a pencil and paper exercise where they analyze a simple loop and determine how many times it runs.
- Most readers get the correct answer, but when they feed the same question in a chatbot of AI, AI almost never does well.
- The AI generally explains the logic of the loop well, but its final response is Almost always wrongBecause the AI based on LLM do not execute code.
- This reinforces an important lesson: AI can be wrong, and sometimes, you are better to solve problems than AI. Seeing Ai to make a mistake in a problem that already solved correctly, students immediately understand that they cannot assume that AI is right.
Step 2: show students that AI still requires effort
The next challenge was to teach students to see AI as a tool, not as a crutch. AI can solve almost all the exercises in the book, but a reader who lets AI do that will not really learn the skills that came to the book to learn.
This led to an important realization: writing a coding exercise for a person is exactly the same as writing a notice for an AI.
In fact, I realized that I could try my exercises literally hitting them in an AI. If the AI could generate a correct solution, that meant that my exercise contained all the information that a human student needed to solve it as well.
This became another sens-ai key exercise:
- Students complete a full page coding exercise following step -by -step instructions.
- After solving them, they hit all the exercise in an AI chatbot to see how it solves the same problem.
- The AI almost always generates the correct answer, it often generates exactly the same solution they wrote.
This reinforces another critical lesson: to tell an AI what to do is as difficult as telling a person what to do. Many new developers assume that fast engineering is only writing a quick instruction, but sens-ai demonstrates that a good message of AI is as detailed and structured as a coding exercise. This gives students an immediate practical experience with AI while teaching them that writing effective indications requires real effort.
By making the student see that Ais can make mistakes, and then make them generate a code for a problem that they solved and compare it with their own solution, and even use the source of IA code ideas for the refactorization, they obtain a deeper understanding of how to interact with the AI critically. These two Sens-Ai opening elements laid the foundations for a successful learning path.
The sensor-AI approach: make a learning tool
The final challenge in the development of the sens-ai approach was to find a way to help students. Develop the habit of interacting with AI in a positive way. Solving this problem required me to develop a series of practical exercises, each of which gives the student a specific tool that can be used immediately, but also reinforces a positive lesson on how to use AI effectively.
One of the most powerful characteristics of AI for developers is their ability to explain the code. I built the following sens-ai element around this causing students to ask AI to add comments to the code they just written. As they already understand their own code, they can evaluate the comments of the AI, checking if the AI understood its logic, detecting where it went wrong and identifying gaps in their explanations. This provides practical training to boost AI while reinforcing a key lesson: AI does not always do well, and review its production critically is essential.
The next step on the sens-ai learning route focuses on using Ai as a research toolHelp students explore C# topics effectively through fast engineering techniques. Students experiment with different characters of AI and response styles, casual explanations versus precise, bullet points versus long answers, to see what works best for them. They are also encouraged to ask monitoring questions, request reactive explanations and request concrete examples that they can use to refine their understanding. To put this into practice, students investigate a new topic of C# that was not previously covered in the book. This reinforces the idea that AI is a useful research tool, but only if it guides it effectively.
Sens-Ai focuses on understanding the first code, generating code secondly. That is why the learning route only returns to the code generated by AI after reinforcing the good habits of AI. Even then, I had to design exercises carefully to ensure that AI was a learning help, not a replacement for it. After experimenting with different approaches, I discovered that generating unit tests was a next effective step.
Unitary tests work well because their logic is simple and easy to verify, which makes them a safe way to practice coding assisted by AI. More importantly, writing a good message for a unitary test forces the student to describe the code he is testing, including his behavior, arguments and type of return. This naturally develops strong impulse skills and positive habits of AI, encouraging developers to carefully think about their design before asking AI to generate anything.
Learning with Ai, not just use it
AI is a powerful tool for developers, but using it effectively requires more than just knowing how to generate code. The biggest mistake that new developers can commit with AI is to use it as a crutch to generate code, because that prevents them from learning the coding skills they need to critically evaluate all the code generated by AI. By giving students a step-by-step approach that reinforces the safe use of AI and the great habits of AI, and reinforce it with examples and practices, sens-ai offers new and intermediate students an effective learning route that works for them.
AI assisted codification is not about shortcuts. It is about learning to think critically and the use of AI as a positive tool to help us build and learn. The developers who get critically involved with AI, refine their indications, question the production generated by AI and develop learning habits of the effective ones will be the ones that benefit the most. By helping developers include AI as part of their skills set from the beginning, sens-ai ensures that they not only use AI to generate code, but also learn to think, solve problems and improve as developers in the process.
On May 8, O’Reilly Media will stay Coding with AI: the end of software development as we know it—An Live Virtual Technology Conference that highlights how AI is already overlapping developers, promoting productivity and providing real value to their organizations. If you are in the trenches that build tomorrow’s development practices today and are interested in talking in the event, we would love to know about you before March 12. You can find more information and our call for presentations here. Do you just want to attend? Register for free here.
#Bridging #Learning #Gap #OReilly