Shortest Path Academy

Shortest Path Academy

A free, comprehensive course.

Michael's shortest path to full-stack development.

The least you need to know to have a solid foundation in programming, data structures, algorithms, and web development.

Read this Intro to see
if this free, opinionated
course is for you.

Introduction

"Which language should I learn?" "Which web framework should I learn?" Tutorial Hell ("Okay, but how do I actually write programs?"). Libraries and frameworks. Programming vs. shopping. About this (opinionated) course. Thoughts on AI coding. About Michael.

Programming Tools

Editors and IDEs, keyboards, databases, operating systems, git. Installing all the tools you'll need for this course.

Step-by-step: Getting set up with vscode, Python, Node.js, C#, Java, C++, SQLite browser, git and Linux.

Programming Tools Exercises

  • Typing and keyboard shortcuts in vscode
  • Editor preferences
  • Practicing regular expressions in the editor
  • Using Windows PowerShell
  • Using WSL for Linux on Windows
  • Using the Linux command line
  • Setting up a repository and practicing git operations
  • Setting up DB Browser for SQLite

Bits, Bytes, Strings, and Programming Languages

Computer Memory and Computer Languages

  • 28 = 256: Building bytes and accessing bits as values
  • 210 = 1024: Getting a grip on memory sizes
  • Data types built from bytes
  • Variables are boxes holding values built from bytes
  • Strings: ASCII, Unicode, UTF-8, and escaping
  • Arrays
  • Records / objects / maps / dictionaries
  • Programming languages: Python, JavaScript/nodejs, C/C++, C#, Java
  • Writing and debugging code in the vscode IDE
  • Understanding values vs. pointers/references to values
  • Programming with and without pointers
  • Type strictness
  • Memory management options
  • Machine language, compilers, and interpreters
  • Computer and language speeds
  • What "comes with" a computer language?

Exercises in Python, Node.js, Java, and C++

  • Declaring variables in different languages
  • Writing and debugging lines of code in different languages
  • Indentation is your friend
  • Comparing the syntax of different languages (basically just two styles)
  • Choosing datatypes (numbers, strings, arrays, objects) for a program
  • Arrays of objects, arrays as object members
  • Examining how strings are stored
  • Exploring values vs. pointers/references to values
  • Comparing type strictness across languages
  • Comparing how memory allocation and release happen across and within languages: manual, scope-based, garbage collected
  • Checking the speed of string and record manipulation in different languages

Functions

Function calls, parameters, return values, and the call stack. Libraries, APIs, and web requests.

Function Exercises

  • Tracing and counting function calls
  • Watching the call stack
  • Scope-based memory allocation in functions
  • Objects vs. pointers to objects, revisited
  • Refactoring code into functions
  • Loops vs. recursion
  • Infinite recursion
  • Speed of function calls with large parameters

Plain Programming

Variables, assignments, scope, if/else/switch, loops. Arrays, records, pointers and references. Functions, lambdas, event handlers, callbacks, closures. Reading and writing files, working with paths and directories. Regular expressions. Comments. Debugging: Logging, stepping.

Exercises: Writing short programs in Python, JavaScript, and Java

  • Greet the user (variables, if/else)
  • Playing with the scope of variables and parameters
  • Trivia quiz game (variables, if/else)
  • Terminal star-art exercises (variables, loops, if/else)
  • Convert a string to a number (loops, if/else)
  • Transactions on a back account (records, lambdas, closures)
  • Number guessing game (variables, if/else, loops)
  • Create an input form and save data in directories (variables, files, directories)
  • Make a simple calculator (variables, if/else/switch)
  • Determine if a number is prime (variables, loops, if/else)
  • Regular expressions to scrape phone numbers and URLs
  • Making random art in the browser
  • Graphing simple math functions in the browser

Project: Text-based adventure game

Practices variables, string manipulation, if/else/switch, functions, arrays, records.

Project: Word-processing spell checker and text analyzer

Practices file I/O, if/else/switch, loops, variables, string manipulation, regular expressions.

Package Managers

npm and vcpkg

Package Manager Exercises

  • Installing npm
  • Installing and using npm packages
  • Installing vcpkg
  • Installing and using vcpkg libraries

Trees and Tree Data Formats

XML, JSON, recursive functions for recursive data.

Trees Exercises

  • Representing and accessing data in XML
  • Representing and accessing data in JSON
  • Searching XML recursively
  • Searching JSON recursively
  • Searching directories recursively
  • Creating and searching trees of objects
  • Comparing linear vs. tree search
  • Making a trie for spell-checking
  • Drawing trees on the browser canvas

Thinking Like a Programmer

Data structures and pseudo code, using classes and interfaces, libraries vs. custom code, when to make a function, function and variable names, parameters and parameter objects, exceptions vs. return values, using caches. Unit testing.

Exercises

  • Data first: Doing (almost) everything with arrays
  • Breaking it down, and iterative improvement
  • How pseudocode looks in your head and in the editor
  • Rename these variables
  • Rename these functions and parameters
  • Deep and shallow copies of data structures
  • Converting between exceptions and return values
  • How classes work, and understanding when they work best
  • Why caching is (almost) always the answer to speed issues, and when to invalidate caches
  • Shopping for libraries, or not
  • Shopping for frameworks, or not
  • If you don't like the way the language is making you think, make the language think like you

Data Structures & Algorithms (DSA)

Arrays, linked lists, trees, hash tables, sorting, searching and caching, order of growth. What DSA are used in practice? My experience with whiteboard coding/algorithm interviews, including Amazon.

DSA Exercises

  • Doing (almost) everything with arrays and maps
  • Building linked lists from objects and references
  • Building graph structures from objects and references
  • Breadth-first and depth-first search of trees
  • The shortest path algorithm
  • Space vs. speed tradeoffs
  • Identifying order of growth: O(1), O(log2n), O(n), O(n•log2n), O(n2), O(n3)
  • Hash tables and hash functions
  • What does O(1) actually mean for hashing?

Exercises: Easier Leetcode-style problems

Exercises: Harder Leetcode-style problems

Project: Writing a Connect 4 AI with minimax breadth-first search

Overview of Web Technologies

Browsers, servers, HTTP, HTML, CSS, JavaScript, DevTools, preprocessors.

Exercises

  • Looking at and modifying websites in DevTools
  • Comparing DevTools across browser brands
  • Tabs: Elements, Console, Network, Sources, Application

Front-End Programming

HTML, the DOM, CSS proficiency, DevTools and debugging. JavaScript proficiency. Responsive design. Ajax calls. caniuse.com. The MVC concept.

HTML and CSS Exercises

  • Viewing HTML elements and CSS rules in DevTools
  • HTML and CSS layout practice and challenges
  • More CSS challenges, including animation
  • More CSS challenges, responsive layouts
  • Making a resume page

JavaScript Exercises

  • Relationship between JavaScript, HTML, and CSS
  • Thinking in terms of event handlers
  • Modifying the DOM and CSS rules dynamically
  • What JavaScript errors look like
  • Debugging in DevTools and vscode
  • Minifying and obfuscating

Async JavaScript Exercises

  • Understanding async and promises
  • Practice with async and promises

Small Front-End Projects

  • Quiz app
  • To-do list
  • Input form with validation
  • Calculator app
  • Bouncing screen saver
  • Weather app with Ajax calls
  • Calendar app with Ajax calls

Project: Wordle game

Make a complete Wordle game including layout, word checking, animations, and saving player stats. Exlore the MVC concept in the context of a game.

Project: Code pretty-printer

Make a code pretty printer than transforms a block of JavaScript text into a colorful display as seen in an editor like vscode.

Project: E-commerce front-end

Make the front-end for a shopping app, including search, pagination, listing and detail pages, cart, and check-out page.

Project: Kanban board front-end

Make the front-end of a kanban board for project management, including a drag-and-drop interface for creating, deleting and moving tasks around. Sort tasks by priority, date, and other criteria.

Back-End Databases

SQLite, mySQL, Postgres, Mongo. The SQL language for saving and retrieving data.

Database Exercises

  • SQLite and DB Browser for SQLite
  • Using SQL to populate database tables
  • Using SQL to select records/fields from database tables
  • SQL JOINs
  • SQL nested SELECTs
  • SQL UPSERT
  • Measuring database speeds

Back-End Programming

HTTP libraries, server APIs.

Simple Back-End Exercises

  • Running a server locally in Python, Node, and Java
  • Making a simple back-end for the earlier front-end exercises
    • Quiz app
    • To-do list
    • Input form with validation
    • Calculator app
    • Calendar app with Ajax calls

Project: Wordle game

Make a back-end for our earlier World game. Explore the MVC concept in the context of a game.

Project: E-commerce back-end

Make a back-end for our earlier e-commerce site.

Project: Kanban board back-end

Make a back-end for our earlier kanban board site.

Threads

Threads vs. processes, uses of threads, dangers of threads, locks/mutexes, threads vs. events, thread handlers, parallel processing, threads vs. processes.

Threads Exercises

  • Threads vs. processes
  • Sharing data among HTTP handler threads
  • Creating and avoiding deadlock
  • Comparing thread speed for memory operations
  • Comparing thread speed for database operations

Server Setup

Hosting and VPS, Linux proficiency, ssh and scp, firewall and security, nginx, certbot, services, Docker containers.

Project: VPS

Step-by-step guide to setting up a VPS as a server to host https://shortestkanban.xyz

Thinking Like a Back-End Programmer

Efficiency, stability, security, logging. Sending email, authenticating users, monitoring services. Unit testing.

Scaling the kanban server

  • Avoiding premature optimization
  • Validating user input
  • Considerations for a large number of users
  • Adding image data
  • Considerations for a large amount of data
    • Data structures
    • Caching
  • Keeping users up-to-date with board changes in real time
  • Adding logging
  • Adding monitoring
  • Using an inexpensive email provider for low-volume emails
  • Using an email provider for high-volume transactional and marketing emails

Structuring Large Programs

Modules, namespaces, class hierarchies, micro-services.

Ideas for structuring the kanban server

Overview of Higher-Level Tools

Cloud providers, web frameworks, kubernetes, Electron: an exploration of what's out there.

Shortest Path Academy

Shortest Path Academy

A free, comprehensive course.

Michael's shortest path to full-stack development.