I asked mid-level core course instructors
What tools should CS students know about early?
I expected development tools like grep
and git
, but that’s not what I got…
You have a brain.
It is complicated.
Two parts of your brain strongly impact your learning.
If you are consciously thinking about it, it is in working memory.
Working memory is powerful but limited (∼ 3 ideas).
Working memory shrinks when tired, malnurished, ill, stressed.
Distractions also occupy working memory.
Your subconscious automates what it can.
Each conceptual automator is called a “schema”.
Schema shrink complicated ideas into simple pieces that fit in less working memory.
Learning is largely buidling or refining schema; requires some working memory.
Ideal cognitive load:
old idea 1old idea 2new idea
Problematic cognitive load:
old idea 1aold idea 1bold idea 2a overload
Usually, trouble with task n means didn’t fully learn from task n − 1.
Using tools to do things (calculators, copy-paste, LLMs) doesn’t build schema.
Memorizing doesn’t build useful schema (unless you’ll use it many times).
Repeated exercise with varied instances does build schema,
especially if you design the instances yourself.
Identify that there is a bug.
Understand what should have happened and what happened instead.
Locate the bug within the code.
There’s only one way to do this too:
Pick a location in the code.
Predict the expected value of all variables there.
Check to see it they have those values (with debugger or prints).
Pick a new location: earlier if wrong there, later if right there.
Change the code to remove the bug. This might involve
Fixing an error in computatation or API use (easy)
Splitting two related ideas from one variable into two (medium)
Bring new data to that location by adding variables or data structures (hard)
To code without needing much debugging:
Start with correct but featureless code.
Add the smallest additional feature you can.
Test that small addition (and retest everything before it).
Some recommend swapping steps 2 and 3: writing the test before starting to code.
Return to step 2.
Works best given a list of features to add before you begin (a design).
If it seems like the next feature is big, refactor.
This was one of the first software design principles to be identified and published (by Fred Brooks in 1975) and remains widely recommended today.
In school, this helps reinforce your schema, makes all future work easier.
In industry, this reuslts in safer, more reliable, more efficent software.
Disk space is cheap.
Experimentation is easy.
Recovering from a bad experiment is only cheap if you have old versions on hand.
Options:
Manual snapshotting: after adding each feature, make a copy of your source code.
IDE history logging: many IDEs have a “timeline” feature.
Version-control software: git
and its peers can automatically store many versions.
Undo is not a viable option: can easily lose history.
Pick one. Learn it. Use it.
Mice are slow and hard to automate with schema, but easily learned.
Keyboards are fast and easily automated with schema, but harder to learn.
Become a Power User. Use the keyboard.
Almost every command has a keyboard shortcut. Learn 1 or 2 each week.
The terminal/command line/console/shell is designed to be keyboard-only.
It has orders of magnitude more capabilities than any other application I know of.
Learn it on your own, for example by using the following: