9. Why are these tools like this?#

Important

Remember: this is an upper level course; I am not looking for you to give me back the things I say to you.

I am looking to see that you can use and apply the things we do in other contexts.

  • sometimes this is practical: eg git & bash

  • sometimes this is conceptual: eg PL & today

This means I look for you to draw connections between ideas.

9.1. Setup#

Let’s take some time to se up what we are going to talk about today.

We will talk about two main things:

  • Unix Philosophy

  • Strategies to study systems

In CS we tend to be more implicit about design, but that makes it hard to learn and keep track of.

Today’s goal is to be more explicit, disucssing some principles and seeing how you have already interacted wit them.

Today we’re going to do a bit more practical stuff, but we are also going to start to get into the philosophy of how things are organized.

Understanding the context and principles will help you:

  • remember how to do things

  • form reliable hypotheses about how to fix problems you have not seen before

  • help you understand when you should do things as they have always been done and when you should challenge and change things.

9.1.1. Why should we study design?#

  • it is easy to get distracted by implementation, syntax, algorithms

  • but the core principles of design organize ideas into simpler rules

9.1.2. Why are we studying developer tools?#

Recall:

The best way to learn design is to study examples [Schon1984, Petre2016], and some of the best examples of software design come from the tools programmers use in their own work.

Software design by example

note

  • we will talk about some history in this course

  • I will not take a “great men of history” approach, where I have you learn a bunch of people and what each one of them did

This is because:

  • I think that history is important context for making decisions

  • Many of these “great men” are actually, in many ways, Not Great^TM

  • It is important to remember that all of this work was done by people

  • all people are imperfect

  • when people are deeply influential, ignoring their role in history is not effective, we cannot undo what they did

  • we do not have to admire them or even say their names to acknowledge the work

  • computing technology has been used in Very Bad ways and in Definitely Good ways

9.2. Unix Philosophy#

sources:

The tenets:

  1. Make it easy to write, test, and run programs.

  2. Interactive use instead of batch processing.

  3. Economy and elegance of design due to size constraints (“salvation through suffering”).

  4. Self-supporting system: all Unix software is maintained under Unix.

For better or worse unix philosophy is dominant, so understanding it is important.

This critique is written that unix is not a good system for “normal folks” not in its effectiveness as a context for developers which is where *nix (unix, linux) systems remain popular.

context:
“normal folks” is the author’s term; my guess is that it is attempting to describe a typical, nondeveloper computer user terminology to refer to people has changed a lot over time; when we study concepts from primary sources, we have to interpret the document through the lens of what was normal at the time the document was written, not to excuse bad behavior but to not be distracted and see what is there

In what ways might it make sense to design developer tools differently than everyday user tools?

9.2.1. Philosophy in practice, using pipes#

If you have the gh CLI installed and working locally: open the terminal that it works in and navigate to your KWL repo.

If you do not have gh CLI working locally, open a codespace on the main branch of your KWL repo

(I have it working locally and working locally lets me save my terminal output for the notes more easily)

To check if your gh CLI is working:

gh
Work seamlessly with GitHub from the command line.

USAGE
  gh <command> <subcommand> [flags]

CORE COMMANDS
  auth:        Authenticate gh and git with GitHub
  browse:      Open the repository in the browser
  codespace:   Connect to and manage codespaces
  gist:        Manage gists
  issue:       Manage issues
  org:         Manage organizations
  pr:          Manage pull requests
  project:     Work with GitHub Projects.
  release:     Manage releases
  repo:        Manage repositories

GITHUB ACTIONS COMMANDS
  cache:       Manage Github Actions caches
  run:         View details about workflow runs
  workflow:    View details about GitHub Actions workflows

EXTENSION COMMANDS
  classroom:   Extension classroom

ALIAS COMMANDS
  co:          Alias for "pr checkout"

ADDITIONAL COMMANDS
  alias:       Create command shortcuts
  api:         Make an authenticated GitHub API request
  completion:  Generate shell completion scripts
  config:      Manage configuration for gh
  extension:   Manage gh extensions
  gpg-key:     Manage GPG keys
  label:       Manage labels
  ruleset:     View info about repo rulesets
  search:      Search for repositories, issues, and pull requests
  secret:      Manage GitHub secrets
  ssh-key:     Manage SSH keys
  status:      Print information about relevant issues, pull requests, and notifications across repositories
  variable:    Manage GitHub Actions variables

HELP TOPICS
  actions:     Learn about working with GitHub Actions
  environment: Environment variables that can be used with gh
  exit-codes:  Exit codes used by gh
  formatting:  Formatting options for JSON data exported from gh
  mintty:      Information about using gh with MinTTY
  reference:   A comprehensive reference of all gh commands

FLAGS
  --help      Show help for command
  --version   Show gh version

EXAMPLES
   gh issue create
   gh repo clone cli/cli
   gh pr checkout 321

LEARN MORE
  Use 'gh <command> <subcommand> --help' for more information about a command.
  Read the manual at https://cli.github.com/manual

When we use it without a subcommand, it gives us help output a list of all the commeands that we can use. If it is not working, you would get a command not found error.

We will navigate to the kwl repo

cd kwl-sp24-brownsarahm/

Let’s inpsect the action file that creates the issues for your badges.

cat .github/workflows/getassignment.yml 
name: Create badge issues (Do not run manually)
on:
  workflow_dispatch

# once you edit, change the name

jobs:
  check-contents:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    
    # Install dependencies
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: 3.9
    
    - name: Install Utils
      run: |
        pip install git+https://github.com/introcompsys/courseutils@main
    - name: Get badge requirements
      run: |
        # prepare badge lines
        pretitle="prepare-"$(sysgetbadgedate --prepare)
        sysgetassignment --type prepare | gh issue create --title $pretitle --label prepare --body-file -
        # review badge lines
        rtitle="review-"$(sysgetbadgedate --review)
        sysgetassignment --type review | gh issue create --title $rtitle --label review --body-file -
        # practice badge lines
        pratitle="practice-"$(sysgetbadgedate --practice)
        sysgetassignment --type practice| gh issue create --title $pratitle --label practice --body-file -
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#  edit the run step above for the level(s) you want. 
#  You should keep the prepare, because they are required for experience badges 
#     You may choose to get only the review or only the practice (and change this any time) 

We see that several things, but this output is also kind of long,

We can cut only a part of the output by using a pipe. A pipe connects the output of one command to the input of the next. It uses stdout and stdin files to do this.

The head command returns the top of a file and its -n option lets us choose how many lines at the top of the file, so we will use this to get the first 26 lines.

cat .github/workflows/getassignment.yml | head -n 26

(I picked 26 in advance to get the right number for this example, this)

name: Create badge issues (Do not run manually)
on:
  workflow_dispatch

# once you edit, change the name

jobs:
  check-contents:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    
    # Install dependencies
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: 3.9
    
    - name: Install Utils
      run: |
        pip install git+https://github.com/introcompsys/courseutils@main
    - name: Get badge requirements
      run: |
        # prepare badge lines
        pretitle="prepare-"$(sysgetbadgedate --prepare)
        sysgetassignment --type prepare | gh issue create --title $pretitle --label prepare --body-file -

Here we see a few key things:

  • on the last line it uses a pipe | to connect a command sysgetassignment to the gh issue create command.

  • the gh issue create command uses the --body-file option with a value -; this uses std in, but since this is to the right of the pipe, it puts the output of the first command into this option

  • the 2nd to last line creates a variable (we will learn this more later) and the last line uses that variable

  • the Install Utils step, installs some custom code.

We know that this action is what is used to create badge issues, so this custom code must be what gets information from the course website to get the assignments and prepare them for your badge issues.

9.2.2. Installing from source#

As we saw in the action, we can install python packages from source via git. let’s install the new version of the code

pip install git+https://github.com/compsys-progtools/courseutils@main
Collecting git+https://github.com/compsys-progtools/courseutils@main
  Cloning https://github.com/compsys-progtools/courseutils (to revision main) to /private/var/folders/8g/px8bm7bj0_j31j71yh6mfd_r0000gn/T/pip-req-build-shqisbrk
  Running command git clone --filter=blob:none --quiet https://github.com/compsys-progtools/courseutils /private/var/folders/8g/px8bm7bj0_j31j71yh6mfd_r0000gn/T/pip-req-build-shqisbrk
  Resolved https://github.com/compsys-progtools/courseutils to commit 2220b76eba38662aa1a6172fdfd46700e3f9cce3
  Preparing metadata (setup.py) ... done

Successfully installed syscourseutils-0.4.0

This shows at the top it clones the repo to a temporary location on your system (or codespace) and then installs it from the source code.

Note

I truncated this output for the website

Now we can use a command from the packaage.

sysgetassignment
404: Not Found

With default settings, it says 404.

We know that it goes online. So, for example, if you turn your wifi off and then try it again, you will get a different error.

To learn more about this, lets use the --help option.
A lot of CLI tools have this option. In this program, that I made, the Python library click that I used to make this, provides the help option automatically to show the documentation or lets me as the developer add help text to options.

sysgetassignment --help
Usage: sysgetassignment [OPTIONS]

  get the assignment text formatted (CLI entrypoint)

Options:
  --type TEXT  type can be prepare, review, or practice
  --date TEXT  date should be YYYY-MM-DD of the tasks you
               want
  --help       Show this message and exit.

Now we can see that it can take some options.

If we do not provide a date, I can tell you (and I should add to the documentation), it uses today’s date. Since we ran this on a day with class, before the badges were posted, the file it looked for did not exist, so we got 404.

We can use the options to get the last posted practice badge

sysgetassignment --date 2024-02-20 --type practice
- [ ] Describe a type of project where it would be worth it for you to learn a language you have never used before in `newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
- [ ] Learn about one of the following languages that you have not used before: [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Zig](https://ziglang.org/), [Go](https://go.dev/), [erlang](https://www.erlang.org/), [Elixir](https://elixir-lang.org/) or another language you are curious about that appeared in the Developer survey. For example you might be interest in the [top paying languages](https://survey.stackoverflow.co/2023/#technology-top-paying-technologies). Use the official documentation.  Answer the following questions in `languagelearning.md`:

    ```
    - [ ] What is this language designed for?
    - [ ] What Programming paradigm(s) does it support?
    - [ ] Give at least 1 example of a programming language that experience in would make it **easy** to learn this language and explain why. 
    - [ ] Give at least 1 example of a programming language that experience in would make it **hard** to learn this language and explain why. 
    - [ ] What is its most unique feature(s)?
    ```

hint: for questions 3 & 4, for example learning Python first does not make it easy to learn C++, but learning C makes it very easy to learn C++. 

## Explore badge option 

Actually try out one of the langauges above in a new repo created from [this asssignment](https://classroom.github.com/a/ENi8xpR_). 

**work on a branch and commit after each step**

- [ ] Setup the devcontainer to provide the compiler/interpreter for the language of your choice. See [features](https://containers.dev/features)
- [ ] Add top extensions related to the language to the devcontainer. 
- [ ] Add a [gitignore](https://github.com/github/gitignore) file for that language
- [ ] Write a hello world type program in the language and make sure it runs. 
- [ ] Use the official documentation to figure out a common task in the language and write an example program that completes something typical for that language (eg a sort data analysis in R). You may use GitHub Co-pilot in the code space to help write the code.  
- [ ] Test your understanding of the code by trying to modify it. 
- [ ] Fill in the prompts in the README (follow the comments)
- [ ] Answer the questions in the README of the template repo.  

and it works!

By calling without the the type, we can see what it gives as the default,

sysgetassignment --date 2024-02-20
- [ ] Think through and make some notes about what you have learned about design so far. Try to answer the questions below in `design_before.md`.  If you do not now know how to answer any of the questions, write in what questions you have. 

``` 
- What past experiences with making decisions about design of software do you have?
- what experiences studying design do you have? 
- What processes, decisions, and practices come to mind when you think about designing software?
- From your experiences as a user, how you would describe the design of command line tools vs other GUI based tools?
```

which we see is prepare

We can also install from a different branch

pip install git+https://github.com/compsys-progtools/courseutils@sub_command
Collecting git+https://github.com/compsys-progtools/courseutils@sub_command
  Cloning https://github.com/compsys-progtools/courseutils (to revision sub_command) to /private/var/folders/8g/px8bm7bj0_j31j71yh6mfd_r0000gn/T/pip-req-build-ubwyoelb
  Running command git clone --filter=blob:none --quiet https://github.com/compsys-progtools/courseutils /private/var/folders/8g/px8bm7bj0_j31j71yh6mfd_r0000gn/T/pip-req-build-ubwyoelb
  Running command git checkout -b sub_command --track origin/sub_command
  Switched to a new branch 'sub_command'
  branch 'sub_command' set up to track 'origin/sub_command'.
  Resolved https://github.com/compsys-progtools/courseutils to commit bbf6192f911f7ce295e4cc6da4b011c5320b2fb0
  Preparing metadata (setup.py) ... done
Requirement already satisfied: Click in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from syscourseutils==1.0.2) (8.1.7)
Requirement already satisfied: pandas in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from syscourseutils==1.0.2) (2.0.3)
Requirement already satisfied: lxml in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from syscourseutils==1.0.2) (4.9.2)
Requirement already satisfied: numpy in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from syscourseutils==1.0.2) (1.24.3)
Requirement already satisfied: requests in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from syscourseutils==1.0.2) (2.31.0)
Requirement already satisfied: html5lib in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from syscourseutils==1.0.2) (1.1)
Requirement already satisfied: six>=1.9 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from html5lib->syscourseutils==1.0.2) (1.16.0)
Requirement already satisfied: webencodings in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from html5lib->syscourseutils==1.0.2) (0.5.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from pandas->syscourseutils==1.0.2) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from pandas->syscourseutils==1.0.2) (2022.7)
Requirement already satisfied: tzdata>=2022.1 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from pandas->syscourseutils==1.0.2) (2023.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from requests->syscourseutils==1.0.2) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from requests->syscourseutils==1.0.2) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from requests->syscourseutils==1.0.2) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in /Users/brownsarahm/anaconda3/lib/python3.11/site-packages (from requests->syscourseutils==1.0.2) (2023.7.22)
Building wheels for collected packages: syscourseutils
  Building wheel for syscourseutils (setup.py) ... done
  Created wheel for syscourseutils: filename=syscourseutils-1.0.2-py3-none-any.whl size=16292 sha256=10ce631c7b45acb85334f8762dbed91d1c9530b443ee92b731e5730e547f223c
  Stored in directory: /private/var/folders/8g/px8bm7bj0_j31j71yh6mfd_r0000gn/T/pip-ephem-wheel-cache-mmemuo33/wheels/7b/b7/64/6a1c2f1fd945bc80f64f3a179f51ce6c739342727446e4359b
Successfully built syscourseutils
Installing collected packages: syscourseutils
  Attempting uninstall: syscourseutils
    Found existing installation: syscourseutils 0.4.0
    Uninstalling syscourseutils-0.4.0:
      Successfully uninstalled syscourseutils-0.4.0
Successfully installed syscourseutils-1.0.2

Note the version updates, and goes from 0.4.0 to 1.0.2. I made some breaking changes on this branch, so I used semantic versioning to jump the major.

It now has an overall command with subcommands. we can use that command, cspt in order to get the list of other commands.

cspt
Usage: cspt [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  createtoyfiles  from a source file create a set of...
  earlybonus      check if early bonus is met from...
  exportac        export ac files for site from lesson
  exporthandout   export prismia version of the content
  exportprismia   export prismia version of the content
  getassignment   get the assignment text formatted
  getbadgedate    cli for calculate badge date
  kwlcsv          generate the activity file csv file...
  mkchecklist     transform input file to a gh markdown...
  parsedate       process select non dates
  prfixlist       check json output for titles that...
  processexport   transform output from mac terminal...
  progressreport  list PR titles from json or - to use...
  titlecheck

This command should now work for you in your KWL, but we will revisit this in lab.

gh pr list -s all  --json title,latestReviews | cspt prfixlist - | cspt mkchecklist -

9.3. How do we Study (computer) Systems#

Important

This section has more detail than we did in class

When we think of something as a system, we can study it different ways:

  • input/output behavior

  • components

For complex systems, we also use abstraction

These basic ideas apply whether a computer system or not. We can probe an object that we want to udnerstand in different ways.

In a lot of disciplines people are taught one or the other, or they divide professionally into theorists or experimentalists along the lines.

People are the most effective at working with, within, and manipulating systems when they have multiple ways to achieve the same goal.

These are not mutually exclusive, we will use them all together in this course.

When we study a system we can do so in three main main ways. We can look at the input/output behavior of the system as a whole, we can look at the individual components, or we can adopt the abstractions that were developed.

For each component, we can look at its behavior or the subcomponents. We can take what we know from all fo the components and piece that together. However, for a complex system, we cannot match individual components up to the high level behavior. This is true in both computers and other complex systems. In the first computers in the 1940s, the only things they did was arithmetic and you could match from their components al the way up pretty easily. Modern computers connect to the internet, send signals, load complex graphics, play sounds and many other things that are harder to decompose all at once. Outside of computers, scientists have a pretty good idea of how neurons work and that appears to be the same across mammals and other species (eg squid) but we do not understand how the whole brain of a mammal works, not even smaller mammals with less complex social lives than humans. Understanding the parts is not always enough to understand all of the complex ways the parts can work together. Computers are much less complicated than brains. They were made by brains.

But that fact motivates another way to study a complex system, across levels of abstraction. You can abstract away details and focus on one representation. This can be tied literally to components, but it can also be conceptual. For example, in CSC211 you use a model of stack and heap for memory. It’s useful for understanding programming, but is not exactly what the hardware does. At times, it is even more useful though than understanding exactly what the hardware does. These abstractions also serve a social, practical purpose. In computing, and society at large really, we use standards these are sets of guidelines for how to build things. Like when you use a function, you need to know it’s API and what it is supposed to do in order to use it. The developers could change how it does that without impacting your program, as long as the API is not changed and the high level input/output behavior stays the same.

9.3.1. Behavior#

Try something, see what happens

This is probably how you first learned to use a computer. Maybe a parent showed you how to do a few things, but then you probably tried other things. For most of you, this may have been when you were very young and much less afraid of breaking things. Over time you learned how to do things and what behaviors to expect. You also learned categories of things. Like once you learned one social media app and that others were also social media you then looked for similar features. Maybe you learned one video game had the option to save and expected it in the next one.

Video games and social media are classes or categories of software and each game and app are instances. Similarly, an Integrated Development Environment (IDE) is a category of software and VS Code, … are instances. Also, version control is a category of software and git is an instance. A git host is also a category and GitHub is an instance. Just as before you were worried about details you transferred features from one instance to another within categories, I want you to think about what you know from one IDE and how that would help you learn another. We will study the actual features of IDE a=and what you might want to know about them so that you can choose your own. Becoming a more independent developer you’ll start to have your own opinions about which one is better. Think about about a person in your life who finds computers and technology overall intimidating or frustrating. They likely only use one social media app if at all, or maybe they only know to make documents in Microsoft word and they think that Google Docs is too much to learn, because they didn’t transfer ideas from one to the other.

We have focused on the behavior of individual applications to this point, but there is also the overall behavior of the system in broad terms, typing on the keyboard we expect the characters to show (and when they don’t for example in a shell password, we’re surprised and concerned it is not working).

Run the following command and describe what happens

This gives a list of PRs that you might want to check on

use pipes to produce list of bad titles, pipe into checker

9.3.2. Components#

Take it apart, asess the pieces

We have the high level parts: keyboard, mouse, monitor/screen, tower/computer. Inside we also tend to know there is a power supply, a motherboard, graphics card, memory, etc.

We can study how each of these parts works while not worrying about the others but having them there. This is probably how you learned to use a mouse. You focused your attention on the mouse and saw what else happened.

Or we can take an individual component and isolate it to study it alone. For a mouse this would be hard. Without a computer attached its output is not very visible. To do this, we would need additional tools to interpret its output and examine it. Most computer components actually would need additional tools, to measure the electrical signals, but we could examine what happens at each part one at a time to then build up what they do.

This idea, however that we can use another tool to understand each component is an important one. This is also a way to again, take care and study each piece even within a software-alone system without worrying about the hardware.

Let’s break the command down and examine each piece. What piece should we start from?

9.3.3. Abstraction#

use a model

As we talked about the behavior and abstraction, we talked some about software and some about hardware. These are the two coarsest ways we can think about a computer system at different levels of abstraction. We can think about it only in physical terms and examine the patterns of electricity flow or we can think about only the software and not worry about the hardware, at a higher level of abstraction.

However, two levels is not really enough to understand how computer systems are designed.

layers

Application - the software you run.

Algorithm - the way that it is implemented, in mathematical level

Programming language - the way that it is implemented for a computer.

Let’s take a simple example, let’s say we are talking about a simple search program that we wrote that finds xx. We can say that you put in a part of a file name and it shows you all the ones with a similar name. That description is at the application level it gives the high level behavior, but not the step by step of how it does it. Let’s say we implemented it using bubble search then searches by … That’s the algorithm level, this is still abstract and could be implemented in different ways, but we know the steps and we can use this to know some things about how fast it will be, what types of result swill make it slower, etc. At the programming level language then we know which language it was done in and we see more details. At this level, we can see the specific data structures and controls structures. These implementation details can also impact performance in terms of space(memory) or time. Still at this level, we do not need to know how the actual hardware works, but we see it in increasing detail. At each level we have different types of operations. At the application we might have input, press enter, get results. At the algorithm we have check the value, compare. At the programming language level we need more specifics too, like assign or append.

After the Programming language level, there is assembly. The advantage to assembly is that it is hardware independent and human readable. It is low level and limited to what the hardware can do, but it is a version of that that can be run on different hardware. It is much lower level. When you compile a program, it is translated to assembly. At this level, programs written in different level become indistinguishable. This has much lower level operations. We can do various calculations, but not things like compare. Things that were one step before, like assign become two, choose a memory location, then write to memory. This level of abstraction is the level of detail we will think about most. We’ll look at the others, but spend much less time below here.

Machine code translates to binary from assembly.

The instruction set architecture is, notice, where the line between software and hardware lives. This is because these are specific to the actual hardware, this is the level where there are different instructions if you have an Intel chip vs an Apple chip. This level reduces down the instructions even more specifically to the specifics things that an individual piece of hardware does and how they dit.

The microarchitecture is the specific circuits: networks of smaller individual components. Again, we can treat the components as blocks and focus on how they work together. At this level we still have calculations like add, multiply, compare, negate, and we can store values and read them. That is all we have at this point though. At this level there are all binary numbers.

The actual gates (components that implement logical operations) and registers (components that hold values) break everything down to logical operations. Instead of adding, we have a series of and, nand, or, and xor put together over individual bits. Instead of numbers, we have registers that store individual zeros or ones. In a modern digital, electrical computer, at this level we have to actually watch the flow of electricity through the circuit and worry about things like the number of gates and whether or not the calculations finish at the same time or having other parts wait so that they are all working together. We will see later that when we try to allow multiple cores to work independently, we have to handle these timing issues at the higher levels as well. However, a register and gate can be implemented in different ways at the device level.

The device (or transistor in modern electrical digital computers) level, is where things transition between analog and digital. The world we live in is actually all analog. We just pay attention to lots of things at a time scale at which they appear to be be digital. Over time devices have changed from mechanical switches to electronic transistors. Material science innovations at the physics level have improved the transistors further over time, allowing them to be smaller and more heat efficient. Because of abstraction, these changes could be plugged into new hardware without having to make any changes at any software levels. However, they do enable improvements at the higher levels.

Note

For example, Bayesian statistics is a philosophy that treats probability as subjective uncertainty instead of as frequency. This has some interpretative differences, but most importantly it means that we always need an extra factor (multiplied term) in our calculations. This makes all of the math much more complex. For many decades Bayesian statistics was not practical for anything but the simplest models. However, with improvements to computers, that opened new options at the algorithm level. The first large scale application of this type of statistics was by Microsoft after their researchers built a Bayesian player model for player matching in Halo.

9.4. Prepare for this class#

  1. review the notes on what is a commit. In gitdef.md on the branch for this issue, try to describe git in the four ways we described a commit. the point here is to think about what you know for git and practice remembering it, not “get the right answer”; this is prepare work, we only check that it is complete, not correct

  2. Start recording notes on how you use IDEs for the next couple of weeks using the template file below. We will come back to these notes in class later, but it is best to record over a time period instead of trying to remember at that time. Store your notes in your kwl repo in idethoughts.md on an ide_prep branch. This is prep for after spring break, it does not go in the Feb 27 experience branch; keep this branch open until it is specifically asked for

9.5. Badges#

  1. Read today’s notes when they are posted.

  2. Most real projects partly adhere and at least partly deviate from any major design philosophy or paradigm. Review the open source project you looked at for the software.md file from before and decide if it more adheres to or deviates from the unix philosophy. Add a ## Unix Philosophy <Adherance/Deviation section to your software.md, setting the title to indicate your decision and explain your decision in that section. Provide at least two specific examples, using links to specific lines of code or specific sections in the documentation that support your claims.

  3. create methods.md and answer the following:

- Reflecting on your own programming practice, is initial understanding of concepts or debugging later more challenging for you? and why? Your answer here will be "your chosen context" for the rest of the questions. 
- which of the three methods for studying a system do you use most often in your chosen context? Give an example, like an anectdote of learnign something new or a tricky bug you solved. 
- do you think using a different strategy might help you in your chosen context sometimes? why or why not? 
  1. Most real projects partly adhere and at least partly deviate from any major design philosophy or paradigm. Add a ## Unix Philosophy section to your software.md about how that project adheres to and deviates from the unix philosophy. Be specific, using links to specific lines of code or specific sections in the documentation that support your claims. Provide at least one example of both adhering and deviating from the philosophy and three total examples (that is 2 examples for one side and one for the other). You can see what badge software.md was previously assigned in and the original instructions on the KWL file list.

  2. create methods.md and answer the following:

- which of the three methods for studying a system do you use most often when debugging? Give an example
- which do you use when you are trying to understand something new? Is it the same as when you are debugging? why or why not
- do you think the ones you use most often are consistently effective? why or why not? When do they work or not work? (for either learning new thing or debugging)
- what are you most interested in trying that might be different for either learning new things or debugging?

9.6. Experience Report Evidence#

9.7. Questions After Today’s Class#

9.7.1. when will we be starting the collabrative work?#

Next week in lab, you’ll have time to form groups and start working together

9.7.2. Are the sysgetassignment and cspt stuff just to work on badges locally?#

And they’re how I get the issues created in your repos. This exercise was to show you behind the scenes how the course itself applies some of these concepts.

9.7.3. Would it make sense to make terminals more user friendly?#

In a sense, we have done some; there is still more of what is called “cognitive load” or how much a person has to hold in memory, but at the same time, the interactive nature helps. It means you can, for example, run a command with the help option and then figrue out what you need. There are added colors, and more advanced tab complete options.

You can also customize your terminal locally and add aliases, to autmate things you personally do often or make it more like how you want it to be.

explore ideas: (do one of the following and document/write it up)

  • customize your prompt on your main terminal to align with how your think or your personal preferences

  • create an alias to make something you do often easier

  • customize your vscode experience and share your customized settings as a recommendation to others with explanation of what you like and why

9.7.4. What is your definition of abstraction?#

I use it in different contexts, in slightly different ways (eg teaching this class is very different than my research collaboration with affective neuroscientists writing a theoretical piece on a new approach to psychological science). The most concise, useful definition I like is that to abstract is to hide or summarize a level of detail that is not useful for the taks at hand.

9.7.5. What are More differences between monolothic and composable designs?#

This is a good explore badge topic.