browse/

7 results
databases/sql-window-functions-how-every-row-gets-a-rank-or-running-total-withou.md SQL window functions: how every row gets a rank or running total without collapsing the table A window function adds a calculated column to every row without collapsing rows the way GROUP BY does. Learn what OVER, PARTITION BY and… 4 min read · 8 Nov languages/javascript-closures-how-a-function-remembers-a-variable-after-the-func.md JavaScript closures: how a function remembers a variable after the function that made it has finished A function in JavaScript can still use a variable long after the function that created it has finished. That is called a closure, and you… 5 min read · 3 Nov software-design/the-observer-pattern-how-a-shop-tells-many-functions-about-one-order-w.md The observer pattern: how a shop tells many functions about one order without knowing them A shop that must email a receipt, update stock and add loyalty points ends up with one function that knows about everything. Every new… 5 min read · 27 Oct software-design/refactoring-how-to-tidy-working-code-without-breaking-it.md Refactoring: how to tidy working code without breaking it Refactoring means changing how code is built on the inside without changing what it does. It sounds risky, but there is a simple routine… 6 min read · 24 Oct languages/python-default-arguments-why-a-function-remembers-the-last-call.md Python default arguments: why a function remembers the last call Call a small Python function twice and the second call remembers the first. The cause is a default value like `basket=[]`, which Python… 4 min read · 13 Oct software-design/pure-functions-why-the-same-call-can-give-two-different-answers.md Pure functions: why the same call can give two different answers Call a function twice with the same input and get two different answers? Python isn't broken. The function is doing something extra, called… 5 min read · 9 Oct software-design/functions-why-you-should-stop-copy-pasting-your-code.md Functions: Why You Should Stop Copy-Pasting Your Code Copy-pasting code works fine on the day you do it. It fails the day you need to change it, and have to find and fix every copy without… 9 min read · 1 Oct