Explanation of "programming" tools for economists

In my own words, I try to explain the technical details of tools I have worked with. This started as a single question from another grad student. I've continued to expand and refine it as needed. While some explanations aren't perfect, as someone who started with no coding knowledge, I wanted this to be understandable to my past self. If you want more detailed and accurate descriptions, I'd recommend w3schools.

How to read each entry

Each card starts with the name and file type, then labels what kind of tool it is. The extra notes explain the analogy or details that make the tool easier to remember.

R

.R - language

Think of it as a dictionary of commands.

  • An R package is a dictionary focused on a specific topic.
  • RStudio is just one way of viewing/interacting with the language.

TeX & LaTeX

.tex - language

  • TeX has different dictionaries, but they use the same language.
  • LaTeX is the primary TeX format.
  • The compiler is the version of TeX being used. For example, pdfLaTeX and XeLaTeX.
  • Packages are similar to R packages: commands bundled together.

TeX Packages & Distributions

.sty and .cls - add-ons

  • TeX also has special packages known as classes. They are a bundle of packages with options already set. They have their own file type, .cls, and they are used by including them in the header of your document.
  • The distribution is the most confusing part. It's like the publisher of your dictionary. For Windows, there are two major options: TinyTeX and MiKTeX. You can have both. I do.
  • CTAN has almost all the packages that exist. Your distribution allows you to name and install CTAN packages.
  • If you want to use a package not on CTAN, you must make sure that TeX knows where it is, either by placing it in the same location as the current file or by "installing it." "Installing it" lets TeX know where it is.

TikZ

LaTeX drawing package

  • TikZ is an extremely powerful way of telling LaTeX to draw something.
  • It is often used for diagrams, flow charts, trees, and mathematical figures.
  • It can be very precise, but the syntax can feel confusing because you are describing the drawing with code.

Knitr & Sweave

.Rnw - translators

  • Knitr (.Rnw) - one-to-one translator (can be considered its own language).
    • Translates R to TeX.
  • Sweave (.Rnw) - one-to-one translator.
    • Translates R to TeX.
    • Same purpose as knitr, but a different version.

YAML & TOML

.yaml and .toml - translator languages

  • YAML (.yaml) - an easy-to-read translator language.
    • Uses human-centered phrases that can translate into instructions for other languages.
    • Allows a single translator to give instructions to multiple languages in one file.
    • YAML can tell other languages what to do, including CSS, HTML, etc.
  • TOML (.toml) - an easy-to-read translator language.
    • The same general idea as YAML, but different.

Markdown & R Markdown

.md and .Rmd - combinations

  • Markdown (.md) - combination.
    • Markdown uses a translator to write an entire document.
    • It also has it's own syntax for plain text.
  • R Markdown (.Rmd) - combination.
    • A specific type of markdown document.
    • A combination of languages.
    • Using YAML, it tells R what to do and tells TeX or HTML what to do.
    • It tells TeX what to do through knitr.

Python & JavaScript

.py and .js - languages

  • Python - a general-purpose language.
    • Python is a large general dictionary that defines a variety of topics.
    • Economists often use topic-specific Python dictionaries, or packages.
  • JavaScript (JS) - a web-focused language.
    • JavaScript is the language websites use when they need to do something.
    • TypeScript is dialect of JavaScript, that has to be translated to Javascript to be used. Also known as a superset, it's like JavaScript plus.
    • CommonJS and ES Modules are two ways JavaScript to reference a set of definitions.
    • Think of them as different ways for saying, "Use this other dictionary of commands too."
    • CommonJS usually uses require, while ES Modules usually use import and export.

CSS & SCSS

.css and .scss - style languages

  • CSS - tells HTML how to look.
    • If HTML is the structure of the page, CSS is the style guide that tells the structure how to look.
    • CSS controls colors, spacing, fonts, layout, borders, and other visual choices.
  • SCSS - a more flexible way to write CSS.
    • SCSS is like writing CSS with shortcuts, including variables, nesting, and mixins.
    • SCSS has to be translated into regular CSS before it can be used like turning shorthand notes into the formal notes.

Git & GitHub

version control and code hosting

  • Git - a history tracker for files.
    • Git is not a programming language. Think of it as a dictionary's edit history: it records what changed, when it changed, and who changed it.
    • Git has its own confusing vocabulary, including commit, branch, merge, push, and pull.
  • GitHub - a library for Git projects.
    • GitHub stores Git projects online.
    • Git is the tool; GitHub is one common place to store that history.

BibTeX & Biber

.bib - reference tools

  • BibTeX - a translator for references.
    • Think of a .bib file as a dictionary of references. BibTeX translates entries into citations and a references.
  • Biber - a newer translator for references.
    • It does the same thing as BibTeX but is more powerful because it can handle more complex reference styles.
  • Both can be confusing because they are part of the behind-the-scenes system that processes TeX documents into readable forms.

API & JSON

API - request system. .json - data format

  • API - a way for programs to request information.
    • API stands for Application Programming Interface.
    • Think of an API as the grammar rules for asking another program or website for information.
    • APIs are often used for requesting data from websites, databases, or public data services.
  • JSON - a data format.
    • JSON is a structured way to store and send information, often as name/value pairs.
    • Think of it as a small dictionary format that programs can read. APIs often return data in JSON, which R, Python, and JavaScript can then use.