What questions do you have about learning programming?

In the spirit of nanowrimo I'm going to jumpstart writing a book today. The goal of the book is to help librarians learn how to program. I've talked with many people about this and don't know if I'm up for the task but it's time to give it a go or stop dreaming about it.

I have some thoughts about where to start and what ground to cover but I want to be sure it answers many typical questions new coders have along the way. I also hope to develop the text online as I go, using comments, questions, and suggestions for improvements as they come in to help ensure that the book addresses its readers' needs usefully.

So we might as well start now. What questions do you have about learning to code? What goals would you want to achieve by learning? What specific problems are you unable to solve on your own now that you might be able to solve on your own eventually if you had the right kind of support along the way?

There are many options available for doing this kind of thing online but I want to start by keeping it simple. Post your questions here in the comments, hit me @dchud on Twitter, over email, phone, in person, or whatever works for you.

Please let me know what you think and we'll see where it goes. Thanks!


Three steps to surefire success!

If you could come up with answers to the following questions, I think you'd hit a home run:

1. What annoying or tedious or painstaking processes that I already know very well and have to deal with regularly could be helped by programming? (Sell the librarian on the idea of programming by situating it into existing workflows.)

2. How do I even get started programming? (Give the librarian some light-weight tools and examples for learning the love of programming.)

3. Don't I need a computer science degree? (Convince the librarian that programming is no more difficult than many of the responsibilities they already have.)

Best of luck, Dan!

These are great places to

These are great places to start. Thanks for the encouragement, Mike!

Probably a good start point

Probably a good start point would be javascript, which is platform independent - say something like some of the stuff I've just done here? Even just messing with window.alert("Hello World!); is enough?

You really want to start simple, and you avoid some barriers when there's nothing to install (this could be a local file set as a home page), then people can quickly appreciate the work they do.

hope this helps.


This is a fantastic idea.

This is a fantastic idea. I've thought that there should be such a book, but since I'm trying to get out of IT to some extent, this has never really seemed like the project for me. As someone who gets lots of questions about technology from my fellow library students, I think something I'd like to see in an introduction to programming for librarians is at least some discussion of the varieties of tools available - which languages are best suited for which sorts of projects?

Anyway, good luck, and congratulations on taking on such a useful project!


Okay, now to answer your

Okay, now to answer your question - as Mike has suggested, how to get programs/scripts to handle something repetitively is probably a common problem - if you can demonstrate it easily with files, then that would be really good.

An example of this would be - given a text file containing ISSNs (or ISBNs), do something for each (like get the details for each ISSN from WorldCat API?), and then either save that information into a database or as a set of files.

Thanks for spelling out an

Thanks for spelling out an example. That's definitely the kind of thing I've done a bunch of times but wouldn't be easy for a lot of people. Choosing where to save what kinds of data is another good point - I hope to have a section on "data storage" where we step through "this is what saving stuff in text is good for, here's an advantage of CSV files, of XML, of JSON/YAML, of RDBMS, etc.".

Good idea


when I started programming as librarian I wanted to solve the following problems:

- how to create a real bibliographic database from several thousand scanned, OCR-ed pages of a printed bibliography?
- how to create statistical reports from Apache log files?
- how to add navigation links to electonic books (in HTML formats)?
- how to index a 14 volumes encyclopaedia? (without external programs)
- how to find typical OCR errors in texts?
- how to create a searchable and browsable dictionary? (60 000+ entries)

@kiru in twitter

all the things hackable

for me, it's really the universe of hackable stuff out there which is inspiring - but then, i'm a programmer.

but i do think getting a feeling of how many things around us can be changed with a line of code should be a nice motivation: from the word macro to a javascript alert box via firebug's console.

at work, i had positive experiences with wordpress to lure people into programming: let them hack themes!

I think this is a great

I think this is a great idea.

I think developing a 'programming' way of thinking is at least (if not more?) important than actually learning to program. Knowing how you might think about problems in programming terms, what is likely to be tricky, what is going to be easy, how to analyse and breakdown problems (maybe writing pseudocode?). This was one of the ideas I had in mind when I setup the first "mashed library"event in the UK (http://mashedlibrary.com).

The next stage (as already suggested):

Having a (realistic) problem to solve
A low barrier entry

At the mashed library events we've used Yahoo pipe quite a bit - this gives a lot of immediately useful tools which can be applied to a problem and give a usable output. The project described at http://multifaceted.wordpress.com/2009/08/02/creating-subject-search-from-reading-list/ is a good example I think.

Good luck with this - I'd be quite interested in how we might bring some of this activity into the mashed library website or events, so feel free to get in touch if you have any ideas, or if there is anything I can contribute

I'm a librarian trying to

I'm a librarian trying to work this out myself right now. I tried Java last year - but it was really a bit too hard core. Did enroll for a PHP/MySQL course - but it got cancelled. Will either try this or maybe Python - a few people have suggested that this would be a good starting point.

Ideas on where to start coding too - I know I want to gain the tech skills - but am still a bit unsure as to where I could use them. Having some practical examples to work through would be good (and yes I've already done Hello World!)

Oh, this will be great.

Dan, I'd love to see such a book.

Not necessarily a place to start, but something I'd love to see addressed is this. I've tried to learn programming by various means several times, and stall out every time. There are huge advantages to me of doing this sort of thing in a group where I feel free to ask many questions. (So finding an appropriate, already existing IRC channel isn't ideal, since at some point I start feeling like a nuisance. I learn largely by asking questions aloud and working out the answers with others. That's a lot of questions.)

So: how to find like-minded souls? How to rally your colleagues to do this with you? How to approach learning to code when learning on your own isn't a great option?

I think Mike G's got it

I think Mike G's got it exactly right. I've tried a dozen times over the past fifteen years, and I've picked up some things, but I'm still a terrible programmer. Start me with a blank screen and I'm completely lost.

One reason is that it's really hard for people who know how to read code to appreciate just how hard it is for people who don't understand syntax. I want a guide that builds my knowledge and confidence very, very slowly, especially at first. Don't give me alternative ways to do something. Give me plenty of examples. Explain everything. Have the confidence to be the anti-K&R/SICP. People look at clothes on models and think, "Those clothes look great." But it's not the clothes, it's the models. People who learn to program from K&R/SICP are the programming equivalent of fashion models: they would have learned to program anyway. I much prefer Mark Pilgrim's Dive Into's, with the exception of Python (which he wrote for people who already know how to program).

Some last suggestions, which you should take with a grain of salt, or a pillar, since I've already admitted my failures. I've had the best success with basic Python, JavaScript, and regular expressions. Maybe a bookmarklet (like Udall's LibraryLookup or a simplified version of Arc90's Readability) would be a good early project.


Hi. How about...

(1) What are the pros and cons of different programming languages? What capabilties do different languages have over others?

(2) Also, whether you can actually achieve what you want without programming? eg. Owen mentioned Yahoo pipes above. It's not really programming, but it can provide some useful tools to achieve things without having to programming.

(3) How do you integrate programming languages into web pages, etc?

(3) If you're going to take the time to learn programming and it's a big step for you, it would be good to know which programming languages are likely to have longevity.

I agree this is a good idea

I agree this is a good idea and I would second the suggestion to start with some obvious scripting tasks that demonstrate how programming could help get things done.

I learned Python as part of my digital humanities degree and we took this approach---starting with tasks for manipulating texts, building concordances, doing some other NLP-ish tasks---things that supported what we were already trying to do.

Also, I think what Bill Turkel and Adam Crymble have done with The Programming Historian is a good model from another domain: http://niche-canada.org/programming-historian/

What I would like to see is a section on taking a small scripting task and building it up to a larger project, perhaps culminating in something that takes on object orientation, maybe multi-threading. Things that are a little more challenging to just pick up. These would help people go from data munging-type tasks to a program that does something a little more complex.

Another vote for Bill

Another vote for Bill Turkel's Programming Historian. It's an excellent model. He has lots of real world examples and builds upon lessons well.

Some may shudder at the thought but I suggest confronting MARC records early on, since most technical services librarians are swimming in these. If librarians can see benefits early on, they will be hooked. Python's MARC module is very approachable too.

If you are looking for stuff

If you are looking for stuff to read to help you along on your journey the Pragmatic Programmer folks are running a series of posts about nanowrimo.

Good luck w/ the writing, I know you've thought about this for a while. I found my way back into programming as a librarian mainly because I was lazy and wanted to automate some really mundane cataloging activities. I think data-munging is kind of close to my (and others) library/programming heart.

Also the web happened, which is an exciting thing to be a part of, and to be able to automate--both as a server and a client.

@Jared @kiru @robert @Owen

@Jared @kiru @robert @Owen @Trevor @Ted @Ed thanks a ton for the encouragement and all the great ideas. I'm a big fan of Bill Turkel and the Programming Historian site he and Adam Crymble put together. The idea of building up something substantial from something(s) small is a good one, too, but it'll be tricky to navigate. Practical library and text data munging tasks will definitely be a major component, if not the main focus. And there will have to be some MARC. :)

I don't have a lot of ideas for how to make this a fully engaging multi-way process yet. I mean, there are tons of options, wiki/list/forum/wave/etc., but this month I'm planning to focus just on getting a bunch of ideas down, nanowrimo-style (thanks for the PP link @edsu!). Mainly I have ideas about what to write but if I start worrying about fiddling with servers or whatnot I'll have an excuse not to write. Next month I'll start pulling those bits together and releasing some edited chunks and seeking feedback using some easy-to-use and easy-to-access approach.

All of your comments and suggestions are awesome and nobody's yet said this is a bad idea. So thanks and keep 'em coming!

This is a great idea. A few

This is a great idea. A few thoughts:

I second the suggestion to deal with regular expressions and text munging. Before learning even simple programming control structures, a lot of people working with text files of various kinds may have immediate use for understanding how even simple pattern-matching abstractions can work in search-and-replace, even in situations where people might perceive the only tool at hand to be something like Microsoft Word. The kind of pattern abstraction one gets to know through regular expressions might be a good, direct way to introduce at least one part of the value of XML.

The other thing that would be useful alongside programming fundamentals is some tips on how to learn. I understand you want to be writing rather than fiddling with setting up a server, but you know how to fiddle with servers and software, and maybe your writing could include some reflection about you go about fiddling with the stuff you don't yet know -- how to be a geek, or impersonate a geek long enough to do whatever one needs to do. I think it's still an underpublicized secret that one need not be a fully trained programmer to download, try, use, and hack things, and that this is a process of learning for which there may not be any substitutes. Your plan reminds me of Dorothea Salo's classic and still perhaps timely post, "Just Hack It." She has a concrete example and wonderfully direct language.

@Jenny @Vika @Brett I'm

@Jenny @Vika @Brett I'm hoping this would do exactly what you need - give you clear, useful examples, a progression that won't make you stall out, a community engaged in learning past the part where you might have stalled out, and a lot of opportunities to avoid failure. :)

Thanks a ton for writing in about this and please stay tuned and let me know if I'm on track. Like I said in the last comment, I hope to start publishing pieces of this next month and I'll do my best to create a structure in which you guys feel welcome and supported in working through it.

Consider as an early example

Consider as an early example a situation where the need to program is obviously the only efficient solution, e.g., you just finished creating the 700th HTML page for a large website and realize now that the a link at the bottom of every page, http://www.example.com/contacthtml is missing a period between the filename and the file extension. Write a script to fix all 700 files in one fell swoop.

Several times over the past

Several times over the past decade, I have thought about trying to learn some programming code, but as soon as I pick up a book on <insert programming language here>, I get overwhelmed by how much I need to learn before being able to do anything useful. Also, trying to sort out which programming language will be most effective is difficult when I don't know what their strengths, weaknesses, and learning curves will be. Not to mention the phantom of that horrible Pascal programming class from 1994 which still haunts me to this day.


Just found your blog today and excited to start following it; I would love a book such as this.