Amount of frontal teaching:
This course is intended for PhDs who have little to no experience with coding; however, it should also be suitable for people who've done a bit of coding before but who could nevertheless benefit from a refresher course.
We'll start with Python, which is a general-purpose language that is very friendly for beginners. Then, we will switch to the R language, which is pretty-much essential for doing modern statistics. Time permitting, we might also touch on JavaScript too, which is becoming increasingly important as we begin to run more and more experiments online. Finally, I will wrap up the course by discussing some more theoretical issues, such as how good programming practices can support open-science and reproducibility efforts.
The course will consist of eight 2-hour classes with the second hour dedicated to practical activities. In addition to this, you should do several hours of self-directed practice per week on a personal project of your choice. The following schedule is indicative to what I would like to cover in each class; however, I will adapt the material to the needs and pacing of the students.
1. Programming basics
- What is programming?
- Interpreter vs. scripting
- Core data types (ints, floats, strings, lists, dicts...)
- Conditional statements
- Loops
- Understanding errors
2. Functions and objects
- Abstraction in computing
- Good code organization
- Built-in functions and objects
- Defining a function
- Defining an object
3. Handling files and textual data
- Reading and writing data
- Data formats: plain text, CSV, JSON
- String parsing and manipulation
- Regular expressions
4. Building experiments
- Installing and managing packages
- PsychoPy and how to read an API
- Coding up a basic experiment
5. The R language
- Mapping what we've already learned onto R
- Vectorization
- Data frames
- Manipulating data
6. Basic analysis and plotting in R
- Importing/exporting data
- Built-in functions
- Plotting graphs
7. Web programming
- HTML, CSS, JavaScript
- Client-side programming with jsPsych
- Server-side programming
- Online platforms
8. Good scientific practices
- Open source / open-access
- Reproducibility
- Version control
- Virtual environments
- Documentation
- Code review