The Benefits of Knowing How to Code
As readers of my blog are probably aware at this point, coding is something that I enjoy doing, and something that has become very useful for me. This has primarily been with writing syntax for SPSS and Visual Basic macros in Access and Excel, which all allow for preparation of data and for running advanced analyses. However, the reason I originally learned how to code (and the reason I still do, to some extent) is separate from these immediate benefits. Here, I want to go into some of the reasons I feel it is useful to learn how to code.
A common topic people discuss when talking about learning different languages is how each language has words that others don't, and how a language can even influence the way you view the world. This is certainly true and, in my opinion, coding fits within this domain as well.
Coding languages emphasize different things and treat different pieces of information in certain ways that can influence how you think about similar data. This is especially true if you get advanced enough into coding that you begin to take efficiency into consideration. When it comes to coding, you need to be mindful of who has access to what information, what pieces of information should be unchangeable and what should be adjustable, what order should tasks be completed in and how should they be iterated (if necessary) in the most efficient way possible?
Once you're familiar with these ideas and how they work in coding, it's very easy to begin applying some of the same principles to other areas of your life. That's not to say that you'll handle things "robotically," but you can conceptualize them much more clearly and more easily identify ways to do things better.
For example, in one of my research labs we used to have a script that was used when calling participants, and the script had blank spaces within it to allow for filling it in as the RA spoke with the family. However, this led to some challenges: the spaces were too small because most of the page was taken up by the script, fields were easy to skip as the conversation jumped around rather than following the linearity of the script, it was hard to know what was supposed to be written in each field, and so forth. After seeing the situation, I thought of the script as a "static" variable (i.e., something unchanged that should be accessible separate from anything being manipulated), which prompted us to print the script out separately and put the blank fields onto a separate sheet of paper that was laid out in a more user-friendly way.
That's a small example, but small improvements in usability and efficiency like that can make a big difference in frustration, time waste, and...well, sanity!
Another benefit to learning how to code is that you become much more familiar with different toolsets that are available to you. When coding, you learn about different programs that are used to code, which gets you familiar with more tools from the outset. But, potentially even more useful, is that you get a sense of what types of things are possible with the code. You begin to think in terms of what can be solved with code, and you are more readily able to identify "this is a situation that a program would be able to handle." In that situation you don't even need to write the program yourself, just take a look at whether someone else has! Or, as you may find with something simple (e.g., find-and-replace for documents), you may find out that it's been available to you all along.
If you struggle with organization, that struggle will be tested very early in learning to code. As code gets longer (and it doesn't even need to be very long), the complexity of it increases significantly. There are standard practices to help make code easy to navigate, so you are forced to learn these standards and apply them yourself (or else get frustrated every single time you open a program and can't remember where you left off or what it does; sound similar to other areas of your life?).
Again, this is something that can translate easily into your day-to-day life. For long-term tasks (e.g., working on a manuscript, conducting literature reviews), you will be more familiar with procedures people commonly use to help manage large, complex, and multi-piece works that are being worked on by multiple people. These procedures have become standard for a reason: they work! By utilizing the same principles, you can make your other work flows much smoother.
When learning to code, there is a tradeoff that becomes clear very early in the process: time spent coding a program, vs. time it would take to do the task manually. As you get better with coding, the scales will obviously tip in favor of coding. However, more important for the purposes of this post is the fact that coding pushes you to think about the long-term process of your work, to anticipate how things will go, and to figure out how things will fit together. You can then make informed decisions about what will be the most efficient route, and you can prevent many headaches down the road.
This is especially true if syntax will be a component of your future plans. In research, syntax is commonly needed but the study is rarely designed around making the syntax easy to write. If you know you'll need syntax in advance, and you know how to code, you can decide what aspects of the study you'll need syntax for and then design the study and methods in a way that the coding will be easy and things will go smoothly. If you don't, well...you end up needing to write something like this. Please don't put yourself in that position if it's avoidable.
Finally, there is the obvious piece of knowing what can be delegated to the software. If you're familiar with the types of iterative tasks that computers are good at and can understand easily, you can write a program and delegate the work to it. That improves efficiency and accuracy (though there is always room for human error in the code writing, so best still have someone proofread things and check that it worked appropriately!). But this isn't only true for delegating to computers. Because you need to be conscious of the pros/cons of delegating and the strengths/weaknesses of the person/thing you're delegating to, you'll begin to be more successful at delegating in general!
Overall, I think this is a good summary of the benefits of learning how to code, even for people who may never need to write code for their work! Remember, even if you don't, someone (like me) may need to for you, and we greatly appreciate forethought into making that process easier for us.
If you're interested in getting started with coding, there are a lot of free resources available online, like codecademy. If you're just getting started, I recommend looking at C++ or Java. If you learn either of those, which are extremely popular and have a lot of documentation online, it will be much easier to pick up other languages down the road. (Though I should admit, I'm biased because C++ and Java are the main programming languages I know currently).
Have you learned how to code and found other benefits in your life as a result? Have questions about how best to learn? Let me know in the comments!