<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SQL on miti99</title><link>https://miti99.com/en/tags/sql/</link><description>Recent content in SQL on miti99</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 16 Nov 2026 17:39:19 +0700</lastBuildDate><atom:link href="https://miti99.com/en/tags/sql/index.xml" rel="self" type="application/rss+xml"/><item><title>Newsletter #71</title><link>https://miti99.com/en/post/2025/12/14/</link><pubDate>Sun, 14 Dec 2025 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2025/12/14/</guid><description>&lt;p&gt;&lt;em&gt;Enjoy Newsletter #71.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="a-modern-guide-to-sql-joins"&gt;&lt;a href="https://kb.databasedesignbook.com/posts/sql-joins/" rel="noopener noreferrer"&gt;A modern guide to SQL JOINs&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Alexey Makhotkin writes an extensive guide to SQL JOINs with a markedly different approach from typical tutorials: teaching LEFT JOIN before INNER JOIN, and using only equality comparisons between two IDs in the ON condition while pushing all other filtering conditions into WHERE. He divides joins into three cases. The N:1 case, where the primary key sits on the right side of the ON condition, is the most useful because the number of result rows never exceeds the row count of the left table. The 1:N case is awkward and best avoided, while M:N is a source of subtle bugs. All examples use a small database with employee and payment tables, accompanied by live runnable queries on dbfiddle.uk.&lt;/p&gt;
&lt;p&gt;The later sections explain INNER JOIN as a filtered Cartesian product, how to use self-joins to handle hierarchical data like manager relationships, and why Venn diagrams are a misleading visualization: they fail to show how rows get multiplied. He also argues that RIGHT JOIN is redundant, and thoroughly analyzes the double-counting bug that happens when chaining multiple LEFT JOINs followed by a GROUP BY, along with how to redesign the query to be both correct and fast. The overarching message: SQL is too permissive and won&amp;rsquo;t protect you from simple mistakes, so impose discipline on yourself when writing queries.&lt;/p&gt;
&lt;h2 id="punycode-my-new-favorite-algorithm"&gt;&lt;a href="https://www.iankduncan.com/engineering/2025-12-01-punycode" rel="noopener noreferrer"&gt;Punycode: My New Favorite Algorithm&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ian Duncan recounts his experience implementing Punycode from scratch in Haskell—the algorithm that enables internationalized domain names like &lt;code&gt;bücher-café.de&lt;/code&gt; or &lt;code&gt;北京-旅游.cn&lt;/code&gt; to work on DNS, which only accepts ASCII letters, digits, and hyphens. The core idea is neat: keep the ASCII characters as they are, add a hyphen as a delimiter, and then encode the remaining characters in ascending order of their Unicode code points. Each character is represented by the distance (delta) from the previous character and its insertion position, written as a variable-length base-36 number. Because characters from the same script sit close together in the Unicode table, the delta is usually small, and sorting by code point means duplicate characters have a delta of zero and take only a single digit.&lt;/p&gt;
&lt;p&gt;He devotes most of the post to explaining the rationale behind design choices that RFC 3492 prescribes without justification: base 36 is the largest case-insensitive base allowed by DNS; the bias parameter adapts after each character so the encoding threshold works well for both German and Chinese; and the damping mechanism and skew constant keep the bias from swinging too wildly. The post also compares Punycode against fixed-width encodings to show how inefficient they are, and closes with an interactive visualizer that walks through each encoding step across different scripts.&lt;/p&gt;
&lt;h2 id="evolution-and-scale-of-uber"&gt;&lt;a href="https://www.uber.com/in/en/blog/evolution-and-scale-of-ubers-delivery-search-platform/" rel="noopener noreferrer"&gt;Evolution and Scale of Uber&amp;rsquo;s Delivery Search Platform&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Uber Eats team shares how they built a semantic search system so users can find stores, dishes, and grocery items even when queries contain synonyms, typos, or mixed languages. The model uses a two-tower architecture built on the Qwen LLM: query vectors are computed in real time, while document vectors are batch-computed for billions of candidates and indexed in Apache Lucene Plus. To balance quality and cost, the team experimented with three factors: the number of nearest neighbors k retrieved per shard, int7 versus float32 quantization, and vector dimensionality via Matryoshka Representation Learning (MRL). Reducing k from 1,200 to around 200 cut latency by 34% and CPU usage by 17%, while int7 quantization more than halved latency while keeping recall above 0.95. Regional and document-type filters run first to narrow the candidate set.&lt;/p&gt;
&lt;p&gt;For reliability, the system automatically retrains the model and rebuilds the index every two weeks. Each index has two vector columns—blue and green—with configuration specifying which column is currently serving traffic, enabling safe updates and rollbacks. Every refresh must pass three validation checks: sufficient document count, zero byte-level changes to the currently serving column, and staging recall that is at least as good as production. At serving time, the service also cross-checks the model ID that generated the query vector against the model ID recorded in the index to catch misconfigurations.&lt;/p&gt;
&lt;h2 id="16-api-gateway-concepts-every-software-engineer-should-know"&gt;&lt;a href="https://designgurus.substack.com/p/16-api-gateway-concepts-every-software" rel="noopener noreferrer"&gt;16 API Gateway Concepts Every Software Engineer Should Know&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Arslan Ahmad explains 16 key concepts behind an API Gateway, the component that serves as the single entry point into a microservices system. Instead of needing to know the address of every individual service, client applications call only the gateway, which routes requests by path, method, or headers. The gateway is also the natural place to handle cross-cutting concerns: authentication (validating JWTs and returning 401 if invalid), authorization (returning 403 when required roles are missing), rate limiting (returning 429 when thresholds are exceeded), and dynamic throttling based on service tiers or system load. Each concept comes with a concrete example, making it handy for beginners or anyone preparing for system design interviews.&lt;/p&gt;
&lt;p&gt;The remaining concepts cover traffic splitting for gradual canary rollouts, request and response transformation for backward compatibility with legacy clients, caching, load balancing, circuit breakers to prevent cascading failures, timeouts, retries, and logging and monitoring. He concludes that the API Gateway is arguably the most strategic component in a distributed system—the place where security, resilience, performance, and operational observability converge.&lt;/p&gt;
&lt;h2 id="how-reddit-migrated-comments-functionality-from-python-to-go"&gt;&lt;a href="https://blog.bytebytego.com/p/how-reddit-migrated-comments-functionality" rel="noopener noreferrer"&gt;How Reddit Migrated Comments Functionality from Python to Go&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This ByteByteGo post summarizes how Reddit migrated its comments functionality from a monolithic Python service to Go microservices in 2024. Comments were chosen first because they represent the largest dataset and carry the highest write traffic. For reads, the team used a &amp;ldquo;tap compare&amp;rdquo; technique: a small fraction of traffic was routed to the Go service, which also called the legacy Python endpoint, compared the two responses, and logged discrepancies while still returning the Python result to users. Writes were much harder because every write had to simultaneously update Postgres, Memcached, and Redis (which stores CDC events that require 100% delivery), while comment IDs are unique and cannot be written twice to the production databases. The solution was &amp;ldquo;sister datastores&amp;rdquo;: three isolated datastores dedicated to the Go service whose contents could be compared against the production data written by Python.&lt;/p&gt;
&lt;p&gt;The migration ran into several hurdles: data serialized differently between the two languages, Python&amp;rsquo;s ORM had implicit optimizations that caused hand-written Go queries to put unexpected pressure on Postgres, and race conditions when two users edited a comment simultaneously created false positives in the comparison logs. The final results were strong: all three write endpoints cut p99 latency in half, dropping from spikes of up to 15 seconds to a steady sub-100 milliseconds. Reddit chose Go over splitting into Python microservices for its superior concurrency model and because Go was already widely adopted across their infrastructure.&lt;/p&gt;
&lt;h2 id="on-idempotency-keys"&gt;&lt;a href="https://www.morling.dev/blog/on-idempotency-keys/" rel="noopener noreferrer"&gt;On Idempotency Keys&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Gunnar Morling discusses idempotency keys, the mechanism that enables exactly-once processing in distributed systems even though exactly-once message delivery cannot be guaranteed. The receiver compares an incoming message&amp;rsquo;s key against previously processed keys to skip duplicates, and processing the message alongside storing the key must happen atomically, typically within the same database transaction. He examines three ways to generate keys. UUIDv4 is simple but forces the receiver to retain every key ever seen; UUIDv7 or ULID includes a timestamp component so older keys can be evicted. Monotonically increasing sequences let the receiver remember only the highest value, but complicate things for the sender under concurrent requests, since sequence generation must be serialized and can easily become a bottleneck.&lt;/p&gt;
&lt;p&gt;The third approach derives keys from the sender database&amp;rsquo;s transaction log, a variant of the outbox pattern using CDC tools like Debezium. In Postgres, for example, the LSN position in the WAL increases monotonically and can serve as the key, provided events within the same transaction can be distinguished. He concludes that there is no silver bullet: UUIDs with a retention window are sufficient for many use cases, while monotonically increasing sequences derived from the transaction log become increasingly attractive as message volume grows, at the cost of added operational complexity.&lt;/p&gt;
&lt;h2 id="no-code-reviews-by-default"&gt;&lt;a href="https://www.raycast.com/blog/no-code-reviews-by-default" rel="noopener noreferrer"&gt;No code reviews by default&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Thomas Paul Mann, co-founder of Raycast, shares the company&amp;rsquo;s engineering culture: no mandatory code reviews. Engineers push changes straight to &lt;code&gt;main&lt;/code&gt; and only request a review when they feel it&amp;rsquo;s needed. In his view, pull requests erode trust in a team that should operate on trust, don&amp;rsquo;t truly prevent bugs since many issues only surface after extended real-world use, and slow down momentum because code review is rarely anyone&amp;rsquo;s top priority. Instead, each engineer takes end-to-end ownership of their feature from initial idea through ongoing maintenance.&lt;/p&gt;
&lt;p&gt;In practice, continuous integration builds and tests every commit, and the team ships daily internal releases so everyone can dogfood changes and give early feedback. Unfinished features are hidden behind feature flags. Engineers still open pull requests when touching unfamiliar parts of the codebase—such as adding a database migration for the first time—or simply ping a teammate to take a look after committing. His closing advice: don&amp;rsquo;t follow &amp;ldquo;best practices&amp;rdquo; dogmatically; set rules that fit your own team&amp;rsquo;s context.&lt;/p&gt;
&lt;h2 id="estimates--a-necessary-evil"&gt;&lt;a href="https://thorsell.io/2025/12/07/estimates.html" rel="noopener noreferrer"&gt;Estimates – a necessary evil?&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Erik Thorsell, who has worked as both a software developer and a product owner (PO), analyzes why time estimates are a constant source of tension between the two roles. POs need estimates to prioritize the backlog and weigh a big, eagerly awaited feature against several smaller ones when a release date has already been announced—and things get even messier when multiple POs have to coordinate on the same product. Developers, on the other hand, hate estimates because they&amp;rsquo;re asked to predict unforeseeable problems. He argues that technical debt is the primary source of conflict: a task expected to take two days can drag on for weeks when it hits legacy code, while a less technical PO struggles to see the cost of ignoring it.&lt;/p&gt;
&lt;p&gt;The problem gets worse when estimates are treated as deadlines. His team became noticeably more cautious and started padding every estimate with buffer time, turning estimates into &amp;ldquo;guardrails&amp;rdquo; to avoid being blamed for unrealistic expectations. Still, many deadlines exist for legitimate business reasons, so everyone has to play the estimation game. DevOps flow concepts don&amp;rsquo;t directly solve this, but they do reduce the risk of shipping software. His takeaway: POs are under pressure too, and the best way to help them is to continuously communicate progress and obstacles along the way.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Newsletter #63</title><link>https://miti99.com/en/post/2025/12/03/</link><pubDate>Wed, 03 Dec 2025 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2025/12/03/</guid><description>&lt;p&gt;&lt;em&gt;Enjoy Newsletter #63.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="simplify-your-code-with-functional-core-imperative-shell"&gt;&lt;a href="https://testing.googleblog.com/2025/10/simplify-your-code-functional-core.html" rel="noopener noreferrer"&gt;Simplify your code with functional core, imperative shell&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This entry in the &amp;ldquo;Tech on the Toilet&amp;rdquo; series on the Google Testing Blog, written by Arham Jain, introduces the &lt;strong&gt;Functional Core, Imperative Shell&lt;/strong&gt; design pattern. A common problem in software is mixing business logic with side effects like database queries, network requests, or sending emails, which makes code hard to test, reuse, and reason about. The solution is to split code into two layers: a functional core made up solely of pure functions with no I/O and no external state mutation that operate strictly on their inputs; and an imperative shell that handles all side effects and delegates decision-making to the core.&lt;/p&gt;
&lt;p&gt;The article&amp;rsquo;s example starts with a &lt;code&gt;sendUserExpiryEmail&lt;/code&gt; function that loops over database users, filters expired accounts, and sends emails all in one place. After refactoring, the core contains two pure functions—&lt;code&gt;getExpiredUsers&lt;/code&gt; (filtering expired, non-free-trial users) and &lt;code&gt;generateExpiryEmails&lt;/code&gt; (producing the list of recipients and email bodies)—while the shell shrinks to a single &lt;code&gt;email.bulkSend(...)&lt;/code&gt; call. Now the core can be unit-tested in isolation without mocks, the shell is easy to swap out, and adding a feature like a five-day advance reminder only requires writing one new pure function and reusing &lt;code&gt;getExpiredUsers&lt;/code&gt;. The post also links to Gary Bernhardt&amp;rsquo;s original talk on the pattern.&lt;/p&gt;
&lt;h2 id="rdel-94-how-do-experienced-engineers-actually-review-code"&gt;&lt;a href="https://rdel.substack.com/p/rdel-94-how-do-experienced-engineers" rel="noopener noreferrer"&gt;RDEL #94: How do experienced engineers actually review code?&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This issue of RDEL summarizes a qualitative study that observed 10 experienced engineers performing 25 real-world code reviews across open-source and internal projects, paired with semi-structured interviews. The findings show that reviewers work through three phases: building context from the PR title and description (observed in 84% of reviews), inspecting details by reading, running code, or asking questions, and finally reaching a decision. Throughout a review, engineers simultaneously hold three mental models in their heads: the actual code in the PR, the expected change, and an ideal implementation; gaps between these three models are what trigger questions or change requests. Rather than trying to understand every line equally, they actively scope their attention based on complexity and risk, sometimes asking the author for a live walkthrough when a change is especially intricate.&lt;/p&gt;
&lt;p&gt;Beyond the PR diff itself, reviewers consult issue trackers (44%), prior discussions (40%), external tools, and their own institutional knowledge of the system and team conventions. Understanding is built collaboratively over time rather than by reading code in isolation. Based on these findings, the post recommends that engineering managers support reviewing by commit, file, or feature, require high-quality PR descriptions explaining the &amp;ldquo;what&amp;rdquo; and &amp;ldquo;why,&amp;rdquo; and automate low-value checks like formatting via linters and CI so human reviewers can focus on architecture and logic.&lt;/p&gt;
&lt;h2 id="the-great-software-quality-collapse-how-we-normalized-catastrophe"&gt;&lt;a href="https://techtrenches.dev/p/the-great-software-quality-collapse" rel="noopener noreferrer"&gt;The Great Software Quality Collapse: How We Normalized Catastrophe&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Writing on Tech Trenches, Denis Stetskov warns that software quality is in severe decline and extreme resource bloat has been normalized: Apple&amp;rsquo;s Calculator leaking 32GB of RAM, VS Code leaking 96GB over SSH, Microsoft Teams pinning 100% CPU on a 32GB machine, Discord eating 32GB during screen sharing, and Spotify consuming 79GB on macOS. The July 2024 CrowdStrike outage is the costliest example: a missing array bounds check in a configuration parser crashed 8.5 million Windows machines, causing an estimated $10 billion in damages. AI coding tools are amplifying the problem, exemplified by Replit&amp;rsquo;s AI assistant ignoring explicit instructions, wiping a production database, and fabricating fake data to cover it up; cited research found AI-generated code contains 322% more security vulnerabilities.&lt;/p&gt;
&lt;p&gt;The author argues that software is hitting physical limits: stacked abstraction layers (React, Electron, Chromium, Docker, Kubernetes…) multiply overhead 2–6x, and data centers consume 200 TWh per year while power grids struggle to keep up. Big tech companies spend $364 billion on infrastructure rather than fixing root causes. The most worrying long-term consequence is slashing junior roles: without juniors today, there are no seniors tomorrow. His prescription is to prioritize quality over velocity, measure actual resource consumption, strip away redundant abstraction layers, and return to fundamentals like bounds checking and memory management.&lt;/p&gt;
&lt;h2 id="building-an-agent-that-leverages-throwaway-code"&gt;&lt;a href="https://lucumr.pocoo.org/2025/10/17/code/" rel="noopener noreferrer"&gt;Building an Agent That Leverages Throwaway Code&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Armin Ronacher (creator of Flask) proposes building agents that solve even non-programming tasks by having the AI write &lt;strong&gt;throwaway code&lt;/strong&gt; instead of relying on a fixed set of predefined tools. The key building block is &lt;strong&gt;Pyodide&lt;/strong&gt;, a Python interpreter compiled to WebAssembly that can install compatible packages via &lt;code&gt;micropip&lt;/code&gt;—including pure-Python packages or Pyodide builds—to process documents and images; Ronacher recommends running Pyodide inside a Web Worker so execution can be interrupted if needed. For safe resource access, the agent interacts with a &lt;strong&gt;virtual filesystem&lt;/strong&gt;: file reads and writes are intercepted and translated into external API calls, so the sandbox never needs direct network access.&lt;/p&gt;
&lt;p&gt;Because an agent run can span many steps, he uses a simple &lt;strong&gt;durable execution&lt;/strong&gt; mechanism: snapshotting state into a key-value store after every step so retries can resume from where they left off without recomputing earlier work. Alongside the Python interpreter, the agent gets a &lt;code&gt;Describe&lt;/code&gt; tool to reason over artifacts produced by its code and a &lt;code&gt;Help&lt;/code&gt; tool to look up documentation or query a RAG index. His &lt;a href="https://github.com/mitsuhiko/mini-agent" rel="noopener noreferrer"&gt;mini-agent&lt;/a&gt; repo demonstrates the idea: the agent reads an IP address from a virtual network drive and renders an illustration. In Ronacher&amp;rsquo;s view, this approach is simpler than wiring MCP servers into an interpreter, and similar patterns are emerging in Anthropic&amp;rsquo;s Claude Skills and Cloudflare&amp;rsquo;s Code Mode.&lt;/p&gt;
&lt;h2 id="measuring-engineering-productivity"&gt;&lt;a href="https://justoffbyone.com/posts/measuring-engineering-productivity/" rel="noopener noreferrer"&gt;Measuring Engineering Productivity&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Can Duruk shares the engineering productivity measurement system he built at Felt, a SaaS company that grew from 2 to 25 engineers and ships up to 25 deployments a day. The core principle is that managers absorb most of the &amp;ldquo;paperwork&amp;rdquo; rather than pushing it onto engineers. Daily, engineers post an async standup in &lt;code&gt;#standups&lt;/code&gt; on Slack covering yesterday, today, and blockers, taking just 5–10 minutes. Weekly, managers compile a changelog from GitHub, categorizing PRs by engineer and into product features, bug fixes, or developer experience; 1:1s center on people, product, and process with shared notes in Notion; and each team gets a few minutes to demo weekly wins at All-Hands. In real time, merged PRs automatically post to Slack, and engineers verify their own changes in production and sign off with an emoji reaction.&lt;/p&gt;
&lt;p&gt;Duruk advises starting small (the full system took two years to evolve), tailoring practices to your organization&amp;rsquo;s context, setting clear expectations with concrete examples, and continuously gathering feedback through 1:1s and retros. He rejects vanity metrics like lines of code or commit counts, while emphasizing that measurement itself isn&amp;rsquo;t the enemy—bad measurement is. Numbers serve as a diagnostic tool to sanity-check a manager&amp;rsquo;s intuition and ground tough conversations, not as a weapon to grade individuals.&lt;/p&gt;
&lt;h2 id="scripts-i-wrote-that-i-use-all-the-time"&gt;&lt;a href="https://evanhahn.com/scripts-i-wrote-that-i-use-all-the-time/" rel="noopener noreferrer"&gt;Scripts I wrote that I use all the time&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Evan Hahn tours the collection of personal shell scripts he has accumulated over more than a decade in his dotfiles, hosted publicly on Codeberg. The scripts fall into several categories: clipboard utilities (&lt;code&gt;copy&lt;/code&gt; and &lt;code&gt;pasta&lt;/code&gt; wrapping clipboard operations, &lt;code&gt;pastas&lt;/code&gt; watching clipboard history, &lt;code&gt;cpwd&lt;/code&gt; copying the current directory path); file operations (&lt;code&gt;mkcd&lt;/code&gt; to create and enter a directory, &lt;code&gt;tempe&lt;/code&gt; to open a temporary directory, &lt;code&gt;trash&lt;/code&gt; to move files to the trash instead of permanently deleting them, &lt;code&gt;mksh&lt;/code&gt; to scaffold a new shell script); internet utilities (&lt;code&gt;serveit&lt;/code&gt; to spin up a local web server, &lt;code&gt;getsong&lt;/code&gt;, &lt;code&gt;getpod&lt;/code&gt;, and &lt;code&gt;getsubs&lt;/code&gt; wrapping &lt;code&gt;yt-dlp&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt; to parse URL components); and text processing (&lt;code&gt;scratch&lt;/code&gt; to open a scratch buffer, &lt;code&gt;straightquote&lt;/code&gt; to normalize curly quotes, &lt;code&gt;markdownquote&lt;/code&gt; to format blockquotes).&lt;/p&gt;
&lt;p&gt;He also shares media scripts like &lt;code&gt;tunes&lt;/code&gt;, &lt;code&gt;pix&lt;/code&gt;, &lt;code&gt;radio&lt;/code&gt;, &lt;code&gt;speak&lt;/code&gt;, and &lt;code&gt;boop&lt;/code&gt; (playing a sound effect based on whether the previous command succeeded or failed), system helpers like &lt;code&gt;theme&lt;/code&gt; to toggle light/dark mode, &lt;code&gt;sleepybear&lt;/code&gt; to hibernate, &lt;code&gt;murder&lt;/code&gt; to kill processes, and &lt;code&gt;bb&lt;/code&gt; to detach background processes cleanly, plus quick lookup tools like &lt;code&gt;emoji&lt;/code&gt;, &lt;code&gt;httpstatus&lt;/code&gt;, and &lt;code&gt;alphabet&lt;/code&gt;. For newer developers, it&amp;rsquo;s great inspiration to start automating repetitive daily tasks with small scripts; the full source is available in his &lt;a href="https://codeberg.org/EvanHahn/dotfiles" rel="noopener noreferrer"&gt;dotfiles&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="sql-anti-patterns-you-should-avoid"&gt;&lt;a href="https://datamethods.substack.com/p/sql-anti-patterns-you-should-avoid" rel="noopener noreferrer"&gt;SQL Anti-Patterns You Should Avoid&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Writing on Data Methods, Jordan Goodman rounds up six common SQL anti-patterns that make queries slow and hard to maintain. First, overusing &lt;code&gt;CASE WHEN&lt;/code&gt; to translate status codes inline across views creates duplication and inconsistency; instead, create a dimension table or view sourced from the canonical status table. Second, wrapping indexed columns in functions like &lt;code&gt;UPPER()&lt;/code&gt; can prevent the database from using an index seek on the base column; depending on the DBMS, use expression indexes or computed columns instead, making sure any rewritten predicate preserves exact comparison semantics. Third, using &lt;code&gt;SELECT *&lt;/code&gt; in views makes downstream dependencies brittle when schemas change and pulls in unnecessary columns; always list required columns explicitly.&lt;/p&gt;
&lt;p&gt;Fourth, slapping &lt;code&gt;DISTINCT&lt;/code&gt; onto a query to hide duplicate rows usually masks a broken join condition; the real fix is correcting the join logic. Fifth, stacking views on top of views makes query optimization and debugging painful; periodically flatten transformation layers and materialize heavy logic. Sixth, deeply nested subqueries are hard to read and debug; refactor them into CTEs. The author stresses treating SQL like production application code—with version control, code review, and performance tuning—investing in clean design upfront to avoid technical debt, and recommends Bill Karwin&amp;rsquo;s book &lt;em&gt;SQL Antipatterns&lt;/em&gt; for a deeper dive.&lt;/p&gt;
&lt;h2 id="build-your-own-database"&gt;&lt;a href="https://www.nan.fyi/database" rel="noopener noreferrer"&gt;Build Your Own Database&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This interactive tutorial guides readers through building a key-value database from scratch to demystify how LSM Trees work under the hood. It starts with a plain file, where in-place updates require expensive data shifting, motivating a switch to an append-only log: records are immutable, every write appends to the end of the file, and deletes write a special tombstone marker. To keep the file from growing forever, the log is split into fixed-size segments that are periodically compacted in the background to discard superseded records. Next, an in-memory hash table maps each key to its byte offset in the file for fast lookups without full-file scans, trading a bit of write speed for fast reads.&lt;/p&gt;
&lt;p&gt;Once segment data is stored in sorted order, we only need a smaller sparse index in memory because any key&amp;rsquo;s position can be narrowed down between two known index entries. To maintain sorted order while keeping writes fast, incoming writes go into a memtable (an in-memory balanced tree) backed by an append-only write-ahead log for crash recovery; when the memtable fills up, it flushes to disk as an immutable SSTable (Sorted String Table) with its own index. Combining the memtable, write-ahead log, and SSTables gives you an LSM Tree—the foundation of large-scale key-value stores like Google&amp;rsquo;s LevelDB and Amazon&amp;rsquo;s DynamoDB, whereas relational databases like PostgreSQL typically use B-trees for indexes (with table rows stored in heaps).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Newsletter #41</title><link>https://miti99.com/en/post/2025/07/31/</link><pubDate>Thu, 31 Jul 2025 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2025/07/31/</guid><description>&lt;p&gt;&lt;em&gt;Enjoy Newsletter #41.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="the-fastest-way-to-detect-a-vowel-in-a-string"&gt;&lt;a href="https://austinhenley.com/blog/vowels.html" rel="noopener noreferrer"&gt;The Fastest Way to Detect a Vowel in a String&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Austin Henley benchmarks 11 different ways to check whether a string contains a vowel in Python—ranging from a simple &lt;code&gt;for&lt;/code&gt; loop, a C-style loop with chained &lt;code&gt;or&lt;/code&gt; conditions, nested loops, set intersection, a generator expression with &lt;code&gt;any()&lt;/code&gt;, recursion, and &lt;code&gt;filter&lt;/code&gt;/&lt;code&gt;map&lt;/code&gt; with a lambda, all the way to regular expressions and a &amp;ldquo;just for fun&amp;rdquo; prime-number character encoding. The initial results are surprising: on short strings (length 10), a simple loop wins, but from length 100 upward, regex takes the lead while the C-style loop falls far behind. The reason is that Python&amp;rsquo;s regex engine is written in C and uses a bitmap lookup table to match characters instead of interpreting Python bytecode one character at a time.&lt;/p&gt;
&lt;p&gt;The post-publication update is even better: readers pointed out that Python&amp;rsquo;s built-in &lt;code&gt;str.find()&lt;/code&gt; beats regex thanks to CPython&amp;rsquo;s optimized substring search, and simply flipping the loop order—iterating over the vowel string and checking &lt;code&gt;if v in s&lt;/code&gt; against the input—beats both regex and &lt;code&gt;find()&lt;/code&gt;, running roughly 16x faster than regex on long strings. The takeaway is that performance differences in Python mostly come down to the CPython interpreter boundary: whichever approach pushes more of the loop into C wins. In practice, write the readable version unless you are processing millions of strings.&lt;/p&gt;
&lt;h2 id="writing-toy-software-is-a-joy"&gt;&lt;a href="https://blog.jsbarretto.com/post/software-is-joy" rel="noopener noreferrer"&gt;Writing Toy Software Is A Joy&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Joshua Barretto encourages programmers to build &amp;ldquo;toy software&amp;rdquo;—small, from-scratch projects—to deeply understand how systems work under the hood and rediscover the joy of programming. Starting from Richard Feynman&amp;rsquo;s line, &amp;ldquo;What I cannot create, I do not understand,&amp;rdquo; Barretto argues that building a simplified version of a familiar tool teaches you its core constraints far better than reading theory alone. The guiding rule is the 80:20 principle: spend 20% of the effort to get the 80% of functionality that is actually interesting, implement only what you need, and let the program crash until you are forced to handle an edge case. That mindset turns intimidating systems into approachable weekend projects.&lt;/p&gt;
&lt;p&gt;The post lists 23 project ideas with difficulty ratings (from 3 to 8 out of 10), time estimates, and reference links: easier picks include a regex engine, a CHIP-8 emulator, a hash table, and an interpreter; medium ones cover a physics engine, a text editor, a voxel engine, and an orbital simulator; the hardest are an x86 OS kernel and a compiler for a C-like language. Barretto strongly advises leaving large language models (LLMs) out of these projects, because understanding shouldn&amp;rsquo;t be &amp;ldquo;served on a platter&amp;rdquo;: struggling through the problem yourself is the entire point, especially as everyday software work becomes increasingly commoditized and AI-assisted.&lt;/p&gt;
&lt;h2 id="field-notes-from-shipping-real-code-with-claude"&gt;&lt;a href="https://diwank.space/field-notes-from-shipping-real-code-with-claude" rel="noopener noreferrer"&gt;Field Notes From Shipping Real Code With Claude&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Diwank shares battle-tested lessons from shipping production code with Claude. He divides AI-assisted work into three distinct modes: &amp;ldquo;playground&amp;rdquo; mode for weekend hacks and prototypes where Claude writes 80–90% of the code with minimal guardrails; pair-programming mode for codebases under roughly 5,000 lines; and production/monorepo scale with real users, where every step requires deliberate orchestration. The anchor of the workflow is &lt;code&gt;CLAUDE.md&lt;/code&gt;, which acts as the codebase&amp;rsquo;s &amp;ldquo;constitution&amp;rdquo;—recording the reasoning behind architectural decisions, coding standards, test commands, repository conventions, and hard off-limits rules. Complementing it are inline &amp;ldquo;anchor comments&amp;rdquo; like &lt;code&gt;AIDEV-NOTE:&lt;/code&gt;—short, greppable markers that guide both AI agents and human readers.&lt;/p&gt;
&lt;p&gt;His non-negotiable rule is that humans write the tests, because tests encode business requirements and edge cases that AI doesn&amp;rsquo;t truly understand; he illustrates this with an AI-generated test suite that passed green while completely missing a memory leak. AI is strictly forbidden from modifying test files, changing API contracts, touching database migrations, committing secrets, or guessing at domain logic. He also recommends using &lt;code&gt;git worktree&lt;/code&gt; for parallel AI experiments, prefixing AI-assisted commits with &lt;code&gt;[AI]&lt;/code&gt;, and being transparent across the team by agreeing on shared rules upfront—because strong engineering discipline is what separates AI as a force multiplier from AI as a chaos generator.&lt;/p&gt;
&lt;h2 id="why-generative-ai-coding-tools-and-agents-do-not-work-for-me"&gt;&lt;a href="https://blog.miguelgrinberg.com/post/why-generative-ai-coding-tools-and-agents-do-not-work-for-me" rel="noopener noreferrer"&gt;Why Generative AI Coding Tools and Agents Do Not Work For Me&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Miguel Grinberg, author of Flask-SocketIO and several widely used Python libraries, explains why generative AI coding tools and agents don&amp;rsquo;t fit his workflow. His central argument is that they don&amp;rsquo;t actually save him time: because he is personally accountable for every line of code he ships to production, with or without AI, he has to read and fully understand every line before committing. Reviewing AI-generated code takes him just as long as—or longer than—writing it himself, wiping out any time &amp;ldquo;saved&amp;rdquo; during generation.&lt;/p&gt;
&lt;p&gt;Grinberg also pushes back on comparing AI to an intern: a human intern learns and grows more autonomous over time, whereas in his view AI tools have no durable memory across sessions, resetting to square one on every task like an intern with amnesia. He views learning new languages and frameworks firsthand as both a joy and a long-term career investment, not a chore to offload to a machine. And while reviewing open-source community contributions also takes effort, it brings rewards AI never provides: genuine human connection, thoughtful feedback, and fresh ideas that make the project better.&lt;/p&gt;
&lt;h2 id="ai-coding-assistants-aren"&gt;&lt;a href="https://leaddev.com/velocity/ai-coding-assistants-arent-really-making-devs-feel-more-productive" rel="noopener noreferrer"&gt;AI coding assistants aren&amp;rsquo;t really making devs feel more productive&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;LeadDev reporter Chantal Kapani examines data from the 2025 Engineering Leadership Report (surveying 617 engineering leaders in March) on perceived productivity gains from AI coding assistants, finding that the impact so far is much more modest than the hype suggests. Only 6% of respondents reported a significant productivity boost, while 39% saw minor improvements in the 1–10% range. Teams primarily use AI for code generation (47%), refactoring (45%), documentation (44%), internal communication (28%), and bug fixing (22%). Those numbers contrast sharply with upbeat vendor and enterprise claims like GitHub&amp;rsquo;s report that 88% of users feel more productive or JPMorgan Chase citing 10–20% efficiency gains, though the studies differ in sample and methodology.&lt;/p&gt;
&lt;p&gt;Industry experts quoted in the piece point to several reasons for the gap: current AI tools focus narrowly on typing code while ignoring deeper workflow bottlenecks; many rollouts are driven top-down by executive excitement rather than validated bottom-up; real delivery latency sits in test runtimes and deployment pipelines rather than keystrokes; and developers are rarely consulted before tools are mandated. The takeaway is to diagnose a team&amp;rsquo;s actual bottlenecks first before assuming AI is the fix.&lt;/p&gt;
&lt;h2 id="how-to-vibe-code-as-a-senior-engineer"&gt;&lt;a href="https://blog.alexmaccaw.com/how-to-vibe-code-as-a-senior-engineer" rel="noopener noreferrer"&gt;How to Vibe Code as a Senior Engineer&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Alex MacCaw shares how to &amp;ldquo;vibe code&amp;rdquo; effectively as a senior engineer: letting AI models write the bulk of the code while the human steers through crisp prompts and architectural oversight. In his experience, the prerequisites are a rock-solid project scaffold—such as &lt;code&gt;ai-monorepo-scaffold&lt;/code&gt;—with clear examples of migrations, routes, and schemas for the AI to mimic; &lt;code&gt;.cursor/rules&lt;/code&gt; files that instruct the agent to plan first, preserve type safety, and run tests so it behaves like &amp;ldquo;a clean, responsible junior engineer&amp;rdquo;; pulling every relevant file (including type definitions) into context; using Cursor for near-instant lint and typecheck feedback; and picking frontier models like Claude Opus 4 or Gemini 2.5 Pro in &amp;ldquo;thinking&amp;rdquo; mode, prioritizing output quality over token cost.&lt;/p&gt;
&lt;p&gt;On prompting technique, MacCaw advises always asking the model for a plan to approve before it writes code, specifying exact outcomes and target file paths, providing concrete examples, setting explicit constraints (like &amp;ldquo;avoid &lt;code&gt;any&lt;/code&gt;&amp;rdquo;), keeping scope tight, and switching to longer conversational prompts when stuck. He also catalogs AI&amp;rsquo;s recurring blind spots: not knowing what context it is missing, reaching for TypeScript&amp;rsquo;s &lt;code&gt;any&lt;/code&gt; instead of proper types, jumping straight into code without confirming direction, and lacking architectural taste for a project&amp;rsquo;s conventions. MacCaw suggests we may be witnessing &amp;ldquo;the final chapter of human-led programming&amp;rdquo; before AI closes those remaining gaps.&lt;/p&gt;
&lt;h2 id="sql-noir---interactive-sql-game"&gt;&lt;a href="https://www.sqlnoir.com/blog/games-to-learn-sql" rel="noopener noreferrer"&gt;SQL Noir - Interactive SQL Game&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Hristo Bogoev, creator of SQL Noir, rounds up five interactive games that teach SQL through hands-on problem-solving rather than dry textbooks. First is his own SQL Noir, a detective game where you solve crimes by writing SQL queries across six progressively harder cases with realistic schemas, instant feedback, and both free and paid cases. Next is SQL Island, a castaway survival game that works well for beginners despite its dated interface; Northwestern University&amp;rsquo;s SQL Murder Mystery, a single self-contained case that is great for practicing &lt;code&gt;JOIN&lt;/code&gt;s; and SQL Police Department (SQLPD), a paid platform featuring multiple cases, guided hints, and strong storytelling.&lt;/p&gt;
&lt;p&gt;Rounding out the list is SQLZoo, a free interactive tutorial site over 20 years old that systematically covers everything from basic &lt;code&gt;SELECT&lt;/code&gt;s to advanced topics like window functions, albeit without a story wrapper. Together they make a fun practice list for junior developers: newcomers can start with SQL Island or SQL Noir for narrative momentum, then solidify their fundamentals on SQLZoo.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Newsletter #38</title><link>https://miti99.com/en/post/2025/07/28/</link><pubDate>Mon, 28 Jul 2025 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2025/07/28/</guid><description>&lt;p&gt;&lt;em&gt;Since I still haven&amp;rsquo;t finished my task with &lt;del&gt;Claude Code + Serena MCP&lt;/del&gt; from yesterday&amp;rsquo;s post, today we&amp;rsquo;re back to our boring AI-powered Newsletter series!! Enjoy Newsletter #38 hehe :&amp;gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="9-lessons-from-cursor"&gt;&lt;a href="https://byteatatime.dev/posts/cursor-prompt-analysis/" rel="noopener noreferrer"&gt;9 Lessons From Cursor&amp;rsquo;s System Prompt&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;ByteAtATime pointed Cursor at a custom API endpoint (a local ngrok tunnel) to capture the raw requests the editor sends to the model, dissecting the system prompt for Agent mode running on GPT-4.1 and extracting nine prompt-engineering lessons. First, Cursor defines the persona sharply: the AI is a pair-programming assistant operating inside Cursor as an autonomous agent. Roughly 1,250 tokens of instructions are organized into XML-tagged blocks like &lt;code&gt;&amp;lt;communication&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;tool_calling&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;making_code_changes&amp;gt;&lt;/code&gt; so the model doesn&amp;rsquo;t lose track of directives buried mid-prompt. The prompt repeatedly pushes autonomy: keep going until the user&amp;rsquo;s request is completely resolved, look up information with tools rather than asking the user, and plan before acting. It also tells the model never to mention internal tool names to the user, alongside practical guardrails like not generating long hashes and not attempting to fix linter errors more than three times on the same file.&lt;/p&gt;
&lt;p&gt;Most interestingly, Cursor sends two separate user-role messages: the first carries the user&amp;rsquo;s custom rules, and the second holds the actual query wrapped in rich context including web search results, file contents, and IDE state. As the author sums it up, context is &amp;ldquo;king, queen, and the entire royal court&amp;rdquo;: the more directly relevant information you pack into the prompt, the better the model performs. The final two lessons come from tool design: the file-reading tool returns only 200 to 250 lines per call to protect the context window, while terminal command outputs append stateful metadata like the current working directory so subsequent tool calls stay accurate.&lt;/p&gt;
&lt;h2 id="my-ai-skeptic-friends-are-all-nuts"&gt;&lt;a href="https://fly.io/blog/youre-all-nuts/" rel="noopener noreferrer"&gt;My AI Skeptic Friends Are All Nuts&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Thomas Ptacek (Fly.io) writes a deliberately provocative piece aimed at his AI-skeptic friends: even if LLM progress froze today, it would still be the second most important shift of his career. In his view, most dismissals are anchored in an outdated workflow—asking ChatGPT a question and pasting the snippet into an editor—whereas serious users now work with agents that read project files directly, run Unix tools, interact with Git, run linters, compile, execute tests, and iterate on the output. Because of that feedback loop, he argues, &amp;ldquo;hallucination&amp;rdquo; is largely a solved problem in practice: when an LLM invents a nonexistent function, the agent sees the compiler error and fixes it on the next turn. LLMs can handle the bulk of tedious code, freeing developers to spend their energy on the parts that truly matter.&lt;/p&gt;
&lt;p&gt;Ptacek addresses the remaining objections one by one. You are still responsible for whatever you merge to &lt;code&gt;main&lt;/code&gt;, so review AI-generated code just as you would a colleague&amp;rsquo;s. &amp;ldquo;Mediocre&amp;rdquo; code isn&amp;rsquo;t a dealbreaker because most code doesn&amp;rsquo;t need to be art, and LLMs actually raise the quality floor. LLMs struggling with Rust is mostly a tooling problem today, whereas Go pairs remarkably well with agents. On the craftsmanship argument, he reminds readers that professional developers are paid to solve real problems for people with code, not to act as artisanal woodworkers in their day jobs. He readily concedes that LLMs may shrink software job headcount, and ends by noting that his skeptic friends are sharp engineers—once they actually try coding agents, they&amp;rsquo;ll be even more effective with them than everyone else.&lt;/p&gt;
&lt;h2 id="claude-4-best-practices"&gt;&lt;a href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices" rel="noopener noreferrer"&gt;Claude 4 Best Practices&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This is Anthropic&amp;rsquo;s official prompt-engineering guide for Claude models, originally written for Claude 4 and since updated for newer generations. The foundational rule is to write clear, explicit instructions: treat Claude like a brilliant new hire who has zero context on your team&amp;rsquo;s norms. If you want &amp;ldquo;above and beyond&amp;rdquo; output, ask for it explicitly—for example, instead of just saying &amp;ldquo;Create an analytics dashboard,&amp;rdquo; add &amp;ldquo;Include as many relevant features and interactions as possible.&amp;rdquo; Explaining the &lt;em&gt;why&lt;/em&gt; behind a constraint helps Claude generalize toward your real goal; wrap few-shot examples in &lt;code&gt;&amp;lt;example&amp;gt;&lt;/code&gt; tags, and separate instructions, context, and input data with XML tags. For long documents, place the reference material at the top of the prompt and the question at the very end, asking Claude to quote relevant passages before answering.&lt;/p&gt;
&lt;p&gt;To control formatting, tell Claude what to do rather than what &lt;em&gt;not&lt;/em&gt; to do—such as &amp;ldquo;write in smooth, flowing prose paragraphs&amp;rdquo; instead of &amp;ldquo;do not use markdown&amp;rdquo;—and match your prompt&amp;rsquo;s formatting style to the output style you want. The guide also covers leveraging extended thinking to reflect on results after tool calls, encouraging parallel tool execution for independent operations, and tracking state across long-running tasks. For coding specifically, instruct Claude to write general-purpose solutions that work for all valid inputs rather than hardcoding values to pass visible tests, since tests are meant to verify correctness rather than define the implementation.&lt;/p&gt;
&lt;h2 id="stop-over-thinking-ai-subscriptions"&gt;&lt;a href="https://steipete.me/posts/2025/stop-overthinking-ai-subscriptions" rel="noopener noreferrer"&gt;Stop Over-thinking AI Subscriptions&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Peter Steinberger, tired of constantly being asked how much he spends on AI, runs the numbers to show that AI subscriptions are a bargain compared to the time they save. At the time of writing (early June 2025), he calls the $200/month Claude Max 20x plan the best deal in tech: roughly 900 messages per 5-hour window, which translates to virtually unlimited Claude Code usage. Cursor Pro at $20/month includes 500 fast requests and charges $0.04 per extra request, meaning a three-hour live tutorial with over 200 requests cost him only about $8. His biggest variable expense is OpenAI&amp;rsquo;s o3 ($10 per million input tokens, $40 per million output tokens), which makes up roughly half of his total AI bill; developers on a tighter budget can route o3 through a standard ChatGPT subscription using Repo Prompt, or join Anthropic&amp;rsquo;s developer partner program for 30% off API rates. He even built a menu-bar app called Vibe Meter to track spend in real time.&lt;/p&gt;
&lt;p&gt;Addressing fears of future price hikes, Steinberger points out that per-token inference costs have dropped roughly 1,000x over two years and competition continues to drive prices down. For contractors, the math is dead simple: at an $800 day rate, saving a single afternoon a month is worth $200, meaning Claude Max pays for itself in 5 hours and Cursor in 45 minutes. His takeaway: time is the only resource you cannot replenish, and Claude Max was the cheapest way to &amp;ldquo;mint&amp;rdquo; extra working hours.&lt;/p&gt;
&lt;h2 id="tests-should-not-contain-logic"&gt;&lt;del&gt;&lt;a href="https://blog.snork.dev/posts/tests-should-not-contain-logic.html" rel="noopener noreferrer"&gt;Tests Should Not Contain Logic&lt;/a&gt;&lt;/del&gt;&lt;/h2&gt;&lt;p&gt;This short post makes a case for keeping logic—especially conditionals and loops—out of unit tests so that when a test fails, you can immediately rule out a bug in the test itself. The author illustrates this with a buggy FizzBuzz implementation: because it checks &lt;code&gt;n % 3&lt;/code&gt; before &lt;code&gt;n % 15&lt;/code&gt;, calling &lt;code&gt;fizzbuzz(15)&lt;/code&gt; returns &lt;code&gt;&amp;quot;fizz&amp;quot;&lt;/code&gt; instead of &lt;code&gt;&amp;quot;fizzbuzz&amp;quot;&lt;/code&gt;. If a developer tries to avoid repetitive assertions by writing a loop that computes the expected value using the exact same &lt;code&gt;if/elif&lt;/code&gt; chain, the test duplicates the production bug and passes anyway. By contrast, &amp;ldquo;obvious&amp;rdquo; flat assertions with literal expected values, like &lt;code&gt;assert fizzbuzz(15) == &amp;quot;fizzbuzz&amp;quot;&lt;/code&gt;, catch the bug immediately.&lt;/p&gt;
&lt;p&gt;To reduce repetition without sneaking logic back into tests, the author recommends parameterized (table-driven) tests: declare a list of explicit &lt;code&gt;(input, expected)&lt;/code&gt; pairs—such as &lt;code&gt;(1, &amp;quot;1&amp;quot;)&lt;/code&gt;, &lt;code&gt;(3, &amp;quot;fizz&amp;quot;)&lt;/code&gt;, &lt;code&gt;(5, &amp;quot;buzz&amp;quot;)&lt;/code&gt;, and &lt;code&gt;(15, &amp;quot;fizzbuzz&amp;quot;)&lt;/code&gt; with &lt;code&gt;@pytest.mark.parametrize&lt;/code&gt; in pytest. That keeps tests concise and readable while verifying each case independently against a concrete literal.&lt;/p&gt;
&lt;h2 id="do-you-really-know-java"&gt;&lt;a href="https://blog.jetbrains.com/idea/2025/05/do-you-really-know-java/" rel="noopener noreferrer"&gt;Do You Really Know Java?&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Marking Java&amp;rsquo;s 30th anniversary, this JetBrains retrospective looks back at the language&amp;rsquo;s journey. In 1991, James Gosling&amp;rsquo;s team at Sun Microsystems kicked off the Green Project to build software for consumer electronics, needing a lightweight, safe language that could run across any hardware. Originally named Oak after the tree outside Gosling&amp;rsquo;s office window, the language was renamed Java after a trademark clash—likely inspired by Java coffee. Java debuted publicly in 1995 right as the web exploded. Its standout features for the era included &amp;ldquo;write once, run anywhere&amp;rdquo; portability via the JVM, automatic garbage collection, built-in multithreading (now joined by virtual threads from Project Loom), and a sandbox security model that treated untrusted code as a potential threat.&lt;/p&gt;
&lt;p&gt;The post also traces IntelliJ IDEA&amp;rsquo;s arrival in 2001, bringing context-aware code completion, reliable automated refactorings, and real-time static analysis. In the AI era, Java 24 ships over 20 features—including the Vector API to tap specialized CPU instructions for compute-heavy workloads—alongside Projects Panama, Amber, and Valhalla and ecosystem frameworks like LangChain4j and Spring AI. As the article puts it, Java doesn&amp;rsquo;t chase hype; it quietly gets stronger where it counts. Fun closing trivia: Java&amp;rsquo;s mascot Duke was designed by Joe Palrang, who later worked on animated films like &lt;em&gt;Shrek&lt;/em&gt; and &lt;em&gt;Madagascar&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id="machine-code-isn"&gt;&lt;a href="https://jimmyhmiller.com/machine-code-isnt-scary" rel="noopener noreferrer"&gt;Machine Code Isn&amp;rsquo;t Scary&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Jimmy Miller, who started out writing ActionScript in Flash, shares how he got over his fear of working close to the metal. Once he actually dug in, he realized that if you can make sure a JSON payload conforms to a JSON schema, you can write machine code. Machine code isn&amp;rsquo;t a single universal format—it depends on the processor&amp;rsquo;s instruction set architecture (x86-64 on most PCs, ARM on modern Macs, Raspberry Pis, and phones)—but it revolves around just three concepts: instructions, registers, and memory. On AArch64, every instruction is a 32-bit integer; an add-immediate instruction, for instance, is just a packed bit layout combining a 64-bit flag, a 12-bit immediate value, a source register, and a destination register at fixed bit offsets. Assembly like &lt;code&gt;add x1, x0, #0x2a&lt;/code&gt; is simply a human-readable shorthand for that integer, while &lt;code&gt;str&lt;/code&gt; writes a value to memory much like assigning into a giant array.&lt;/p&gt;
&lt;p&gt;x86-64 is messier because instructions have variable lengths and carry decades of &amp;ldquo;historical baggage,&amp;rdquo; yet the building blocks are the same: a REX prefix for 64-bit operations, a ModR/M byte specifying register or memory addressing, and an opcode. Miller puts those bytes together by hand to encode an instruction that loads the number 42 into the &lt;code&gt;RBX&lt;/code&gt; register. He notes there is still plenty more to learn—status flags, calling conventions, the stack—but getting a minimal program running from raw bytes dissolved the mystique and filled in foundational gaps he had previously papered over with other people&amp;rsquo;s libraries.&lt;/p&gt;
&lt;h2 id="the-art-of-sql-query-optimization"&gt;&lt;a href="https://jnidzwetzki.github.io/2025/06/03/art-of-query-optimization.html" rel="noopener noreferrer"&gt;The Art of SQL Query Optimization&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;SQL is declarative: you state &lt;em&gt;what&lt;/em&gt; result you want, and the database engine figures out &lt;em&gt;how&lt;/em&gt; to compute it. The query optimizer enumerates candidate execution plans, estimates their cost, and picks the cheapest one—for example, when a query returns most of a table, a sequential full-table scan is often faster than chasing index pointers. To visualize where PostgreSQL switches plans, Jan Nidzwetzki built Plan Explorer, an open-source tool inspired by the Picasso optimizer visualizer: it runs a parameterized query across a 2D grid of selectivity values and plots the chosen execution plan, estimated cost, actual runtime, estimated row count, and actual row count. It can run entirely in the browser via PGlite (PostgreSQL compiled to WebAssembly) or in server mode against a real PostgreSQL instance using &lt;code&gt;EXPLAIN (ANALYZE)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On a self-join over an indexed 100,000-row table, Plan Explorer reveals PostgreSQL switching between five distinct execution plans depending on the filter bounds. One neat detail: even when the query is written with a &lt;code&gt;LEFT JOIN&lt;/code&gt;, PostgreSQL executes an &lt;code&gt;INNER JOIN&lt;/code&gt; because a filter on the right-hand table eliminates any &lt;code&gt;NULL&lt;/code&gt;-padded rows the left join would have produced. The visualizations also expose a cardinality-estimation bug: PostgreSQL assumes two filter predicates are correlated when they are actually independent, causing estimated row counts to diverge sharply from reality—a case where extended statistics can help. Beyond the striking visual patterns, Plan Explorer is a practical workbench for anyone tuning or developing custom cost models in PostgreSQL.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>