The Art of Learning in the AI Age
A programmer always has something new to learn—a new language, a different way of structuring code, or the low-level details of how a specific technology works. In this regard, a novice and a professional developer are the same: both are eternal students. Therefore, understanding how to learn is a vital skill for both beginners and professionals.. We are living in the age of generative AI, and while these tools are incredibly powerful, we must use them mindfully.
The true purpose of exercises
It might sound counterintuitive, but exercises are not meant to be "solved." If the only goal were to have a solution, you could simply ask a friend to do it for you. AI tools can be excellent teaching assistants, but you must be careful. If you are more interested in finishing a task than in learning from it, the AI tool will happily generate an answer. But just like having a friend do your homework, you won't gain any knowledge from it.
Exercises are opportunities to practice. It is through this practice that you develop your problem-solving skills. You will be tempted to let the AI write the code for you, but if you want to grow, you must resist that urge. If your objective is learning, do not use AI to write code you don't understand—unless you intend to study that code until you do.
Learning to program is hard
You won't learn German or Chinese just by reading a grammar book or a dictionary. Similarly, you won't become a good programmer just by reading about syntax. At the start of your journey programming won't be intuitive; it will take quite a lot of practice to start thinking like a developer. Try to find a path that makes the journey engaging. It is a mental workout, and the first steps are often the hardest. If you find a particular concept difficult, don't despair—it’s difficult for almost everyone. Look for a different explanation or a simpler example, but remember: it will always require commitment.
The main limitation to your progress isn't a lack of great online materials, there are plenty of them. It is your own time and dedication. Quality learning materials are useful, but the key to becoming fluent is practice, there is no shortcut. Even for professionals, coding is rarely "easy." It involves continuously solving problems within complex systems. It might be a joyful process, but it is the specific joy of solving difficult puzzles.
Generative AIs are excellent teachers
Instead of using AI to do the work, use it to help you understand the "why" and "how." Here is how to use AI as a tutor:
- Generate Tasks: Ask the AI to propose problems or projects suited to your current level. You can ask for variety, from logic puzzles to small applications.
- Debug: Ask the AI to write a snippet of code with intentional errors, then try to fix them. Debugging, the act of finding and solving errors, is a fundamental skill. It’s often said that programming is 10% writing and 90% fixing what you wrote. While that might be a slight overstatement, it’s closer to the truth than most beginners realize. Also, fixing problems might be easier than writing all the code to solve an exercise from scratch.
- Get Hints: If you’re stuck, don’t ask for the solution, ask for a hint, such as the name of the concept you might be missing, or a tiny example. Only ask for the full code as a last resort. If you do, try to understand the code. Spend time predicting how it will behave before you run it. Ask the AI to pose questions to make sure that you understand it.
- Review: Once you’ve written your own code, ask the AI to critique it. Ask questions such as: "Would a professional write it like this?" and "Is there a different or better way to solve the problem?" Getting a second opinion is a standard part of a professional developer's workflow.
- Explain: If you encounter a block of code or a specific function that confuses you, ask the AI to break it down step-by-step.
Limits and traps of AI tools
Don't trust them blindly. AIs "hallucinate", they make things up, especially when dealing with unusual problems. They also tend to be "agreeable"; they may follow your lead even if you are heading down a suboptimal path. Ask the AI to be critical of your approach. More importantly, don't trust anyone implicitly; even the most experienced programmers can be wrong. Your goal is to develop the knowledge and intuition to judge the code for yourself.
As a general rule: every AI suggestion must be verified. Always ask for a test case, an example of input/output, or a minimal snippet to prove that the suggestion actually works.