RSSAmplifier

Blog

Vladimír Zdražil Posts

Recent posts on vladimirzdrazil.com

vladimirzdrazil.comRSS feed ↗12 posts

Latest posts

Designing APIs for stateful flows: Don't make clients guess or obey

In many stateful systems, API failures aren’t caused by missing endpoints, incorrect schemas, or misinterpretations. They come up because the system doesn’t clearly define who’s responsible for coordination. These problems often appear in multi-step flows, where progress unfolds over time and across devices. Users may leave and return later. Steps may complete out of order. Some actions may be…

Current LLM tooling makes understanding optional

We usually talk about LLM tooling in terms of output: does the code work, does it pass tests, does it give me what I want? We talk far less about how it shapes our thinking during development. Every tool does this. Compilers, IDEs, REPLs, debuggers, they don’t just help you get more done. They incentivize by making some things easy and some hard. LLM tools are no different. The problem is not LLMs…

You don’t need that complexity: A fresh look at your project

When you’re working on a project for a long time, you might start to believe that a lot of complexity is needed when it really isn’t. Sometimes, you might even stop noticing it. How can you stop assuming things have to be complex and start finding ways to make your work easier? Definitions First, here are definitions of some terms I’ll be using. Feel free to skip them if you’re already familiar…

Option A vs A | null

TLDR Two common ways to represent absence of a value in TypeScript are A | null and Option<A> . I suggest you use A | null by default and switch to Option<A> only when needed. Such as when you want to use fp-ts utils. Introduction When representing the absence of a value in TypeScript, you can use a union type A | null , or a tagged union type Option<A> . In this post, we’ll discuss the…

Deep and shallow modules: Module design for reduced complexity

Updates 2023-05-28 Added TypeScript example . TLDR To keep complexity in check, prefer deep modules to shallow modules. A deep module has a lot of functionality hidden behind a simple interface. A shallow module has a relatively complicated interface, but doesn’t provide much functionality behind it. Introduction In this post, we’ll take a look at one of the ways to design modules in a manner that…

Binary search debugging: Simplify your debugging process

Introduction Tracking down bugs in your code is often frustrating. With a binary search debugging you can make it less so. It’s a simple technique that can help you pinpoint problematic lines of code quickly and efficiently. What is binary search debugging? Binary search debugging is a methodical process that aims to narrow down the cause of a bug by systematically testing different parts of the…

Why Object.keys doesn’t and shouldn’t return (keyof T)[]

TLDR Object.keys() doesn’t return (keyof T)[] in TypeScript because objects can have additional properties at runtime, leading to potential issues. Use wrapper as a workaround and be aware of the limitations when using it. Introduction Have you ever wondered why Object.keys doesn’t return type (keyof T)[] in TypeScript? In this article, we’ll explore the reasons behind this decision and look at…

The AHA principle: Avoid hasty abstractions

TLDR AHA (Avoid Hasty Abstractions) principle advises preferring duplication over the wrong abstraction, optimizing for change first, and waiting for necessary abstractions to emerge. Benefits are easier maintenance and flexibility. Be careful about excessive avoidance of abstractions and potential refactoring/testing challenges. Introduction As a developer, you strive to write a clean and…

Links from the past few weeks (Nov 30, 2022)

List of links, articles, and other resources you might find interesting from the past few weeks. Markdown Don’t complicate Markdown, use Markdown and HTML together John Gruber and Aaron Swartz intended Markdown to be used for prose and for it to be readable with no further processing. When Markdown’s syntax is insufficient for what you need to do, you can use regular inline and block-level HTML…

Git tips and tricks

Updates 2022-11-13 Added git repl section. 2023-05-07 This article has been split into multiple posts for easier reading and updating. Check out TIL Git for the latest tips. A collection of Git tips and tricks you might not know. Find the most frequently changed files You can find the most frequently changed files in the repository with this command: git log --pretty = format: --name-only < path >…

Links from the past few weeks (Oct 30, 2022)

List of links, articles, and other resources you might find interesting from the past few weeks. JavaScript ECMAScript proposal: Decorators JavaScript will soon have a new feature: decorators. The committee moved the proposal to stage 3 . The proposal defines decorators as functions called on classes, class elements, or other JavaScript syntax forms during definition. … Decorators let you…

Fuzzy search through files in Visual Studio Code

Visual Studio Code already supports searching across all the project files. But let’s make searching inside them even more ergonomic and easier to use. We’ll do it by taking an inspiration in the behavior of the command :RG from Vim plugin junegunn/fzf.vim . The goal Check out the Find in files in Visual Studio Code: As an alternative, we’ll create a custom shell command rgf for fuzzy searching.…