Have you wanted to learn to code?

This is your chance! In about 30 total hours, including 12 hours of video instruction plus exercises, we walk with you from the absolute basics of adding one plus one to writing a small complete application that constructs personalized crossword puzzles that you can give to your family and friends.

The world of computer programming can open up many doors. But you won't retain the knowledge unless it's enjoyable to learn. Each of 19 modules in The Basics section focuses on a particular goal, such as reading a crossword grid from a file or finding word matches, and we introduce only those language concepts necessary to accomplish that goal.

Take it at your speed! In each module there are three or four challenges where you will stop the video and code on your own. You will make mistakes! There will be some unexpected errors, and there will even be some struggles! But this is where the learning happens and after you get things to work it will ignite your sense of wonder about the power of computers and you will be proud of your mastery of this subject. You will realize (shh, it's our secret!) that coding isn't so hard after all!

The Basics Modules

These links are clickable into the YouTube videos

Module 0
Course Overview Goal-based instruction 2:20 Module format 3:36 Crossword puzzles 5:03 Choice of programming language 6:26
Module 1
Crossword Puzzles
Module 2A
Set up C++ for Windows
Module 2B
Set up C++ for Browser
Module 2C
Set up C++ for Linux
Module 2D
Set up C++ for Mac
Module 3
Add 1+1! operator+ 3:00 main() function 3:22 cout 8:53 #include 9:20 // comments 14:43
Module 4
Load a Grid (Part 1) int variable 1:42 string variable 5:46 STL string 7:22 string::size() 8:32 string::clear() 11:39 string::empty() 17:49 string::append() 19:47 string::operator+= 21:19 string::find() 22:15 string::operator[] 24:24
Module 5
Load a Grid (Part 2) STL vector 4:43 vector::push_back() 6:40 vector::size() 9:42 vector::front() 10:25 vector::operator[] 12:00 for loop (over set) 12:30 for loop (counting) 14:12 operator++ 15:20 assert() 18:32 operator== 18:44
Module 6
The Grid Object C++ struct 5:51 member function 6:41 scopes 9:04 return statement 10:15 if-else statement 27:16 void 28:33 const member function 30:33 constructor 38:53
Module 7
Read the Grid from a File ASCII encoding 1:42 ASCII character table 5:16 end-of-line (EOL) concerns 8:20 file input 12:41 include fstream 13:19 ifstream 13:24 while statement 14:18 feof (end of file) 15:00 NOT (!) unary logical operator 15:32 getline (file read) 16:00 AND (&&) binary logical operator 30:30 operator != 30:49
Module 8
Read the Library from a File Library file: http://bit.ly/top_12000 1:30 C++ class 7:00 private data 10:42 end-of-line character handling 19:43 vector::resize() 32:12 Library word counts 41:06
Module 9
Search the Library Encapsulation 2:28 toupper() 5:45 Algorithmic complexity (Big-O notation) 19:20 typedef 26:32 Multiple word buckets 33:16 Manual hashing 46:06 Better hash function 52:57
Module 10
Search the Library, Fast! What is a hash table 0:40 STL unordered_map (hash table) 2:27 unordered_map::count() 12:19 unordered_map::operator[] 14:00 default constructor 15:57 unordered_map::find() 19:00 STL iterator 19:48 auto keyword 20:30 unordered_map::bucket_count() 23:04 unordered_map::load_factor() 25:35
Module 11
How Memory Works kmemory layout 4:50 sizeof 6:48 address of (&) and dereference (*) operators 6:57 fragmented memory 9:47 call by value, call by reference, call by pointer 14:29 stack vs. heap 35:25 new 39:55 delete 42:48 unique_ptr and RAII 43:21
Module 12
Pattern Hash xwordinfo.com 4:08 onelook.com 6:36 const reference argument 13:00 power of two 52:45 binary permutations 56:45 operator & and bitfield masking 59:48 word masking 1:00:36
Module 13
Points and Spans choice of origin 1:28 Point class 3:45 ofstream operator<< 11:26 friend 12:33 Span class 18:37
Module 14
Find Spans in the Grid POD (plain old data) objects 3:28 FillSpans() 5:36 point in_bounds() 7:18 Grid::Next() iteration 13:38 refactoring example 28:00 FillSpans() 35:13
Module 15
Get Strings from the Grid Line span bug fix 1:47 Word length library bug 12:35 Read strings from grid 20:45 Get point in span 26:50
Module 16
Solver Class Solver class definition 2:34 Loop over spans 8:18 Recursion 8:35 Slot struct 12:08 Attr struct 17:18 CommitSlot() 33:15 Dereference iterator 43:10 "D---" completion words 45:21
Module 17
Write Words to the Grid WriteString() 2:54 write_box() 5:17 Baby recursion example 12:18 Recursiion depth example 14:21 Object copy 18:58 Depth limits 19:17 Walk through of recursion 21:02 Bug: not checking completed words 27:07 Writing multiple words to grid 27:51 Abort on completing non-word 34:12 Commiting all words not just the first 36:08 Found a solution! 42:28
Module 18
Preventing Duplicates 3x3 duplicate bug example 1:06 STL unordered_set 2:40 include unordered_set 5:24 ExistsInSet() 5:56 AddToSet() 8:12 Small example of StringSet 9:56 Solution to 3x3 bug example 15:27 Solutions to CAT-DOG switched 18:50
-->

Advanced Modules

These may be videos or blog entries, TBD.

For further discussion please see:

System Requirements

This class teaches the C++ programming language. When learning to program, you have many good choices of general-purpose programming languages including Python, Java, Javascript, Go, C#, Ruby, and Rust, to name a few. See Module 0 for more discussion about these choices. "R" and SQL are two examples of special-purpose languages not included in this list; you are best to seek specialized instruction if statistical computing or relational database programming is your goal.

Otherwise, for basic functionality such as the data structures and simple algorithms that we teach in this course, all of these languages are more similar to each other than they are different. A good course of action is to find a course with subject matter that you enjoy as the most important priority, for instance this course teaches how to construct crossword puzzles, learn the language that that course teaches, and then it is straightforward to learn the syntax of any other language later as needed for your particular situation.

To perform the exercises you will need a compute environment that has an installed and working GNU Compiler Collection (GCC) G++ compiler that converts C++ source code into an executable that will run on your system. G++ is a standard tool worldwide but in most systems it does not come enabled by default, so you will need to perform some installation and configuration steps. Most other C++ compilers should also work with no changes to the source code if you happen to have another one besides G++ available to you. You will also need an editor and/or an Integrated Development Environment (IDE) that lets you write the source code files.

Module 2 discusses how to create your environment for these different platforms:

"Browser" means there are websites that let you enter, save, compile, and run C++ by using only a browser. Some activity like reading from files or running a large amount of compute (for big crosswords) can be limited in these environments, but they let you get started easily.

All video content is delivered on YouTube. At multiple points per module, you will be asked to pause the video and type in code yourself. You only learn programming by doing, so get ready to roll up your sleeves!

Get Started

Take the first step and dive in! Your coding journey awaits.