Menu
Never let a hardware engineer near your code.
Home
Hot
Random
Search
Browse
AI
AWS
Agile
Algorithms
Android
Apple
Azure
Backend
Bash
C++
Cloud
All Categories
HTTP 418: I'm a teapot
The server identifies as a teapot now and is on a tea break, brb
HTTP 418: I'm a teapot
The server identifies as a teapot now and is on a tea break, brb
Condition-checking Memes
Posts tagged with Condition-checking
Loop Logic: The Cliff Of Execution
Programming
Algorithms
Debugging
6 months ago
423.4K views
1 shares
The eternal battle between while-do and do-while loops played out through Road Runner and Wile E. Coyote! On the left, Road Runner safely checks the condition (!edge) before running, saving himself from the cliff. Meanwhile, poor Coyote executes run() first and only checks (!edge) after he's already airborne. And that's why you always validate before executing, folks! The difference between falling and living another day is literally one line of code.
The Edge Case Cliff Disaster
Programming
Debugging
Algorithms
Javascript
9 months ago
445.1K views
1 shares
The classic Road Runner vs. Wile E. Coyote scenario reimagined as a programming loop disaster! On the left, Road Runner's code uses a proper while (not edge) { run(); } loop that will terminate when reaching the cliff edge. Meanwhile, poor Coyote is using a do { run(); } while (not edge); loop—checking the condition after execution. He's already run off the cliff because his condition check comes too late! The fundamental difference between pre-test and post-test loops perfectly illustrated through cartoon physics. The variable edge isn't even defined until it's too late, and by then gravity.js has already been imported!
Today's picks
ErGear Freestanding Dual Monitor Stand for 2 Screens up to 32 inch, Heavy Duty Monitor Mount Holds Max 22 lbs per Arm, Height Adjustable Computer Monitor Stand for Desk, VESA 75x75/ 100x100mm, Black
Affiliate
$28.49
Space better than No Space!!
Programming
75.3K views
4 years ago
Was going through old memes on my phone and found this
Programming
123.6K views
5 years ago