Learning to write code extremely badly is actually fairly easy — and I think everyone should be taught the basics soon after they are taught algebra.
But there is as much art as science in it…and teaching someone to become a great artist is essentially impossible. All teaching can do is reveal the artist that was already there.
- You need practice — it takes YEARS of actually writing mountains of code to get good at it. Write silly games, write code to balance your checkbook, buy a Raspberry Pi and make a doorbell that says “Hello” to your visitors, buy a Lego Mindstorms set and program a robot to do something. It doesn’t matter what you code — but you MUST do lots and lots of it.
- You need to enjoy it so much that you’ll want to do it even when you’re not paid to do it — if you don’t love it, you won’t stick with it long enough to get good at it. It’ll frustrate the hell out of you when you have to spend an entire week hunting for a bug that was caused by a simple typo…and trust me — that kind of thing happens a lot.
- You need a bunch of other skills. Arithmetic and Algebra are essential — so is a dose of boolean logic. Debugging is a difficult skill — and it’s barely taught at all in school, and hardly ever even mentioned in Programming 101 courses. Data structures and organizational skills are essential. Attention to tiny, tiny details. This is the classic job for “T-shaped experience” — you need huge depth in one narrow area (programming) and huge breadth of more shallow knowledge that covers everything.
As a job, it’s not for everyone. The best people wouldn’t ever want to do anything else — the worst usually wash out after a few months to a year.