|
Programming Logic for Psychology Students |
|
Computer Programming is not a topic that comes first to mind for the typical student of psychology while thinking about psychology research. However, given the pervasive nature of computer technology today, it should come as no surprise that they are used heavily in our research. What are some of the kinds of things that you can do with a computer in research? You can collect data, analyze data, present stimuli, explore concepts, etc. Even the most simple of programs begin to model psychological processes. The goal of this online course is to cover the topic of logic. I am not interested in teaching techniques that are language specific, but rather, if you know the technique, you can implement it in any language you choose. By the time you have completed this document, you will be able to identify the basic programming structures, understand the fundamentals of commands, and structure simple programs. Generally, programming manuals start you out with a simple program, the now infamous “hello world”. The idea behind this is that there are commands that can be given that cause the computer to output to the screen the words “hello world”. The many different languages that exist usually use the keyword ‘print’. In Basic it is ‘print’. In C, it is ‘printf’, where the f stands for functions. In Pascal, it is ‘write’ or ‘writeln’.
|