Making the Computer Work for You
Programming for non-programmers
G. Wade Johnson
notes
Pre-requisites
- Familiar with a text editor
- Familiar with a command line
- Can run programs on the command line
notes
Core Concepts
Computers are dumb, but fast.
notes
Core Concepts
One-shot programs don't have to be efficient.
notes
Core Concepts
Let the computer do the boring, repetitive stuff.
notes
Core Concepts
A series of simple steps is better than a complicated solution.
notes
Core Concepts
It's more important to solve the problem than to perfect the program.
notes
Core Programming Concepts
- Sequence
- Variables
- Iteration
- Subroutines
notes
Writing
- Not everyone can write a novel, screenplay, or technical manual.
- Not everyone can write a short story.
- Almost everyone can handle a todo list or thank you note.
- Most people can write a paragraph.
notes
Programming is Like Writing
- Not everyone can write a production program with 24/7 up-time.
- Not everyone can write a word processor.
- Almost everyone can handle putting a series of commands in a shell script or batch file.
- Most people can handle a simple script.
notes
Problem 1
Start a set of programs
notes
Problem 2
Find a string in a file
notes
Problem 2a
Find a string in multiple files.
notes
Problem 3
Find a number of a certain type in a file.
- A negative number
- A number less than 1000
- A number greater than 1284000000
notes
Problem 4
Append a line to a set of files.
notes
Problem 5
Insert a line in multiple files.
notes
Problem 6
Delete a particular line from a file.
notes
Problem 7
Rename a set of files based on some criteria
DSCN#####.JPG -> Vacation-yyyymmdd-hhmmss-wade.jpg
notes
Problem 8
Perform the same action on a set of files obtained from another program.
notes
Problem 9
Code generation
notes