Why Learn Coding#

  • This section is to give context to:

  • Understanding computing: This section is to familiarize you wth important foundational concepts and to give you a framework for understanding the types of computational methods you can use on a projects, including: minimal computing, tool choice or coding. Finally, this session aims to give you language to conceptualize what is possible and to communicate more effectively with partners.

  • Understanding the affordances and limitations of a computational approach for your project will help you better imagine, plan manage your project. Even if you are not directly involved in the coding aspect, this will give you the tools to better collaborate with those who will.

Computers & The Internet#

What is a computer?#

  • How do you make the computer do stuff? What is a GUI?

  • Refer back to the optional viewing from the introduction:

  • The following links will introduce terms such as input, output, storage, CPU, hardware, software, bits, circuits, and the operating system, as well as wired, cables, WiFi, packets, DNS, IP addresses, packets and routing, HTTP and HTML, encryption, public keys, and how search works.

What computational skills are necessary for your goals?#

  • Keep in mind: What coding language do I need to learn or do I need to learn to code is not the right question, the question is how much do I need to learn for my specific goal?

  • You may have multifaceted goals, some are learning related and some are productivity related.

  • They may not be mutually exclusive, but you will likely still need to make choices based on your circumstances.

Computing Environment#

  • “The computing environment involves the collection of computer machinery, data storage devices, work stations, software applications, and networks that support the processing and exchange of electronic information…” -Computing Environment

What does this all mean?

What is your environment?#

  • How can you interact with your environment (local, virtual, cloud)?

  • There are different affordances and limitation in each environment, you will make different choices depending on the needs of you project or the needs of your classroom.

  • Below we go further into depth about the difference and then the reasons we made the choice we did for the Python session.

Local environments#

  • Your laptop or desktop or tablet, etc. is your local environment.

  • The applications on your device can access the resources in your machine. Each local environment becomes different with use.

  • The kernel connects the application software to the hardware of a computer.

kernel

  • Local installations give you more control, and more power, but the pedagogical tradeoff is that it is more difficult to manage and configure during class. Installation is dependent on type of device.

  • The process of installing and learning how to work on your computer encourages more active troubleshooting as well, which is a useful long-term skill.

Virtual environments#

A virtual environment is a digital instance of a local computing environment that can perform almost all the same functions as that local machine, “including running applications and operating systems. Virtual machines run on a physical machines”… using specialized software or internet browsers.

The “Cloud”#

  • “Cloud computing is the on-demand availability of computer system resources, especially data storage (cloud storage) and computing power, without direct active management by the user.Cloud computing is the on-demand availability of computer system resources, especially data storage (cloud storage) and computing power, without direct active management by the user.”

  • Cloud based systems may be expensive, it may be resources intensive, so you may choose the path of Minimal Computing: “We use “minimal computing” to refer to computing done under some set of significant constraints of hardware, software, education, network capacity, power, or other factors. Minimal computing includes both the maintenance, refurbishing, and use of machines to do DH work out of necessity along with the use of new streamlined computing hardware like the Raspberry Pi or the Arduino micro controller to do DH work by choice. This dichotomy of choice vs. necessity focuses attention on computing that is decidedly not high-performance.”

  • Using the resource tha matches your needs can help you minimize costs and environmental impact.

How do you interact with your computer?#

  • Most of us are used to a graphical user interface GUI but the command line allows you more control.

Command Line#

  • What is the command line and why is it like this?

The command line is a text-based way of interacting with your computer. Working in command line helps you make a mental model of how you environment is layed out. This environment is the result of a series of choices, made by humans.

You may hear it called different names, such as the terminal, the shell, or bash. In practice, you can use these terms interchangeably. If you’re curious, though, you can read more about them here. The shell we use (whether terminal, shell, or bash) is a program that accepts commands as text input and converts commands into appropriate operating system functions.

And yes, “the command line” is also laden with masculine and military metaphors, which is reflective of the history of computing and programming.

  • As Wendy Hui Kyong Chun discusses in “On Software, or the Persistence of Visual Knowledge,” (2004) almost all computers (as in human comput-ers) in the US during World War II were young women. Human computers received commands from analysts — predominantly men with the military — that they then had to interpret and act upon the machine. As Chun argues, “computation depends on ‘yes, sir’ in response to short declarative sentences and imperatives that are in essence commands … The command line is a mere operating system (OS) simulation” (page 34). The command line (of computers today) receives these commands as text that is typed in.

Why is the command line useful?#

Initially, for some of us, the command line can feel a bit unfamiliar. Why step away from a GUI point-and-click workflow? By using the command line, we move into an environment where we have more minute control over each task we’d like the computer to perform. Instead of ordering your food in a restaurant, you’re stepping into the kitchen. It’s more work, but there are also more possibilities.”

The command line allows you to…

  • Easily automate tasks such as creating, copying, and converting files.

  • Set up your programming environment.

  • Run programs you create.

  • Access the (many) programs and utilities that do not have graphical equivalents.

  • Control other computers remotely.

In addition to being a useful tool in itself, the command line gives you access to a second set of programs and utilities and is a complement to learning programming.

  • Wring a script or program (programming!) allows you to automate a series of repetitive tasks.

What if all these cool possibilities seem a bit abstract to you right now? That’s all right! On a very basic level, most uses of the command line are about showing information that the computer has, or modifying or making things (files, programs, etc.) on the computer.

Introduction to the command line#

By this point in our academic careers, most of us have figured out some ways we like to interact with computers. Whether that involves avoiding them as much as possible or constantly testing new software, we likely have some ideas about how we feel comfortable getting things done. How would you show a person who had never seen a computer, say Kimmy Schmidt or Brendan Fraser in Blast from the Past, how to do something on your computer?

Many of us would explain what a screen and a cursor are, and then show how to point and click on icons. This approach relies on athe graphical user interface, or GUI (pronounced “gooey!”).

Another way to make your computer do things: through the command line. Instead of pointing and clicking, we’ll be typing in either Git bash (Windows) or terminal (OSX) to tell the computer directly what task we’d like it to perform.

Coding#

Why teach coding? “…any instructor—-in the humanities or otherwise-—must first ask herself what she hopes her students will accomplish by learning to code. Is it an understanding of how to think algorithmically, so as to better comprehend how certain tasks can be abstracted into a series of steps? Is it a familiarity with the basic components of programming languages, so as to be able to understand how code is structured and produced? Is it the knowledge of a specialized programming language, one with specific applications in a particular field? Or is it the more experiential knowledge of what it feels like to move from defining functions and assigning variables to running executable code?” Digital Pedagogy in the Humanities: Concepts, Models, and Experiments: Code by Lauren Klein

  • Do you need to learn code?

  • You don’t need to be become fluent if it’s not the focus of your interest, but it is helpful to have reading fluency, like any other language that is an important part of your research. Also, like any other language, use will help you retain and gain knowledge.

Learning some coding will help you see what is technically feasible#

  • “I started to notice that the way people talk about technology is out of sync with what digital technology actually can do. Ultimately, everything we do with computers comes down to math, and there are fundamental limits to what we can (and should) do with it.” Hello Reader

What is coding? Is it the same as programming?#

“Put simply, programming is giving a set of instructions to a computer to execute. …While sometimes used interchangeably, programming and coding actually have different definitions.”

  • Programming is the mental process of thinking up instructions to give to a machine (like a computer).”

    • We have also referred to this as computational thinking.

    • “If you’ve ever cooked using a recipe before, you can think of yourself as the computer and the recipe’s author as a programmer. The recipe author provides you with a set of instructions which you read and then follow. The more complex the instructions, the more complex the result!”

    • What is Programming?

  • Coding is the process of transforming those ideas into a written language that a computer can understand.”

    • Coding would be taking that recipe and laying out step by step what needs to be done,with no assumption of specific knowledge. Without coding, the program (recipe) cannot be run by the computer.

      • We will be learning to code in Python for this Institute.

Hello World#

To better understand how computers make sense of the world, please read: Chapter 2 Hello World

  • From Broussard, Meredith. Artificial Unintelligence: How Computers Misunderstand the World. Cambridge, Massachusetts: The MIT Press, 2018.

  • She talks about the three ways to do something (write Hello World): asking a person to do it, using a tool (Word or some other word processor) to do it, and using coding to do it.

    • For your “hello world” which is your project, which of the three choices makes the most sense for you?

      • What are the affordances and limitations of doing computational analysis for your humanities questions?

  • How do you interpret the statements that “data is socially constructed” and “Ultimately, data always comes down to people counting things”?

  • Computers are literal: Can you describe a time in which a computer. tool or program behaved in way that was confusing to you and after reading this article, do you have explanation as to why?

  • What can computers actually do?

    • “The gap between what we imagine and what computers can actually do is really vast… Often, we talk about computers as being able to do anything, and that’s just rhetoric because ultimately they’re machines, and what they do is they compute, they calculate, and so anything you can turn into math, a computer can do.” Interview with Meredith Broussard

  • Can you think of something that a human is better at doing then a computer?

Should you learn coding or just use a tool?#

  • The answer to this depends on your immediate and long term goals.

  • What are you trying to do? What are the affordances or limitations of each approach?

  • Learning programming is like learning carpentry as it is a whole suite of skills.

    • However, if you just need a specific piece of furniture, then learning carpentry (coding) may be overkill.

    • Instead, you may just buy something that already exists (get an already existing program/tool like Omeka or Arc-GIS). If your need to common, there may already be a tool.

      • For example, many people want a tool to do word precessing, there are many various tools that help wth that task.

  • If you sill require a custom solution you can hire a carpenter (hire a developer/programer) to either modify an already existing tool to fit your specfic parameters or make something custom to fit your needs.

Some questions to consider:#

  • Do you see yourself using this skill in multiple contexts?

  • Do you have the time and interest to invest the time to learn the required skills?

  • Have you done a search (or conducted an environmental scan) on your topic and goals? Imagine the tool that you wished existed and search to see it exists.

    • Contact your librarians for help with this.

Contexts#

Why am I learning this? Why does it matter? How will it help my project? Learning new digital skills is an investment of your valuable time, so it is reasonable to want to know—essentially—what will I get out of taking this workshop? The materials below help situate the skills you are about to learn within a larger context of how they are used, by whom, and to what ends.

Ethical Considerations#

  • Digital tools and the skills required to use them are part of our culture and, therefore, never neutral. Digital humanists and social scientists consider the ethical challenges and responsibilities of the tools and methods that they use. The following materials are designed to introduce you to issues you may want to consider as you learn this new skill and decide how to integrate it into your own research and teaching.

  • Within the nebulous open-source ecosystem, GitHub is an important place for storing and finding code. What if your open source code was used by an entity or for a purpose that did not agree with your ethics? For example, the platform received backlash from employees of GitHub and users of the platform when it was revealed that they held a contract with ICE. In this case, neither group wanted their code shared and used by ICE in detaining and deporting immigrants. Read more here.


Attribution#

Session Leaders: Rafia Mirza Written by Rafia Mirza.

Our curriculum is based on the Digital Research Institute (DRI) Curriculum by Graduate Center Digital Initiatives. It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. When sharing this material or derivative works, preserve this paragraph, changing only the title of the derivative work, or provide comparable attribution.

Creative Commons License