RSSAmplifier

Blog

Alex Bespoyasov

Blog about web development and software design.

bespoyasov.meRSS feed ↗137 posts

Latest posts

My 2024 or Why I've Been so Quiet

My 2024 or Why I’ve Been so Quiet My blog and social media have been quiet this year. I haven’t published a single article and have hardly appeared on any social media. Today, I want to tell why. This post won’t be particularly useful like the others, it’s more of an attempt to reflect on my 2024. If you’re not interested in such posts, you can safely skip this one. Failure of the Year I’ve been…

Migrated Site to SvelteKit

Migrated Site to SvelteKit In September, I migrated my site to a new stack. In this post I want to discuss the reasons for and result of the migration, as well as share my impressions of the new stack. Why Migrate I had two main reasons to rebuild the site: the desire to radically simplify everything and the feeling that Next is not good for generating static sites. Desire for Simplification For a…

Explicit Software Design. Preliminary Conclusions

Explicit Software Design. Preliminary Conclusions I planned this series as a playground for various methods of software development and design, using a single application as an example. The original content plan was much broader: I wanted to add the server side, discuss distributed systems, talk about error handling and its functional alternative, delve deeper into DDD principles through examples,…

Part 9. Decoupling Features with Events

Part 9. Decoupling Features with Events Last time , we created a new feature and implemented it, exploring how to develop and refine various modules with different levels of depth depending on the requirements. In this post, we will discuss how to make application slices more independent using events and when it may be justified. By the way, all the source code for this series and the blog’s…

Part 8. Adding New Feature

Part 8. Adding New Feature In previous posts, we wrote an application with one feature—a currency converter. In this post, we will add a new feature, implement it (in a bit simpler way than the previous one 🙃), discuss how to keep the coupling under control, and talk about the benefits of vertical slices. By the way, all the source code for this series and the blog’s source code are available on…

Part 7. Cross-Cutting Concerns and Extendable Infrastructure

Part 7. Cross-Cutting Concerns and Extendable Infrastructure In the previous posts, we composed a basic version of the application that handled the main use cases. In this post, we will discuss functionality that is related to business logic indirectly: infrastructure expansion, analytics, alert monitoring, logging, and so on. By the way, all the source code for this series and the blog’s source…

Part 6. App Composition without Hooks

Part 6. App Composition without Hooks Let’s continue experimenting with explicit software design. Last time we’ve built the converter app from its parts, composed everything with hooks, discussed ways to simplify composition, and talked about various types of testing. In this post, we’ll discuss how to do the same thing without hooks, how to inject dependencies “before runtime,” and whether…

Part 5. App Composition

Part 5. App Composition We continue the series of posts and experiments about explicit software design. Last time we implemented the infrastructure for the application and connected it to the application core’s output ports. In this post, we’ll talk about composition, assemble the converter from its components, and discuss various types of testing. By the way, all the source code for this series…

Part 4. Ports, Adapters, and Infrastructure

Part 4. Ports, Adapters, and Infrastructure Let’s continue the series of posts and experiments about explicit software design. Last time we created UI components and discussed the interaction between the UI and the application core. In this post, we will prepare the project infrastructure: create a store for the data model and a service for API requests. By the way, all the source code for this…

Part 3. Ports, Adapters, and UI

Part 3. Ports, Adapters, and UI Let’s continue the series of posts and experiments about explicit software design. Last time we finished designing the application core and created use case functions. In this post, we will write components for the user interface, discuss its interaction with the domain model, and look at the difference between different types of data that are displayed in the UI.…

Part 2. Application Core Design

Part 2. Application Core Design Let’s continue the series of posts and experiments about explicit software design. Last time , we discussed what a domain model is, its benefits, and how we can use functional programming, static typing, and DDD to simplify modeling. In this post, we will talk about how to design use cases and discuss how to integrate our application with the outside world without…

Part 1. Domain Modelling

Part 1. Domain Modelling We continue the series of posts and experiments about explicit software design. In the previous post , we defined the principles that we will adhere to when developing the application, and the code problems we want to avoid. In this post, we will talk about what a domain model is, why it is useful, and how we can use functional programming, static typing, and DDD to…

Explicit Software Design Series

Explicit Software Design Series Sometimes, I read books about software design and development. Usually, they are about “enterprise software” and rarely discuss their applicability in web development. However after reading them, I’m always interested in whether the techniques from these books can be applied to my daily tasks, whether they are profitable and justified. This series of posts is an…

Web UI for My Latest Book

Web UI for My Latest Book Today I launch a web UI for my book “Refactor Like a Superhero” ! 🎉 The goal of this UI is to make it more comfortable to read, navigate, and search the book contents. Each chapter has quick access to its sections and other chapters. Accents and important side notes are now highlighted and easier to find. …And, of course, it has the dark theme! Technologies The site is…

Refactor Like a Superhero: Introducing a New Online Book!

Refactor Like a Superhero: Introducing a New Online Book! In January this year, I was preparing a talk about refactoring. I collected all the techniques and resources I use in my everyday work and wanted to reflect them in the talk. But there was so much material that it was impossible to compress all of it into a 40-minute talk. For the talk, I trimmed and cut the text and code samples. However,…

Declarative Data Validation with Rule-Based Approach

Declarative Data Validation with Rule-Based Approach and Functional Programming I’ve always found client data validation to be a challenge. Self-written validators’ code easily rolls into an unreadable mess and validation libraries sometimes carry infrastructural limitations that can complicate their integration. In this post, I want to show you a principle I use in my projects that makes…

Domain Modelling Made Functional. Part 3

Domain Modelling Made Functional. Part 3 Last time we read the second part of the book. We discussed the functional decomposition of the domain model and learned how to use types to reflect business requirements. At the end of the chapter, we wrote code that was both documentation and a compilable basis for implementing the system. This time we will learn about functional composition, partial…

Domain Modelling Made Functional. Part 2

Domain Modelling Made Functional. Part 2 Let’s continue reading “Domain Modelling Made Functional” by Scott Wlaschin. Last time we read the first part of the book. We discussed what a domain is, why it is needed, and how to decompose large domains into small components that can develop independently of each other. This time we will design one of the processes in a functional style. We’ll look at…

Domain Modelling Made Functional by Scott Wlaschin

Domain Modeling Made Functional by Scott Wlaschin I wanted to read this book for a long time, because I heard a lot of good reviews about it. After reading it, I’m amazed at how many tricks from the book I’ve developed on my own, because it’s really more convenient to develop that way 😃 The book is good. It’s written with an emphasis on practice and good code examples. It’s clear that one book…

Text Generation with Markov Chains

Text Generation with Markov Chains Let’s do something fun today! 😃 I once came across a discussion on Russian Twitter about how to generate a nice human-readable login . From university, I remember that it’s possible to use Markov chains to generate such a text. I wasn’t working with Markov chains at the time. So I was curious to implement them from scratch and see what kind of text they could…

My Contribution to Doka

My Contribution to Doka Today we launched Doka , an online encyclopedia about web development, written in clear and caring language. Doka is in Russian, our goal is to make learning and teaching web development easier and simpler for whole Russian-speaking community. Doka is open source. This means that anyone who wants to fix a typo or write a new article can open a pull request in the project…

Clean Architecture on Frontend

Clean Architecture on Frontend Not very long ago I gave a talk about the clean architecture on frontend. In this post, I’m summarizing that talk and expanding it a bit with details and concepts I didn’t have time to explain. I’ll put links here to all sorts of useful stuff that will come in handy as you read: The Public Talk Slides for the Talk The source code for the application we’re going to…

Finishing Up the Binary Adder in the Game of Life

Finishing Up the Binary Adder in the Game of Life Let’s finish our binary calculator that adds two 2-bit numbers together. In the first post we created the Game of Life basics and a drawer module. In the previous posts , we implemented the Game of Life using JavaScript and created logic gates using glider streams as signals. This time, we’re going to use created logic gates to build half adder and…

Implementing Logic Gates in the Game of Life

Implementing Logic Gates in the Game of Life Let’s continue writing a binary adder in the Game of Life. In the previous post , we implemented the Game of Life basics and created a module for rendering the population on the screen. In this post, we’re going to learn common patterns in the Game of Life and create “signals”. At the end of this post, we will create 4 logic gates: NOT, AND, OR, and…

Let's Create a Binary Adder in the Game of Life!

Let’s Create a Binary Adder in the Game of Life! After I read “Code” by Charles Petzold , I wanted to create a logic circuit and visualize its work: how the signals travel, what is the core of a logic gates, etc. The first thing I remembered was the Matt Parker’s computer made out of dominoes . I wanted to create something like that. A bit after, I remembered that I always wanted to write the Game…

TDD: What, How, and Why

TDD: What, How, and Why In April, I gave a talk about TDD on the Frontend Crew conference in Russian. In the talk I shared what TDD is, what its benefits are, and how to reduce friction to start using it in your project. In this post, I pile up all main ideas from the talk, unfold each of them, and translate the text in English. If you want me to give this talk at your company or conference,…

My Week at @jsunderhood

My Week at @jsunderhood It so happened that I got a chance to run a collective developers account on Russian Twitter called @jsunderhood for a week from April, 26 to May, 2 . In this post I want to collect the most important stuff I tweeted and share a translated version on my blog. Monday. Architecture I started the week with an idea: what is clean architecture , why do we need it, what are the…

Generating Trees Images, Part 3. From Fractal to a Real Tree

Generating Trees Images, Part 3. From Fractal to a Real Tree Let’s finish our trees images generator! In the first part of this series, we designed the application architecture, set up the environment and dependency injection. In the end, we created an L-Systems module that could generate a string representation of a tree. In the second part , we created a geometry module and a DOM adapter for…

Generating Trees Images, Part 2. Geometry, Graphics and DOM

Generating Trees Images, Part 2. Geometry, Graphics and DOM Let’s continue creating trees images generator! In the previous post , we designed the application architecture, set up the environment and dependency injection. In the end, we created an L-Systems module that could generate a string representation of a tree. In this post, we’re going to create a geometry module. It will calculate points…

Generating Trees Images on Canvas Using L-Systems, TypeScript and OOP

Generating Trees Images on Canvas Using L-Systems , TypeScript and OOP Frontend development and Object-Oriented Programming are closer than they might seem. The SOLID principles and Clean Architecture can be used to create frontend applications and they provide convenient tools for the development. In this series of 3 posts, we will create an image generator that will draw trees on canvas . We…

My Workshop on Testing React Apps is Out

My Workshop on Testing React Apps is Out A month ago, I was invited to give a talk at local junior-developer meetup . The audience wanted to listen about React application testing, so this was the topic. I thought I should talk about how I usually test applications (with some examples of Tzlvt ) and TDD. The latter saves me tons of time, that’s why I decided to include it in the talk. I figured…

Code. Part 2

Code. Part 2 In the first part we’ve read chapters 1–14. We learned how to build electrical and logic circuits with light bulbs. At the end of the first part, we built a circuit based on them that counted from 0 to 256. This time we will read the remaining chapters 15-25. By the end we will assemble the first memory that can store information and then connect it to an adder. We will build the…

Code by Charles Petzold

Code by Charles Petzold As the author says in the introduction, this is a book about how computers work. Petzold tries to avoid “elaborate metaphors and comparisons”. He writes bluntly that “the computer is a hierarchy with transistors at the base and information displayed on the monitor at the top”—and this is what the book is about. In Part I of this summary, we will look at Chapters 1-14. We…

Trying React Native Again

Trying React Native Again Continuing the tradition of trying out new technologies on Kursovik 😅 Last time I was playing around with new technologies, I used Electron to write the app. This time I decided to see how the React Native ecosystem is doing again. I tried using on it once before, and I thought the DX was pretty raw. This time it turned out to be different. First, Application I wrote the…

Rebuilt Site with Next and TypeScript

Rebuilt Site with Next and TypeScript This year my blog turns 10 years old. In honor of that, I rebuilt the site. I decided to completely change the stack and rewrite it in Next.js with TypeScript. In this post, I share my impressions of the stack, the process of moving and using it. Motivation The main complaint with my last stack is the poor usability. My self-written static generator based on…

Dependency Injection with TypeScript in Practice

Dependency Injection with TypeScript in Practice The last letter in SOLID is a Dependencies Inversion Principle . It helps us decouple software modules so that it is easier to replace one module with another. The dependency injection pattern allows us to follow this principle. In this post, I’ll show what dependency injection is, why it is useful, when to use it, and what instruments and tools can…

Willpower Doesn't Work by Benjamin Hardy

Willpower Doesn’t Work by Benjamin Hardy When I opened this book , I already had a rough idea of what it would be about. I had come to the conclusion of the book’s title more than once myself. I decided to read it in order to discover details I hadn’t thought of before. And I found some interesting thoughts and tricks there. I read this book in translation, not in English. Quotes I show in this…

Fullstack React with TypeScript

Fullstack React with TypeScript Maxim Ivanov and I published the book “Fullstack React with TypeScript” with the support of Newline publisher. I wrote chapters 3 and 5 for it. Chapter 3. React Patters In chapter 3, using the example of a virtual musical keyboard, I described such patterns as Render-Props and Higher Order Component and how to solve the same problem with React Hooks. Screenshot of a…

Don't Push: Automate Instead

Don’t Push: Automate Instead This post is a logical continuation of my old post about constraints and developing good habits. To recap briefly his idea: if you can’t force yourself to do something, you shouldn’t force yourself to do it - you should put yourself in such conditions that it would be impossible or inexpedient not to make a deal with yourself. This post is about the fact that this…

Anxiety Free. Part 2

Anxiety Free. Part 2 In the first part of this summary we discussed where anxiety comes from, why it was needed and learned about specific phobias, panic attacks and OCD. In this part we will talk about generalized anxiety disorder, sociophobia and post-traumatic stress disorder. Generalized Anxiety Disorder — In fact, you treat anxiety the way an alcoholic treats booze: it’s a way for you to dull…

Anxiety Free by Robert L. Leahy

Anxiety Free by Robert L. Leahy Robert L. Leahy is a doctor of psychology, one of the co-founders of cognitive-behavioral therapy. In this book, he talks about the mechanisms of anxiety, why people needed it, how we saw it, and what to do with it now, in today’s world. In the first part of the summary we will look at where anxiety comes from, why it was needed and learn about isolated phobias,…

Marking Emails as Read Automatically

Marking Emails as Read Automatically I live without notifications. The exceptions are the badge on the email app icon and Slack (from mentions through @ and personal messages). About three years ago I started unsubscribing from all garbage mailings instantly. The only problem is that sometimes even the needed newsletters come at the wrong time and distract me from work. The last straw for me was…

Jedi Techniques by Maxim Dorofeev

Jedi Techniques by Maxim Dorofeev This is a book about task management and personal performance that offers a way of dealing with tasks with a less cognitive load as possible. In general, the way of working I have developed for myself and how I have been working for the last 5 years is reminiscent of Jedi Techniques. It is just that Dorofeev’s level of “nerdiness” is higher. But, for example,…

Tzlvt. “Black Screen of Death” Post-Mortem

Tzlvt. “Black Screen of Death” Post-Mortem On November 25 at 9:10 Moscow time, we released an update to the Tzlvt app for iOS under version 1.2. The release resulted in a failure that left users unable to use the app for a day and a half. The app opened on the phones, but showed a black screen and did not respond to gestures or rebooting. We were unable to fix the problem completely. On November…

Tzlvt. Why Rewrite in TypeScript

Tzlvt. Why Rewrite in TypeScript I’ve wanted to rewrite Tzlvt for a long time. It’s not a matter of “Oh, I learned the new stuff, let’s put it everywhere.” No, it’s just maintaining the code base as it was has become too expensive. Why Maintenance Became Expensive There were several reasons to it. No Tests Because of this, any change in the code could lead to anything. Yes, green tests do not…

Make Error Messages Great Again

Make Error Messages Great Again Once upon a time, I’m sitting at my desk, I’m programming the UI, doing my work, and all of a sudden the console turns red, and this pops up: Uncaught Error: Bad dependency path or symbol. // Stacktrace of compiled JS-code... // Stacktrace of inner library functions... Yup, this is an error message. Yup, this is the whole message. And yup, this is a good example of…

Patterns for Fault Tolerant Software. Part 2

Patterns for Fault Tolerant Software. Part 2 In the previous post , we discussed chapter 1–4 and considered the concepts of fault tolerance, principles of fault tolerant design, and architectural patterns. In this part, we’ll look at patterns of error detection, error recovery, and error reduction. Chapter 5: Patterns for Error Detection Errors and malfunctions must be detected. There are two…

Patterns for Fault Tolerant Software by Robert S. Hanmer

Patterns for Fault Tolerant Software by Robert S. Hanmer This book about error-handling techniques and patterns. In the first part of the summary, we’ll discuss the introduction and chapters 1-4. We will look at the concepts of fault tolerance, principles of fault-tolerant design, and architectural patterns. Introduction We do not live in a perfect world. All systems have bugs that cause failures.…

Process of Creating MRKT. Part 2

Process of Creating MRKT. Part 2 In the previous post , I discussed what problems I encountered during the development of the new version of MRKT. In this post I’ll talk about the roles I’ve tried on during my work apart from being a “frontend developer” and what skills helped me to finish the job. Frontend Developers are Also Designers No plan can stand up to reality, and it’s the same with…

Influence: Science and Practice by Robert B. Cialdini

Influence: Science and Practice by Robert B. Cialdini The last time I read this book was in 2014. Since then, of course, I don’t remember anything, so I decided to reread it. This time I also made some notes, italics are mine. I read this book in translation, not in English. Quotes I show in this summary might be imprecise and slightly different from the original text. The author begins the story…