Academic journal article Library Technology Reports

Chapter 6: Learning to Code

Academic journal article Library Technology Reports

Chapter 6: Learning to Code

Article excerpt

Whenever I speak on library code issues, one of the first questions I get is, "How can I learn to code?" If that was your question, this chapter is for you. I'll discuss respondents' recommendations for learning strategies and resources. I'll also cover the various forms of workplace support librarians have received in learning to code so that you know what to ask of your manager, or what to provide if you are a manager.

Learning Strategies and Resources That Coders Recommend

I asked survey respondents what they would recommend to people who'd like to learn to code. The recurring themes were these:

* find a project

* rely on Google and existing code

* write documentation

* persevere

* find a mentor

Of these, finding a project is the most important. It doesn't matter if it's for work or for fun, though it will be easier to get professional development support for work projects; it just has to be important to you. Having a goal you're committed to will help you persevere through the inevitable challenges (see below). It will give you a sense of accomplishment when you make progress; it may even have real-world impact, which is tremendously motivational for many coders. It can also provide natural answers to questions like "What programming language should I learn?" and "What do I need to learn next?"

What sort of project? You may already have one in mind, in which case, start there! If not, automate a repetitive task, simplify a bothersome workflow, or improve some element of user experience. Or, of course, take on one of the projects in this report! Most of them can be accomplished in under a hundred lines of code; you'll need a solid grasp of programming fundamentals, but you don't need a deep grounding in computer science or years of experience. Write one from scratch, rewrite one in your preferred language, or modify one to work better for you; the scripts in this report are intended to be a springboard for you. Whatever you choose, make it as small as possible (or break it down into small parts) so it doesn't get too overwhelming, and feel free to incorporate working code snippets you find online. The sooner you can get something interesting working, the sooner you'll feel rewarded and capable.

This brings us to the second piece of advice, rely on Google and existing code. Modifying existing code is not cheating! There's a good chance someone else has already written code to do most of what you want; the ability to read and edit others' code can get you a long way, even if you never write your own programs from scratch. Even experienced programmers regularly look up syntax details and copy and paste code snippets from around the web. Googling for something like "[programming language] [problem keyword] example" will often turn up helpful code samples and Stack-Overflow advice. Spending some quality time browsing library coders' GitHub repositories can yield lots of useful code and inspiration, too. The Code4Lib wiki page "Libraries Sharing Code" is a good starting place. Many of the people cited in this report have GitHub repositories as well.


Libraries Sharing Code

Not familiar with GitHub? You don't need an account to browse and download code. However, it's more useful once you have an account so that you can fork repositories (i.e., make your own copy to edit) and master a few basic commands. The LITA Library Code Year Interest Group has a hands-on tutorial available.

Learn GitHub tutorial

Google, StackOverflow, and (to a lesser extent) GitHub work as learning tools because people have invested time in documentation. Pay it forward! Writing up your own learning process can be helpful to those who come after you--notably including yourself in six months, when you've forgotten everything you were thinking today. …

Search by... Author
Show... All Results Primary Sources Peer-reviewed


An unknown error has occurred. Please click the button below to reload the page. If the problem persists, please try again in a little while.