The Two Hardest Things in Computer Science: A Deep Dive

2025-01-20
The Two Hardest Things in Computer Science: A Deep Dive

A classic programmer joke states: "There are only two hard things in Computer Science: cache invalidation and naming things." This article traces the origin and evolution of this witty phrase, exploring its humor and deeper meaning. From its initial concise form to variations incorporating 'off-by-one errors' and more, the joke reflects the numerous challenges programmers face daily, highlighting the complexity and amusement inherent in programming.

Read more
Development

Automating API Changes with Codemods: A Refactoring Revolution

2025-01-11
Automating API Changes with Codemods: A Refactoring Revolution

This article explores how codemods automate large-scale code changes, especially when dealing with breaking API changes. Leveraging Abstract Syntax Trees (ASTs), codemods precisely automate code transformations, significantly reducing the burden of manual refactoring. The article uses examples like removing stale feature toggles and refactoring complex React components, detailing the process using jscodeshift, and discusses potential pitfalls and solutions when scaling codemods. It highlights codemods' role in improving code quality and maintainability, showcasing a real-world case study of refactoring an Avatar component.

Read more
Development API changes codemod

Design Tokens: The Key to Scalable and Consistent UI Architectures

2024-12-18
Design Tokens: The Key to Scalable and Consistent UI Architectures

This article explores the role of design tokens in modern UI architecture. By representing design decisions as data, design tokens serve as a single source of truth, enabling automated code generation across platforms for faster updates and improved design consistency. It details the layered organization of design tokens (option, decision, and component tokens), automated distribution processes, and how to choose the appropriate number of layers and token scope. Finally, it discusses when design tokens are appropriate and their limitations, helping readers determine their suitability for their projects.

Read more