How I Learned Code programming

Being in Steve Ramsay’s Electronic Text class has me thinking quite a bit about humanities scholars programming and knowing code.  In the History Department, digital historians or those interested in digital history/humanities seem eager to embrace the potentials that computing offers historical research, but almost no one seems interested in learning how to write good code.  Those willing to learn code limit their knowledge to HTML and some basic CSS, which, I would argue, is good enough.  But I’m a bit shocked at the number unwilling to learn other languages: Ruby, PHP, or Javascript, for example.

Historian or Computer Scientist?

Many exceptional programmers began writing code in their youth.  Although I had some contact with code, I was much more of a hardware guy, building my own computers or tearing down old ones to figure out how they worked (or why they quit working).  I first encountered HTML around the time I was in seventh grade, picking up the very basics simply out of a desire to learn how to build websites.  My only other exposure to programming came in high school, when I took classes in BASIC and Visual Basic and continued learning about HTML, building sites in Dreamweaver that included little hobby projects and, eventually, a major overhaul of my dad’s business website.

History also always appealed to me, and in my senior year in high school I decided to study the subject.  My original plan was to get a doctorate in history and apply my skills and knowledge to government service.  This changed when I got to college and decided that being a professor would be a pretty nice gig.  Computers, meanwhile, never factored into my education in college.  I did not take a single computer science class while I was an undergrad at South Dakota State, instead focusing my efforts on history and economics.  I remained interested in technology, following tech news blogs and Leo Laporte, but computers – and programming – never factored into my college studies.

Only upon joining the History Department at the University of Nebraska-Lincoln did I reconnect with computing.  I learned about a new field in history called Digital History, where historians were attempting to apply computing technology to historical scholarship.  I drank the Kool-Aid, became (and still am) an evangelist for digital humanities.  My first course was an undergraduate/graduate class that introduced the concept of Digital History.  While the undergraduates built small-scale projects based off templates, us graduate students delved into theory and tools.  My next step was a graduate seminar in Digital History, were we continued to discuss and debate theory and tools, but also introduced basic concepts for code, standards, usability, and narrative.  In the fall semester of 2009 I returned to the source: HTML.  I had missed a lot in the four-plus years I was (largely) removed from web programming and knew next to nothing about CSS, PHP, and Javascript. I taught myself the latest in HTML standards as well as CSS – and loved every minute of it.  Indeed, I even found myself much more interested in writing code and designing than I did the legwork of historical research.

I developed Framing Red Power, an analysis of mass media coverage of the Trail of Broken Treaties and that eventually became a digital component to my Master’s thesis.  I also helped my colleagues in learning new skills in HTML and CSS.  Out of the graduate seminar emerged several new, small-scale digital projects pursing original analysis and enlightening use of tools to illustrate new arguments about the past.  My evangelism was set: at conferences I expounded on the benefits that digital scholarship provided for research, fumed at accusations that what we were doing was akin to Cliometrics (or worse, that what we were doing could just as easily be done with pencil and paper), and illustrated how digital humanities could completely change the way scholars do research.  And I wrote code.

I continued learning more about CSS and began teaching myself the latest in web standards, HTML5.  I taught myself the basics of XML and TEI encoding and began incorporating it into my digital scholarship.  With a research assistantship during the fall and spring of 2008-2009, I worked on UNL’s Digital History project and was forced to learn PHP for a directory of digital scholars we were building (the project was derailed when hackers exploited a WordPress flaw and injected our development server with spam.  The directory will soon be launched.)

There are two things I love about programming: one is the challenge, the pursuit of problem-solving; the other is the ability for programming to make my life easier.

PHP did just that.  I began learning about modular web construction, the ability of PHP to make updating websites a simple matter of changing a single file.  But I also enjoyed the challenge of writing good code and making code do what I wanted.  Server-side scripting became an easy way to maintain websites, but I also learned how to interact with databases and picked up skills with MySQL.  It was around this time that I also left the Windows operating system and began using Linux.  I familiarized myself with the Unix filesystem, with the command line, with SSH, with vim.  I’ve since adopted the MacBook Pro as my primary operating system, in large part because of OS X’s Unix backend (which led me, some time ago, to wonder how long before I leave behind the GUI for the command line).

More Recently

How do I continue to learn?  I simply dig in.  Computers are best learned not though books or lecture, but by hands-on experience.  My contact with computing and the humanities has also ignited a new research agenda that’s driving me into the history of computing and programming (more on this in a future blog post).

I learn and I write.  I trace other’s code to see what each line of code does and how everything fits together.  For the web, I use Firebug to debug or break down front-end development, in other cases I use Google (Parse Error: syntax error, unexpected $end? Google. NoMethodError? Google.)

Things brings us back to Steve Ramsay and the Ruby language.  Why are so many of my colleagues unwilling to learn how to program?  Naturally, part of the problem is time: some of my colleagues are a year or less away from finishing their dissertations, and out of necessity their energies are focused elsewhere.  Others are perhaps unsure of how they would use it or, worse, fear programming altogether.  Or maybe I’m just an ubergeek.  Whatever the reason, programming offers a way of thinking differently about the work we do as humanists.  I don’t see most historians becoming (as Bill Turkel would love) Programming Historians.  But I would argue that digital humanists should at least be familiar with code, to understand its limitations and possibilities, in order to have better dialogue with the experts.

Other colleagues and instructors around me are not so sure.  They would argue that programming is a skill best left to those who know it best, those who have studied the language(s) necessary for humanities computing, and that our energy better poured into our “traditional” scholarly roles of interpretation, argument, and evidence.  I understand the point to his argument, and I don’t expect most humanists to be as geeky as I am.  But I’m also beginning to wonder if digital humanists need to understand code more thoroughly.  That perhaps understanding how and why something works is just as important as anything else we do with computers.  Understanding code doesn’t just help us communicate with those that have studied it, but actually empower us to make good content for our audiences and users.

Getting Started

Becoming a good programmer means lots of practice and lots of failure.  Don’t be discouraged, there is no other way: programming takes time.  And it’s really hard.  Dig into something you find interesting.  In my case, it all started with wanting to know how websites worked. Perhaps you’re interested in how WordPress works, or curious about how Chromium functions.

Choose the right environment: you’re better off on a Mac or Linux because Cygwin on Windows is a painful experience.

  • Learn Unix and how to navigate the filesystem
  • Learn the basics of vim (and study up for the inevitable debate)
  • Figure out how to use FTP and SSH
  • Install your own blog, which will introduce you to PHP, MySQL, databases, Apache servers, and a whole lot more
  • Take something you’re interested in and build something for it.  You might be interested in counting word frequencies for a body of text, for example.  This can be done in several programming languages (here’s my elementary Ruby code to achieve just that).
  • Read programming blogs and sites like Reddit /r/programming and Hacker News
  • Read How To Become A Hacker
  • Read Why’s Poignant Guide to Ruby
  • Read The Cathedral and the Bazaar
  • Read Participating in the Bazaar
  • Look at code from open source projects to learn how things work, then change something and see if it still works.  If it does, understand why.  If it doesn’t, understand why.
  • Use Firebug or Chrome’s built-in developer tools to learn the language of the web
  • Hang out with other smart programmers and coders. Don’t be afraid to ask questions.
  • Fill a bookshelf with technical reference books.

8 min read · 1554 words · Published · Subscribe · Share

Jason Heppler is a digital humanities developer living in Omaha. More »

Do you want to discuss this?
Try mentioning @jaheppler on Twitter or, or email me.