TLDR Web Dev 2024-04-16

Dev salaries worldwide 🌍, weird monitor bugs 🖥, ML autocomplete in React 🔍

Articles & Tutorials

CSS in React Server Components (24 minute read)

React Server Components (RSCs) allow server-exclusive code, which can lead to better performance. However, this means that popular styling options, like CSS-in-JS libraries which rely on React's lifecycle, can conflict with RSCs. RSC's server-side focus clashes with the browser-centric nature of traditional CSS-in-JS libraries, but there are “zero-runtime” CSS-in-JS libraries that are fully compatible with RSCs today. If your application doesn't use these and already has a good “time-to-interactive” time, then migrating to these libraries is not worth it.

How to write a code formatter (27 minute read)

This article is a detailed walkthrough in building a basic code formatter, with code examples along the way. To create a code formatter, first transform the code into an abstract syntax tree (AST) and then build a formatting tree using nodes that represent concepts like text, whitespace, and indentation. Traverse the formatting tree, rendering each node into the final formatted code.

DB Indexes Do Not Magically Compose (4 minute read)

Database indexes are similar to organized lists that help you find information quickly. To be most effective, indexes should align closely with how you typically query your data. Indexes don't magically work well at random and take careful thought to get correct.
Opinions & Advice

Navigating Code Reviews as a Code Author (7 minute read)

A code author should have a growth mindset and approach code reviews as an opportunity to learn. A fixed-mindset code author views feedback during code reviews in a defensive way.

How should I express to my manager that I need to "coast" for a year or two? (Reddit Thread)

An engineer is dealing with serious family matters that requires them to put in less effort at work. While they want to tell their manager, commenters tell the original poster not to. Instead, they should continue working, albeit slower, and not tell the manager anything as nobody will probably notice.

How to succeed as a data engineer without the burnout (13 minute read)

Data engineers can avoid burnout and build effective data platforms by aligning the infrastructure with business needs, automating tasks, and prioritizing reliability. They should monitor infrastructure proactively and plan for failures ahead of time.
Launches & Tools

MarkdownDown (Website)

Convert any webpage to Markdown with images included.

Morphic (GitHub Repo)

An AI-powered answer engine with a generative UI.

Semantic Autocomplete (GitHub Repo)

Semantic Autocomplete is a performant React component that extends Material UI's autocomplete component with a local, quantized ML model. The model is used to perform similarity search and helps match by meaning, not just letters. The component is full-featured and doesn't require any extending.

The One Billion Row Challenge in CUDA: from 17m to 17s (10 minute read)

This author attempted to solve the One Billion Row Challenge using CUDA to much success. While a pure C++ solution took 16.5 minutes, the CUDA solution achieved a 60X speedup, completing in 16.8 seconds.

How Do Machines ‘Grok' Data? (10 minute read)

Researchers have discovered that overtrained neural networks can develop unexpected and innovative solutions to problems, a phenomenon they have termed “grokking". These grokked networks solve problems like modular arithmetic using mathematical manipulations that mimic trigonometric functions.

Weird monitor bugs people sent me in the last 5 years (8 minute read)

This author, who develops an app that controls monitor settings, has observed unusual monitor bugs over the years. These bugs include monitors randomly swapping positions after standby, turning monochrome unexpectedly, blacking out after receiving specific commands, and ignoring input switching or mute commands. Monitors often have faulty firmware and weird workarounds to these problems.
Quick Links

Redka (GitHub Repo)

Redka is Redis re-implemented in SQLite.

Supabase General Availability (3 minute read)

Supabase is officially out of beta.

My Cat Alerted Me to a DDoS Attack (3 minute read)

A cat woke up a developer in the middle of the night just as a DDoS attack was overwhelming their company's website, allowing them to handle it successfully.

Software Developer salaries have crazy variations around the world (2 minute read)

Regardless of where you live, working remotely or in person for a US company will increase your salary.
Get our free, 5-minute newsletter read by 350,000 frontend, backend, and full stack developers
Join 300,000 readers for