The Philosophy of Coroutines: A Programmer's Musings

2025-03-27

This article delves into the philosophy of coroutines through the lens of the author's personal journey. From early days simulating coroutines in C with preprocessor tricks to the advent of native C++20 coroutines, the author shares insights into their use and advantages. A comparison of coroutines versus state machines and threads highlights their flexibility, debuggability, and ease of cleanup, particularly beneficial for sequential tasks like network protocols and data stream processing. The author explores various coroutine implementations, optimization techniques using queues and pre-filters, and offers a glimpse into the future of coroutines.

Read more
Development

The Evolution of PuTTY's Icons: From Hand-Drawn to SVG

2025-03-12

This article chronicles the evolution of PuTTY's icons from hand-drawn images in the 1990s to today's scalable SVG vectors. The author initially created 32x32 pixel icons using the MSVC icon editor, constrained by the 16-color palette and display technology of the time. Over time, to accommodate higher resolutions and the needs of various tools, the author refined the process, eventually developing a script that auto-generates icons in multiple sizes and formats. This culminated in SVG versions, achieving true scalability. The design philosophy remains simple and clear, reflecting PuTTY's 'reassuringly old-fashioned' style, and continues to be used to this day.

Read more
Development Icon Design

Rethinking Bug Trackers: A Separation of Concerns

2025-03-10

After years of using various bug trackers, the author identifies a fundamental flaw in their data representation, leading to recurring frustrations. Three key issues are highlighted: a unified 'Fix Version' field conflating facts and plans; a two-tiered Status and Resolution system blurring the lines between code reality and future intentions; and the conflation of bug lists with to-do lists, creating awkwardness for non-bug tasks. The author proposes a 'separation of concerns' principle, suggesting a split into 'facts' and 'plans' tables. The facts table records objective bug information (existence, version, severity), while the plans table tracks intentions, timelines, and subjective priorities. This separation streamlines bug tracking, better accommodates different project types, and even allows for the complete omission of the plans table for projects focused solely on bug resolution.

Read more

Going Solo: A Veteran Programmer's Rejection of Git Forges

2025-03-05

Veteran programmer Simon Tatham has long maintained his open-source projects using independent Git repositories, eschewing popular platforms like GitHub and GitLab. He details his reasoning: trust – preferring self-control over reliance on large corporations; efficiency – avoiding the overhead of complex forge systems; user experience – minimizing the burden of account creation; and workflow autonomy – prioritizing independent development processes over platform constraints. He favors email patch submissions, detailing preferred methods including a Git repository URL, incremental Git bundles, and other approaches, explaining his rationale for each. While acknowledging the lower transparency of his method, he remains unconvinced of the benefits of forges outweighing their drawbacks. He concludes by expressing openness to alternative systems which offer both transparency and lightweight management.

Read more
Development Code Hosting

A Deep Dive into XOR: From Boolean Logic to Cryptography

2025-02-18

This article delves into the seemingly simple XOR (exclusive OR) operator in computer science. Starting with XOR in Boolean logic, it progresses to bitwise operations on integers and explores XOR's applications in cryptography, pixel graphics, game theory, and finite fields. The author uses engaging storytelling and numerous examples to explain XOR's properties and uses, such as its role as a simple encryption method in cryptography, reversible drawing and erasing in pixel graphics, and determining optimal strategies in the game of Nim. Finally, the article connects XOR to mathematical concepts like the symmetric difference of sets, groups of exponent 2, Nim-sum, GF(2) finite field, and CRC checksums, revealing the deeper mathematical underpinnings and broad applications of the XOR operator.

Read more
Development