2 Introduction

This is a different type of programming workshop. One that doesn’t require a computer, but instead intends to help you build mental models of how computer programming works. You will learn the logic behind programming, and also methods for identifying errors in algorithms and code that the computer doesn’t see. The only technology required, besides the ability to view this lesson, is something to write with and a piece of paper.

2.1 Building a Mental Model

Our experience with computational consultations is often student researchers will take someone else’s code and try to adapt it for their own research, but they use the code without knowing how it does what it does. This means they’re unable to easily update the script, will create errors they don’t know how to address, and even import errors already in the script. Sometimes they can’t even adapt it to use the original data which is in a different location on their computer. They can’t really read the code, but are reliant on the computer reading the code.

The purpose of this workshop isn’t just to introduce you to programming logic, it’s to provide a safe space to practice thinking through what the computer does by tracing algorithms and code snippets instead of having the computer just do it.

2.2 A Note on Syntax

Syntax is the formal structure of a computer programming language. Assembly, C/C++, C#, Python, and R all have formal language structures so the computer knows how to read the code. But, sometimes syntax gets in the way of learning concepts. Luckily, most programming concepts are the same across all languages.

The syntax we will use for most of the examples will be something called psuedocode. Pseudocode focuses on concepts and tasks, not syntax. You don’t need to worry if there is a semicolon or parenthesis out of place when you write in psuedocode, you’ll still know how to interpret what is written.

We will also introduce programming examples in different languages, so you can start to recognize the similarities and differences between the languages. You won’t be an expert by end of this workshop, but we will help you build your skillset so hopefully you’re more comfortable reading known (and unknown) computer languages.