Thursday, February 26, 2015

The Problem With "Everyone Should Learn How To Code"

Every week another article comes out frantically telling us that everyone should learn to code, that coding is an irreplaceable skill in the 21st century skill set, that you can supercharge your career if you just spent 20 minutes a day for 21 days to learn how to code, or some similar nonsense. Even Obama has joined in, stating on a number of occasions that "Everybody's gotta learn how to code." While the intent is often good, I think these sentiments are dangerous for a number of reasons, but mostly because they cheapen coding and show a complete lack of understanding about what it is.

The problem with "everyone should learn how to code, just like everyone should learn how to read and learn how to do arithmetic" is that fundamentally, coding is not arithmetic. It's not even like arithmetic. It's not like reading. And by comparing coding to the fundamental skills that form the lowest possible foundational step of intellectual pursuits (e.g., you can't study comparative literature if you've never learned to read, and you can't be a mathematician if you don't understand numbers), we perpetuate the incorrect vision of coding that most non-coders have. Which is, to put it bluntly, that it's a specialized form of typing.

Nobody in their right mind thinks that taking a semester of calculus makes you a mathematician. Nobody would ever say that 20 hours of violin lessons makes you a violinist. Yet we continue to perpetuate the belief that coding is just "something that you gotta learn", and something that just a little bit of work will allow you to learn and become proficient in.

No. Not everyone needs to learn how to code. Nor is coding something that you can learn just by spending a scant bit of time.

Do I think everyone should learn what coding is about? Yeah, absolutely. Learning about coding changes the way you think in a positive way. It changes how you approach problems and how you see the world. It changes your mental patterns. Learning about algorithms and complexity theory makes you a more rigorous thinker, and this extends into all aspects of your life. Learning about the way that software engineers approach problems can help you approach problems in any sphere of life in a more logical and productive way.

But "coding" is not the same as "syntax", and this is where the disconnect often occurs.

For instance, in Korea, the general view of programming is that it's slightly above data entry, but management doesn't quite understand (nor care) why. That is, the managers decide the requirements, and they throw it over the wall to the programmers, who, having been relieved of the difficult part (i.e., determining the requirements), simply have to type it in. This is one of the reasons why there is so little respect for engineers in Korea.

The reality could not be more different. Coding is more akin to art. If I were to tell you I wanted to see a painting of a sunset behind a mountainscape, there is no one set path to follow in order to produce the end result. Similarly, given a set of requirements for the features that you desire in a product, coding is the art and science of turning those requirements into reality. There are literally an infinite number of ways that one could do so, and computer science (it's called "science" for a reason) is the field of study devoted (in part) to how to achieve this in the best way.

When Obama participated in the Hour of Code recently (which is awesome, don't get me wrong), he apparently actually spent about an hour to produce one measly line of code. That code?

moveForward(100);

Not very impressive. Does Obama "know how to code" now? Um, no. But he claims it's "not complicated"!, explaining it as follows:

"The basic concept behind coding is that you take zeros and ones, you take two numbers, yes or no, and those can be translated into electrical messages that then run through the computer…. So all it’s doing is it’s saying yes or no over and over again, and the computer’s powerful enough that it can read a really long set of instructions really quickly."

Yeah ... um ... that was a good college try. So now that you know how to code, Mr. President, can you explain to the class what actually happens when a user inputs her personal info and presses enter on healthcare.gov?

Look, coding is fundamental to the future. There is no modern hardware without software, and there is no shortage of stuff for software engineers to do. The world runs on software. But the danger of "everyone needs to learn to code" is in trivializing and misunderstanding what coding actually is. Becoming a competent software engineer is difficult work. Becoming an amazing software engineer is rare enough that there's an extreme shortage of them.

If "everyone needs to learn how to code" gets more people to try coding who would not otherwise, then that's great. But I'd rather see the initial focus be on getting people who wouldn't otherwise try coding to give it a shot, specifically women and minorities, because many of them can be amazing engineers but never even think to try.

Coding is hard. It's difficult, it's painful, and it's often frustrating. But it's rewarding, it's artistic, and it's a fundamentally creative endeavor. It is not akin to mandatory primary subjects such as reading and arithmetic.

The world needs more coders, and it needs them now. But let's give coders the credit they deserve, and let's treat software engineering like the art and science that it truly is.

No comments:

Post a Comment