; PSY 1903
PSY 1903 Programming for Psychologists

Introduction

JavaScript is a versatile and powerful programming language that is most commonly known for its role in web development in combination with HTML and CSS.

  • HTML (HyperText Markup Language) Dictates the structure of a web page
  • CSS (Cascading Style Sheets) Dictates the style/design of a web page
  • JavaScript - Add interactivity to a web page

Because we will be building experiments that run online as web sites, we will explore all three of these technologies in this class, with our primary focus on JavaScript.

In addition to being processed in a browser, JavaScript can also be used in non-browser contexts using a runtime environment called Node.js. This has made JavaScript a powerful general-purpose language, suitable for a wide range of applications beyond the context of web development.

Things you can do with JavaScript as a psychological researcher

  • Build easily shareable, web-based experiments
  • Add advanced functionality in survey platforms such as Qualtrics (ref)
  • Create programs that scrape web sites (social media, news sources, etc.) for data collection
  • Create programs that automate routine research-related tasks (data parsing/organization, etc.)
  • Present results via interactive web-based charts and graphics
  • Etc...

Documentation & Resources

One of the most useful skills you will hone as a programmer is how to effectively use documentation and other informational resources. With that in mind, a primary resource we’ll use in this course is the MDN - Mozilla Developer Network which provides guides and references for JavaScript, HTML, and CSS.

Additionally, we will take advantage of generative AI programs (e.g. ChatGPT) to help us with learning JavaScript. That being said, we’ll want to be careful - it can be temping to rely too much on generative AI to the detriment of building a strong foundation in a skill, so we’ll talk a lot about appropriate and productive use of generative AI.