When people say that they’re learning to code, they usually mean that they’re learning to make websites or mobile apps. Code schools typically teach basic Ruby on Rails and Node.js, aiming to prepare students for junior software development roles. But, if that’s not what you’re aiming for, these crash courses won’t help you.
In general, I think people would benefit more from learning to write simple throw away scripts to automate tasks on their computers. Learning to code shouldn’t just be about becoming a software engineer. It should be about being more technoliterate and about improving productivity.
Novice coders should be encouraged by two observations about these disposable programs. First, even when code is poorly written, the end product is usually the same. Second, I hardly ever need to understand any concepts beyond arrays and dictionaries to write them.
While understanding theory from my CS degree definitely helps me write better software, for simple programs the rate limiting factor is human programming time, not big O notation. In other words, writing slow code doesn’t make a difference. For example, if you use bubble sort when you should have used quick sort for a small data set, the difference in runtime will barely be perceptible.
In the same way that not everyone who knows how to write prose will become a professional author, not everyone who can code will become a professional software developer. Instead of writing programs from first principles, people uninterested in pursuing professional software development should start by learning to use packages, libraries, and frameworks. Small victories and solutions to personal problems will serve as good motivation to keep learning.
Unfortunately, learning to write these disposable scripts can be hard when you don’t know where to start. Because these programs are highly specific to particular tasks, people typically don’t share them on sites like Github.
You need to have the right mindset. Anytime you’re asked to perform the same task more than once, ask yourself whether there’s a way to automate it. Here are some examples of the types of scripts you should write.
shift, but the computer will make sure everything looks the same.
If you do this, you’ll join the few who use computers as more than glorified typewriters, internet browsers, and television sets. Please email me if you’re interested in having me write up one of these examples. I’m happy to write a follow up.
panglott on HN for recommending automate the boring stuff (python).