Scientists and Programming

McClary was an expert in writing long, complex programs in C. His method was to take a few days to absorb the design, plot out his approach carefully, and then implement his plan in a long stretch of sustained concentration. According to his colleagues, McClary took about three times as long as most programmers to come up with a first version – but his first try usually worked.

I’m currently programming a new critical thinking App for a study. I’m not going into the details here, sufficient to say that it takes up a lot of time and I owe a great debt to sites like stackoverflow, which provide me with solutions to coding problems I could not have solved myself.

The question I frequently get asked is why program it yourself? You’re a psychologist, there are programmers in the IT department who could do the same much faster and better — and you could focus on your ‘real’ work.

Well, for one, because that is my real work. I want to support psychological processes with (mobile) media, but to do so I do not only need to know how cognition works and how it can be biased, but also what media is capable of. Programming affords me with exactly this experience.

I get to find out what is possible and what is not. By designing and programming the interface and the pseudo intelligence behind it, I further refine the ways I want to support the psychological processes. It’s only when the App is finished that I could reasonably have gone to the IT department and say: “Here, this is how I would like it to be.” Not because I did not plan it in the first place, I did, but because when implementing it and testing it I got new ideas, better ideas, more refined ideas.

So, I’m a proponent of having psychologists with at least some programming experience. And I’m not alone. Walker K. Beagley wrote an interesting piece in an 2001 issue of Behavior Research Methods, Instruments, & Computers titled: “Why we need more psychology programmers”. He argues that science improves with the quality of the/new tools and psychology is no different here. He also stresses the need not to be limited by other people’s imagination.

Programmers aren’t psychologists, they code very well, but often without an understanding of a theory behind it. This is where psychologists excel — as Lewin said: “Nothing is as practical as a good theory.” and psychologists have their strengths in the development of theories about human experience and behavior and in testing these theories.

Philip Guo (2013) also argues in the current issues of ACM that programming is useful for scientists, but overall more form a time saving perspective. But he also stresses that you can discover more creative solutions that your colleagues who cannot program. And even when you when you delegate the development task, knowing how to program helps you to better state what you want to achieve.

But the main point Guo makes is that with knowing how to program, you can work much, much faster, because:

Modern-day science and engineering is all about processing, analyzing, and extracting insights from data.
Guo, 2013

I couldn’t agree more. Even if you do not program in SPSS or R (the scripts are surprisingly useful), knowing for example how to use Regular Expressions to tidy up text, how to deal with large data in an SQL(ite) database, or some Excel functions that reformat the data can go a long way. If you do not have computer scientists embedded in your department and work closely together with them, you need to know this stuff yourself.

Sometimes it’s simple tricks that do not require you to learn how to program a fully fledged App that save you a lot of time for the things that are really important. And at least if you know what is (should) be possible, you can ask the right questions and find out about it and save huge amounts of time (yup, I love stackoverflow or stackexchange in general :-)).

Not to mention the added transfer value which one commentator to the ACM article stressed:

“Programming requires you to break big problems down into their smallest discrete components, and then to solve the big problem by systematically solving those smaller components. This is also exactly the kind of thinking that is required 90%* of the time in science and engineering. Once programming has forced you to learn how to think this way, it is far easier to apply it to nonprogramming problems.”

And that’s pretty much why I program.

(Come to think of it, I started as an undergraduate student with some ‘simple’ web experiments and questionnaires (HTML, Perl), programmed the experiment for my diploma thesis (HTML, PHP), continued during my dissertation (HTML, PHP) and now ended up learning to program in Objective-C for create stand-alone iOS Apps. I should probably mention this in my CV for job applications.)


Referenced Literature

  • Beagley, W. K. (2001). Why we need more psychology programmers/EL Knife, a data utility for transforming spreadsheets. Behavior Research Methods, Instruments, & Computers, 33(2), 97–101.
  • Guo, P. (2013). Helping scientists, engineers to work up to 100 times faster. Communications of the ACM, 56(10), 12. doi:10.1145/2507771.2507775