Published using Google Docs
CSE160 22wi Terminology _ VS Code Tips for Students
Updated automatically every 5 minutes

CSE160 22wi Terminology & VS Code Tips

Terminology:

Given that this is a beginner class that is introducing students to computer science concepts, there is a lot of new terminology to keep track of! While homeworks and lectures can help connect ideas to language, there is still a lot to get used to. This page is meant to be a resource for understanding various terms and concepts that programmers use regularly.

Terminology can be confusing! Hopefully this will make it less confusing :)

Argument

The value or variable that is given to a function so it can execute. This is different from a parameter (see the definition below). For example, we would say that the function range() takes 3 arguments.

Body

The section of code within a larger section of code. For example, the function body is the code that is under the function header. The loop body is the code that is indented under a loop.

Constructor

A constructor is something that is called in order to create a new data structure or object, such as a dictionary, list, or set (for example: dict(), list(), and set(), respectively). This can create the data structure and leave it empty, or it can even be passed some values to include initially.

Data Structure

Data structures are different ways of organizing data in a program such that they can be accessed and modified efficiently. An easy way to think about them are data containers with different special properties. The data structures we teach in 160 include lists, dictionaries, sets and graphs, but there are a lot more different types out there. Data structures can be nested, meaning the item stored in a data structure can be another data structure. The nested list like pixel_grid in homework 3 is a classic example of nested data structures.

Debug

Debug means finding and trying to fix problems in the code. The code might look nice and good, but that does not mean that it is free from problems. Some problems arise when you run the code against some form of input or parameters! 😱

You can read more about the interesting history behind the term
here.

Documentation

The written records of a class, function, programming language, etc. that contain information on names, arguments, and how to use something.

IDE

The abbreviation for “integrated development environment,” an IDE is a place where code can be written and run. It could be an application (like VSCode!) or even a website (like Repl.it). There are lots of options out there!

Redundancy

Unnecessarily repeated code which can make your program harder to read, modify, and debug. For example, duplicating lines of code to execute the same operations multiple times, or recomputing the same value instead of saving it in a variable. Functions, for loops, and variables are ways of reducing redundancy in your program.

“Step through”

A way to verify whether your program produces the expected output or debug issues in code. Usually, it involves plugging specific values to your variables or formal parameters (for functions) and then note down the changes in those variable states line by line. One common mistake that people often make when stepping through their own code is that they assume their code works as expected, so they skip over some lines and overlook potential issues. A good mindset when stepping through your own code is to pretend that the code is written by someone else, and you are trying to simulate the computer and interpret the code as it-is.

Style

The formatting conventions (whitespace, punctuation, etc.) of some code; “good” style means that a piece of code is written/formatted in a way that is expected for that language. “Bad” style means that it is not typical for a piece of code to be formatted or written in that specific way.

Stub/Skeleton

Also referred to as “starter code,” these are the beginnings of code that still need to be completed (you could say it needs to be “fleshed out”). This can be in the form of function headers that are pre-written but do not have any code in the function body. You can also think of working with skeleton code as filling in the blanks. Most of the python files for homeworks in this class will have some stubs/skeleton code.

“The Spec”

The shortened term for “specification,” it is the set of directions and requirements for a project. In this course (and other CSE courses), “the spec” refers to the homework page on the website.

Terminal

Sometimes called the “command line,” or “CLI,” this is a place where you can navigate through directories, make/modify files, but most importantly (for this class) run your python code and see output. Typically displayed with a black background and white text, the text on the far left will show what directory you are working in (for example, the homework2 folder). In VS Code, you can create a terminal by going to the menu bar and clicking Terminal > New Terminal.

To Test/Assert

We typically see this used in a sentence like “Now we will assert that _____ is true.” What this means is we are going to check that something is doing what we expect it to. If it does not give the expected result, then we will receive an error that shows us what is wrong. The general structure to think about is having the results from your code (you can get this by calling your function), and your expected result (you can get this from the homework spec, or even calculate by hand). Then you can compare them in a test and/or assert statement, which will ensure that any errors are noticed.

Parameter

The input values that a function expects. This is different from an argument (see the definition above) in that this is not what is actually passed in, it is a placeholder that indicates what should be passed in. For example, the range() function’s implementation would have 3 parameters. This means the range() function takes in at most 3 arguments.

“Python Interpreter”

You can think of the python interpreter as a calculator, you input python expressions, and the interpreter will evaluate them. The interpreter is distinct from the terminal. The terminal is where the output from your python program will appear, the interpreter is its own separate window.

Pseudocode

Pseudocode is a high-level description of an algorithm or program. It is usually a step-by-step description of an algorithm or program that can be understood in clear English. For example, this would be the pseudocode for finding the sum of the list.

Create a variable to hold the value of sum

For each value in the list:

        Add the value to the sum

VS Code Tips: