Technology
Discover facts about technology. Small discoveries that change the way you see familiar things.
Technology

Variable shadowing hides outer logic behind identical names
A function’s local variable can hide an outer variable with the same name, so references inside the function use the local one—a common source of bugs.
Discover more
C++ template compiling takes exponentially longer to run
Templates let C++ generate code during compilation, so heavily templated projects can take much longer to build—sometimes hours.
Discover more
Hardcoded magic numbers make codebase maintenance awful
When a number has no explanation, the next developer may be afraid to change it—even if it sits in the middle of a critical function.
Discover more
Modulo operations on negative values differ by language
Python, C, and JavaScript can give different remainders for negative numbers, so the same-looking operation may behave differently across languages.
Discover more
Why 0.1 plus 0.2 isn't 0.3
Binary floating-point numbers can't represent some decimal fractions exactly. So in many programming languages, 0.1 + 0.2 produces a number slightly different…
Discover more
Unicode updates constantly break legacy string parsing
When Unicode adds new characters or modifiers, text validators built around older character lists may reject them or handle them incorrectly.
Discover moreA bigger world.
One discovery
at a time.
Keep discovering with Stacky. Interesting facts in an app that is always within reach.

SQL range queries include both the start and end values
Unlike half-open ranges common in programming, SQL’s BETWEEN includes both endpoints, a difference that can trip up date queries.
Discover more
Global variables remain accessible from absolutely anywhere
Because any function can change a global variable, its value can shift far from where it was declared, making bugs harder to trace.
Discover more
Unix environments use /dev/null as a data black hole
Writing data to /dev/null makes it disappear; the special file discards anything sent to it. It's a handy destination when software needs to suppress output,…
Discover more
SQL databases treat NULL as unequal to another NULL
A NULL represents an unknown value, so SQL can't determine whether two NULLs are equal. To test for one, developers use `IS NULL`.
Discover more
Version control systems allow totally empty commits
Git can create an empty commit with a special flag, recording an event in the project history even when no files have changed.
Discover more
JavaScript sorts numbers alphabetically by default
Without a comparator function, JavaScript converts values to strings, so [10, 2, 1] sorts as 1, 10, 2 rather than numerically.
Discover more
C's rand function is surprisingly predictable
The function follows a mathematical sequence, so its output can repeat predictably rather than being truly random.
Discover more
Excel preserves a leap day that never happened
Earlier spreadsheet software treated 1900 as a leap year, and Excel preserves the error so dates in old files don’t shift.
Discover more
Large floating point numbers lose single digit precision
Floating-point numbers have limited precision, so a sufficiently large value can be spaced so far from its neighbors that adding 1 rounds back to the same…
Discover more
Pre-incrementing variables executes faster than post
When the old value isn't needed, `++i` avoids returning it; `i++` returns the pre-increment value, which can require a temporary for some types.
Discover more
Bogobogosort turns sorting into an exercise in wasted effort
The joke algorithm repeatedly sorts a smaller prefix, checks the next element, and reshuffles when the pieces fail to fit. Even checking progress can send it…
Discover more
Dynamic typing allows passing text strings into math
In a dynamically typed language, a text string may be passed to a subtraction function without being rejected upfront; the error may appear only when the code…
Discover more
Functional programming absolutely forbids mutating values
In pure functional programming, values are immutable: updating a counter means creating a new value rather than changing the old one.
Discover more
Maximum code test coverage still permits fatal logic flaws
A 100% coverage score means every line ran during testing, not that the program behaved as intended. A test can execute faulty logic without catching the…
Discover more
Why Java treats small integers differently
Java caches boxed integers from -128 through 127 so those values can be reused instead of newly allocated. This applies to boxed Integer objects, not all…
Discover more
Why a Singleton is basically a global variable
A Singleton limits a class to one instance, but using that instance as shared state can create the same coupling as a global variable.
Discover more
Boolean variables consume entire bytes instead of single bits
In many systems, a Boolean takes up a byte rather than a single bit because memory is addressed in byte-sized units. Some formats can pack Boolean values more…
Discover more
Boolean short-circuiting skips evaluating half the logic
In an OR expression, once the first condition is true, the program skips the second. That can save work, but it also means a function call placed there won’t…
Discover more