From the course
Common coding mix-ups, explained
The mistakes almost everyone makes when they start, from margin versus padding to = versus ===. Each page says what people tend to believe, what is true instead, and opens the lesson where a tutor watches you practise it.
Unit 0 · What a computer actually does
- Why 8 bits make 256 values, not 8Not quite: “Each switch stores one value, so 8 switches store 8 values.”Read the fix
- How a computer stores a letter as a numberNot quite: “A computer understands words and letters directly.”Read the fix
- Relative vs absolute paths, explainedNot quite: “A relative path always starts from the main site folder.”Read the fix
- Why your image works locally but not onlineNot quite: “If the file is on my Desktop, the website can find it there.”Read the fix
Unit 1 · How the web works
- Domain vs hosting vs DNS: what each one doesNot quite: “Buying a domain gets you a website.”Read the fix
- What DNS does when you type a web addressNot quite: “The browser already knows where every website is.”Read the fix
- What the # part of a URL doesNot quite: “The part after # is another page.”Read the fix
- Why #/ hash routes are not separate pagesNot quite: “cornerbakery.ca/#/menu is the same as cornerbakery.ca/menu.”Read the fix
- What the ?query part of a URL doesNot quite: “The ?sort=price part is the name of a page.”Read the fix
- Why a 404 doesn’t mean the internet is downNot quite: “404 means the internet is down.”Read the fix
- 404 vs 500 errors: who needs to fix itNot quite: “Every error is a 404.”Read the fix
- Is a 301 redirect an error? No, here is whyNot quite: “A redirect is something the site needs to fix.”Read the fix
- How to read an HTTP request and responseNot quite: “GET is part of the answer that came back.”Read the fix
- Why a link without https:// gives a 404Not quite: “A link to www.example.com works without https://.”Read the fix
- Why “click here” is bad link textNot quite: “"Click here" is fine link text.”Read the fix
Unit 2 · HTML: structure and meaning
- Why the title tag isn’t the headingNot quite: “The title is the big heading you see on the page.”Read the fix
- HTML head vs body: what goes whereNot quite: “Anything at the top of the page goes in the head.”Read the fix
- How one missing closing tag breaks a pageNot quite: “Closing tags are optional decoration.”Read the fix
- HTML heading levels are not font sizesNot quite: “Heading levels are font sizes.”Read the fix
- The <header> element vs a headingNot quite: “Anything that looks like a heading belongs in <header>.”Read the fix
- Why <div class="header"> isn’t a headerNot quite: “A div with a class name is just as good.”Read the fix
- Why placeholder text is not a labelNot quite: “Placeholder text is enough of a label.”Read the fix
- How to write alt text (it’s not the file name)Not quite: “Alt text is the image file name.”Read the fix
Unit 3 · CSS: the look and the layout
- Margin vs padding in CSSNot quite: “Margin and padding are two words for the same space.”Read the fix
- Why a 200px box ends up wider than 200pxNot quite: “If width is 200px, the box is 200px wide.”Read the fix
- Why border: 5px shows no border in CSSNot quite: “border: 5px is enough to draw a border.”Read the fix
- Does the last CSS rule always win?Not quite: “The rule written last always wins.”Read the fix
- ID vs class specificity in CSSNot quite: “A class and an id are about equally strong.”Read the fix
- Why !important makes CSS harder to fixNot quite: “!important always wins.”Read the fix
- Why display: flex goes on the parentNot quite: “You put display: flex on the things you want in a row.”Read the fix
- Flexbox gap vs margin: spacing itemsNot quite: “gap is space around each item, like margin.”Read the fix
- flex: 1 vs width: 33% for equal columnsNot quite: “Equal widths means width: 33%.”Read the fix
- CSS grid: 1fr vs 100% columnsNot quite: “100% means "the rest of the space".”Read the fix
- Mobile first: min-width vs max-widthNot quite: “Design for desktop, then patch the phone with max-width.”Read the fix
- Media query not working on a phone? Two fixesNot quite: “More media queries will fix it.”Read the fix
- Why your page scrolls sideways on a phoneNot quite: “Pixel widths make the layout look exactly as designed.”Read the fix
Unit 4 · Thinking like a programmer
- = vs === in JavaScriptNot quite: “One = inside an if checks whether two things match.”Read the fix
- Why changing one variable doesn’t change anotherNot quite: “Changing bonus later also changes score, because score was made from bonus.”Read the fix
- let vs const in JavaScriptNot quite: “const and let are the same kind of box.”Read the fix
- Why "2" + 2 is "22" in JavaScriptNot quite: “+ always means add.”Read the fix
- == vs === in JavaScript: which to useNot quite: “Switching to == is the clean fix.”Read the fix
- "true" vs true: strings vs booleansNot quite: “"false" is a boolean.”Read the fix
- Why the order of if / else if checks mattersNot quite: “The order of the checks does not matter.”Read the fix
- < vs <=: getting boundaries right in codeNot quite: “"Under 5" includes 5.”Read the fix
- How many times does a for loop run?Not quite: “i < 4 runs the body once more, or once less, than four times.”Read the fix
- Why a countdown loop runs foreverNot quite: “n++ and n-- do the same job.”Read the fix
- return vs console.log in JavaScriptNot quite: “Showing the answer with console.log is the same as giving it back.”Read the fix
- Defining a function doesn’t run itNot quite: “Writing a function runs it.”Read the fix
- Why "name" in quotes prints the word nameNot quite: “name inside the function is the word "name".”Read the fix
Unit 5 · Data and algorithms
- Why arrays start at 0Not quite: “The first item in a list is item number 1.”Read the fix
- Array vs object: which one to useNot quite: “A contact is a list of things about a person, so it is an array.”Read the fix
- Why binary search needs a sorted listNot quite: “Binary search works on any list.”Read the fix
- Why your search gives up after one itemNot quite: “If the first card is not a match, the target is not there.”Read the fix
- Why JavaScript sort puts 10 before 9Not quite: “.sort() with nothing inside sorts numbers by size.”Read the fix
- Why nested loops get slow: O(n²) by feelNot quite: “Two loops means twice the work.”Read the fix
- What O(1) really meansNot quite: “O(1) means the code takes exactly one step.”Read the fix
- Why binary search is O(log n), not O(n)Not quite: “Binary search has a loop, so it is O(n).”Read the fix
- Recursion base case: why it never stopsNot quite: “The function will stop by itself when it runs out of numbers.”Read the fix
Unit 6 · JavaScript in the page
- querySelector vs getElementById: the # ruleNot quite: “You select an element by its id name alone.”Read the fix
- Why querySelector returns nullNot quite: “Adding a delay is the right fix.”Read the fix
- The DOM vs your HTML fileNot quite: “document means the HTML file on disk.”Read the fix
- Why addEventListener runs your function at onceNot quite: “You plug in a function by writing it with brackets, like addToCart().”Read the fix
- 'click' vs onclick: naming events in JavaScriptNot quite: “The event is called onclick.”Read the fix
- State: change the data, then renderNot quite: “The screen updates itself, and the variable follows.”Read the fix
- Removing a clicked item: pop vs splice vs filterNot quite: “pop() removes the task that was clicked.”Read the fix
- Why fetch gives you a Promise, not the dataNot quite: “fetchMenu() hands back the dishes straight away.”Read the fix
- await is only valid in async functionsNot quite: “You can write await anywhere.”Read the fix
- JSON vs a JavaScript object: the strict rulesNot quite: “Single quotes work in JSON like they do in JavaScript.”Read the fix
- Why you see [object Object]Not quite: “toString() turns an object into JSON.”Read the fix
- Why JSON.parse, not eval, reads JSONNot quite: “eval is a fine way to read JSON.”Read the fix
Unit 7 · Data that lasts
- localStorage vs a database: where data livesNot quite: “localStorage is a small database.”Read the fix
- localStorage only stores stringsNot quite: “Storage can hold a list just like a variable can.”Read the fix
- Why your variables reset when you refreshNot quite: “A variable keeps its value until I change it.”Read the fix
- SQL clause order: SELECT, FROM, WHERE, ORDER BYNot quite: “The parts of a query can go in any order.”Read the fix
- SQL text values need single quotesNot quite: “Text values can be typed as they are, like numbers.”Read the fix
- Safe SQL UPDATE: always WHERE id =Not quite: “I can find the latte by its old price.”Read the fix
- A primary key is not a row numberNot quite: “The id is just the row's position in the list.”Read the fix
- SQL JOIN without ON: why rows multiplyNot quite: “Naming both tables is enough for SQL to match them up.”Read the fix
- One-to-many: customers, orders and foreign keysNot quite: “The customer belongs to the order.”Read the fix
- Why API keys can’t go in front-end JavaScriptNot quite: “A secret key is safe in the JavaScript because visitors never look at the code.”Read the fix
- Why process.env doesn’t hide keys in the browserNot quite: “Reading the key from process.env keeps it out of the front end.”Read the fix
- Publishable vs secret API keysNot quite: “Every key is secret.”Read the fix
- How a site knows you’re logged inNot quite: “Sending the password every time is the most secure way to prove who you are.”Read the fix
Unit 8 · Vibe coding with guardrails
- How to write an AI coding prompt like a specNot quite: “"Modern and clean" is a clear design instruction.”Read the fix
- Read AI-written code before you run itNot quite: “If the comment says it, the code does it.”Read the fix
- Test the edge case: where AI code breaksNot quite: “A couple of normal orders are enough to test it.”Read the fix
- Commit before you let AI change your codeNot quite: “You commit once the AI has finished.”Read the fix
- git revert undoes one commit, not the latestNot quite: “Revert undoes whatever happened most recently.”Read the fix
- innerHTML vs textContent: avoiding XSSNot quite: “innerHTML is just a way to put text on the page.”Read the fix
Unit 9 · Ship it and keep it alive
- Pushed is not live: verify a deployNot quite: “Once the code is pushed, the change is live.”Read the fix
- Preview URL vs production: what customers seeNot quite: “The preview link shows what customers see.”Read the fix
- A record vs CNAME: which DNS record to useNot quite: “Any record that points the site somewhere is an A record.”Read the fix
- SPF is a TXT record, not an MX recordNot quite: “Anything about email is an MX record.”Read the fix
- Why DNS changes take time: TTL explainedNot quite: “A DNS change takes effect the moment you save it.”Read the fix
- Nameservers vs DNS records: change with careNot quite: “Nameservers are just another address for the site.”Read the fix
- Leaked an API key? Revoke it firstNot quite: “Deleting the key from the code stops the leak.”Read the fix
- Deleting a file doesn’t remove it from gitNot quite: “Once a file is deleted, git forgets what was in it.”Read the fix
- Why a new environment variable needs a deployNot quite: “Deploy first and add the variable after.”Read the fix
- Why a new repo can come out publicNot quite: “New repos are private by default, so there is nothing to check.”Read the fix
- Old content on your site: stale vs brokenNot quite: “If the site shows old content, it is broken.”Read the fix
- Reading cache headers: HIT, age and cache-controlNot quite: “HIT means the copy has expired.”Read the fix
- Why localhost doesn’t mean it’s liveNot quite: “If it shows on localhost, it is live.”Read the fix
- How to restore a backup safelyNot quite: “Restoring the latest backup straight over production is the quickest fix.”Read the fix