What do you actually need to learn for coding to be useful to your non-software-development job?This article offers a guide.
Though I’ve been traditionally trained (completing a computer science degree), I disliked working as a software developer.
In changing careers, coding initially became completely useless.
But over time, it evolved into a way of tackling practical problems in other fields of work.
Armed with this perspective, I believe “coding” breaks down to seven separate skills, which can be independently cultivated.
Three of these don’t even require a computer.
Writing codeIt doesn’t have to cost money, but learning to code will take up time, so it’s worth investing wisely.
First, picking a coding language.
Some folks love debating the merits of different languages, and in a future incarnation, you might actually care.
But in this life, start with Python (here’s how you install it).
It’s been around for thirty years, and people like it for a reason.
Two reasons, actually: one, it reads almost the way people talk.
Two, it thrives on a huge open-source community, yielding ready-made, wildly useful, entirely free code packages, which save a ton of grunt work.
Essentially, its import command is the muggle world’s summoning charm.
Thus, “learning to code” is both learning to write code and to use existing code packages.
Like any software on your computer, code packages need to be installed before you can use them.
This is done with zero hassle using a command called pip.
A sea of training materials is available, most of which will focus on teaching syntax: how to write lines correctly, so they can be turned into a working programme.
Frankly, you can do quite a lot even with a limited foundation.
Doing what, though?Most learning materials will use examples that don’t relate to your real-world problems.
I’d say, beware of coding too much in the abstract.
Practical tip: Most of what we do with computers still involves reading websites and using Excel, Word and PDFs.
Right from the onset, set your sights on a specific tiny task, which has something to do with these.
Maybe scrape a website, or copy some numbers from one spreadsheet to another.
Getting a good development environmentWithout a workable environment, coding skills are practically of no use.
You have to write your code somewhere, right?.And that code needs to be turned into something a machine can understand.
Then you want to run your programme.
When it fails to work — and it will — you want to be able to fix it.
If doing all this requires being part-cyborg yourself, coding can never become widely accessible.
Yet it seems only coding nerds — ironically those most tolerant to shitty infrastructure — talk about integrated development environments (IDEs).
Practical tip: I suggest installing the PyCharm Community Edition.
It’s a free version of a solid commercial product, and it reeks quality.
The editor is slick and the debugging mode’s friendly, so it’s quicker and easier to spot mistakes.
(here’s a guide with screenshots on how to install and get started.
Developing an input-output mindsetSaying “We want to build an internal analytics tool” is different than saying “Let’s segment all the people who clicked on this week’s newsletter according to how long they’ve been active clients.
”Inputs are the data you can get a hold of.
Outputs are the sort of processed information you might find useful in your day-to-day work.
And an input-output mindset gets you thinking about the type of data you need in order to get the solution you want.
Thinking about inputs and outputs will point to stuff you may have not considered initially, like the data you need to collect and clean.
But figuring out the inputs and outputs won’t necessarily clarify the solution that gets you from one to the other.
Some problems are just harder than others.
Luckily, a lot of problems have been solved (at least partially) by smart folks.
Sometimes, someone has even written it up as ready-to-use code.
Like hitchhiking, it might not get you all the way, but it’ll leave you within walking distance.
Practical tip: To cultivate an input-output mindset, practice framing your business tasks in terms of counting very specific things, or searching for specific types of information.
Breaking down a problem into a series of stepsA LOT of computer science boils down to practicing how to break up problems into ever-smaller tasks.
Ideally, you want to reduce a problem to a series of tasks, which you (or better yet — someone else) have already figured out how to solve.
All you’re doing is spelling out a recipe to manipulate your ingredients (= your input) into your final dish (= your output).
At first, the process is broken down into high-level tasks.
But then each task is further broken into simpler steps.
Eventually, you’re bound to end up with a list of knucklehead instructions.
Practical tip: Figuring out what you want done is different to knowing how to do it.
To solve the latter, go to your favourite search engine and type in: “stackoverflow python how to <insert task>”.
Stack Overflow is a Q&A website where coders of all levels ask questions about how to do stuff, and receive working bits of code as answers.
It functions so well partly because its founder, the prodigious Joel Spolsky, understood that for the platform to work, coders of all levels should feel welcome.
Abstracting a problem into lower-level data conceptsCoding is a representation challenge, as you simultaneously juggle two different views of your data: the high-level human way, and the low-level machine way.
Good news awaits; at least when starting out, you’re unlikely to be short on computing power or memory.
This allows you to get comfortable with very few basic building blocks: numbers, lists, tables, strings (which are how text is represented), and dictionaries.
Having used Excel, you’re at least familiar with the idea of the first four types, and just need to learn how to manipulate them in Python.
The only new concept might be the dictionary.
(this video is a decent introduction.
Don’t worry about catching every single detail, just focus on the big idea).
Practical tip: When you come across data in your work, start thinking about how you would represent it, using one or more of these objects.
Cultivating debugging skillsBugs are mistakes in the code that cause your programme to either to break down, or to deliver the wrong result.
The first type often happens when the programme encounters an input it was not prepared to handle.
For example, you might read a database, and suddenly client #59 doesn’t have a first name record (because someone forgot to type it in).
If your programme assumes there will always be a first name, it will now break.
The second type of bugs are sneakier, because they point to a logical flaw in the implemented solution.
Fixing these bugs may require even more patience.
Which stinks, because when debugging you generally have NO patience.
No one wants to debug, and if the stupid machine can’t understand what you so clearly explained, that is not your fault.
Yelling this never seems to fix the problem, though.
Eventually, you’ll have to buckle down and figure it out.
It’s tempting when writing some new code to just run it and pray that it works.
But it’s good practice to step-through it line by line at least once.
By walking through it alongside the machine, you can see what it knows at any point in time.
(Here’s a video showing how it’s done).
Practical tip: When your code breaks, the first error message will tell you on which line of code this happened.
You’ll want to know what the programme knew just before that, so that’s a good spot to print out variable values.
Your IDE will have additional debugging features.
PyCharm offers a first steps tutorial, which guides you through creating a short programme and then debugging it, along with screenshots.
Sense checkingCongratulations!.Your programme worked.
It now does exactly what you want it to do.
Or does it?Well, you’ve taught the computer to do something.
You’ve tried it a couple of times, and it seemed to work perfectly.
But, generally speaking, there’s no guarantee that this will happen in every case.
You didn’t do anything wrong — the bigger the project, the tougher this problem becomes.
Over time, as your inputs change, your programme will flow through different paths, and it may reveal quirks or omissions.
Practical tip: To test your programme, write a script that calls it with all kinds of inputs, and see what you get.
Also, don’t get complacent with your code too quickly.
Keep paying attention to the outputs and ask — is it true?.does it make sense?.does it align with stuff I know and trust?You can do thisDistilling the general “coding” skill into specific components is important because it helps define how to get progressively better at using code for real-life challenges.
When someone sets out to become a professional developer, training is invariably geared towards the demands of the job.
It makes sense, I suppose, in the same way you’d train someone to become a lawyer or a marine biologist — not both.
But it’s also insular.
An entire business world lies outside the tech sphere; both lawyers and marine biologists have problems that could be tackled with software.
Enterprise software is not always the solution.
Expensive and cumbersome, it’s designed for companies that managed to scope out an operational problem, and are willing to pay someone to solve it.
For more agile practices, there’s a place for professionals for whom coding is a problem-solving skill.
Except, hardly anyone teaches you how to become that kind of coder.
I hope this article offers an initial roadmap to get you started.
Good luck!.. More details