Programming Foundations 🧱

Intro

Intro to Introduction to Programming Foundations
πŸ‘¨β€πŸ’Ό Hello! I'm Peter the Product Manager, and I'm excited to guide you through the foundations of TypeScript programming.
In this workshop, we'll explore how values move through programs. This is the fundamental skill you need to write code that works reliably.
We'll cover:
  1. Expressions and Output - Using console.log() to see results, working with strings and numbers
  2. Variables and Immutability - Using let vs const and understanding when values can change
  3. Primitive Types - Understanding type annotations for number, string, boolean, and the difference between null and undefined
  4. Control Flow - Making decisions with if/else and repeating work with loops
  5. Functions - Creating reusable pieces of code with typed parameters and returns
  6. Void and Never - Understanding functions that don't return values or never return at all
This workshop establishes the confidence you need to write code that compiles (actually runs). Every concept here forms the foundation for everything else you'll learn in TypeScript.
By the end of this workshop, you'll be able to:
  • Use console.log() to understand what your code is doing
  • Declare variables with appropriate types
  • Write functions with type-safe parameters and returns
  • Use control flow to make decisions and iterate over data
  • Understand how TypeScript helps catch errors before your code runs
Let's build something solid! πŸ—οΈ
Semicolons and ASI: JavaScript has Automatic Semicolon Insertion (ASI), which means the runtime can insert semicolons when you omit them. In this workshop, we leave semicolons out because our tooling handles the edge cases (e.g. formatting and linting), and it's a style preference. It's also easier to remember the few rules for when you must add a semicolon than to remember all the rules for when you can safely omit them while still using semicolons. If you're curious about the details and tradeoffs, see Semicolons in JavaScript: A preference.
Code comments are notes you write in your code that explain what it does.
Code comments start with // for single-line comments or /* */ for multi-line comments. Comments are ignored by TypeScriptβ€”they're just for humans to read. You'll see comments throughout the exercises to help explain concepts. Feel free to add your own comments to help you understand the code! Here are some examples:
// This is a single-line comment

/*
This is a
multi-line comment
*/

/*
 * Sometimes you'll see multi-line comments
 * with a star at the beginning and end.
 * These extra stars are unnecessary, but
 * look nice so people use them.
 */
🎡 Check out the workshop theme song! 🎢
Loading "Programming Foundations Theme Song"