Adriano G. Platania · Computer Science
Algorithms you can watch think.
The home of my OCR GCSE & A Level books, a living library of animated algorithms, and a sandbox for curious students. No accounts. No ads. Just CS.
- 2 books
- Visualisers growing weekly
- 0 logins
A note to anyone learning to code
You don't need to know exactly where you're headed before you start. That's rare anyway, in life as much as in writing a program. What you need is the courage to take a wrong turn and try again.
Every attempt that fails teaches you something, and it builds the thing psychologists call coping: the capacity to handle the good moments and the hard ones. That's true of life. And it's literally true every time you write a line of code and the program doesn't run on the first try.
AdrianoAn old story about looking
One night, a man comes across another searching the ground under a streetlamp. "What have you lost?" "My keys." He stops to help. After a few fruitless minutes he asks: "Are you sure you lost them along here?" "No, I dropped them further back, on the dark path. But at least there's light here."
Bugs behave the same way. When an error won't show itself, it's rarely because the problem is unsolvable. It's because you're searching where the light is: the line the traceback pointed at, the function you understand best. But an error message tells you where your program stopped, not where you went wrong. The real mistake is often further back, in the dark. When a search comes up empty, don't just stare harder under the lamp. Go back and walk the dark path.