RSSAmplifier

Blog

Thoughts of a Curious Software Engineer

Dmitry Danilov - Tech Blog

ddanilov.meRSS feed ↗20 posts

Latest posts

I Zeroized My Secret. Or Did I?

If you work with secret keys — signing keys, API tokens, anything that must not leak — you’ve probably written this happy little line and felt good about it: 1 secret.zeroize(); Wiped! Auditor happy, you happy. And honestly, that line is doing real work. But there’s a surprising amount of...

Fast Code, Expensive Confidence: Building Software With LLMs

For years, we repeated the same two words: “Architecture matters.” In the AI era, that sentence becomes less a belief and more a constraint. Not because LLMs are magical, but because they change the economics of building software in a way that exposes every weakness we used to tolerate. This...

Back to writing: two years, one book, and a lot in between

It has been more than two years since my last post, and a year since my book was published. I never wrote here about the process, but with some distance and time to reflect, I feel it’s the right moment to share the story. The book is called Refactoring with...

My thoughts on microservices and monoliths

Recently, several friends directed my attention to an intriguing article detailing Amazon Prime’s transition from a microservices architecture back to a monolith. It seems like this change of paradigm has triggered a lot of debates in the network, so I decided to share my thoughts on the topic. The dawn...

Disabling Disqus comments

This blog is powered by Jekyll, one of the most popular static site generators. Jekyll solved most of my issues with the blog: I edit markdown files in a code editor, commit them to GitHub and voila I see updates as web pages. No more WordPress plugins, weird CRM, half-baked...

Using shared_ptr for reloadable config

After my post std::shared_ptr is an anti-pattern I was thinking about an example of justified usage of std::shared_ptr. I have mentioned that it can be used to implement caching, and in this post, I am going to use it for implementing reloadable config. Imagine a situation when you need to...

VS Code with dockerized build environments for C/C++ projects

After I published Dockerized build environments for C/C++ projects, I was approached on a few occasions, both online and offline, with questions regarding my IDE/text editor setup. While IDEs and text editors provide different features, the most important, from my point of view, are syntax highlighting, auto-completion, and code navigation....

Dockerized build environments for C/C++ projects

In this post, I will share how to create a docker-based build environment for C and C++ projects targeted for Linux. Common problems of building projects “natively” on a workstation First of all, let us discuss why building C/C++ projects directly on a workstation may become a problem. C++ does...

Terminating with panic! in Rust

The Rust programming language provides a few ways to terminate a program when it reaches an unrecoverable state by calling the macro std::panic! - a reference to kernel panic that I have found quite amusing. It comes in handy when an assert needs to used within code, such as for...

Configuring core dumps in docker

The purpose of this post is to provide general guidance on enabling and collecting core dumps for applications running in a docker container. Disclaimer: This post is mostly for quick reference for myself and any interested parties. First of all, the host needs to be configured to save the dumps...

How to overwrite a file in Rust

Recently, I took an interest in the Rust programming language due to its performance and safety. I chose Rust because of its RAII-based memory model, high-level abstractions which do not compromise perfomance, and the ability to disable its standard library and develop for bare metal. As a bonus, it comes...

How signals are handled in a docker container

In my previous post, I provided insight on the importance of running docker with the --init flag to ensure the proper exit code is returned when an application calls the abort function. While researching on the subject, I stumbled upon a bug report on GitHub regarding this issue, for which...

Exit codes in docker when a program aborts

In an earlier post of mine “Let it explode!”, we explored “handling” certain exceptions via premature termination. Now, it is time to solve the mystery of process termination in Docker. Nowadays, Docker containers have become the de facto standard of shipping applications. While running docker containers, I noticed an unexpected...

The "moving" truth behind std::optional

The class template std::optional manages an optional contained value, i.e. a value that may or may not be present[1]. It is a great alternative for std::unique_ptr, or raw pointer, when used solely to express that a value is indeed optional. The type of the variable explicitly states that a contained...

How I solved a bug by disabling C++ extensions

I was recently investigating a bug and would like to share an unexpected, yet interesting discovery regarding the cause of the issue. In order to provide an idea of what I was working on, consider the following code as a simplified representation: 1 2 3 4 5 6 7 8...

Let it explode!

Exceptions are an inherent part of modern C++. Everything is clear with the exceptions that can be handled, but what do we do with the exceptions that have no foreseeable resolution? One of the ways to work with them is to catch, log, and exit the application. Let’s take a...

The switch from Vim to Neovim

For the past five years, my go-to text editors have been Vim and gVim/MacVim. Currently, I work on macOS with Ubuntu, as a target OS, running on the local VMware Fusion virtual machine. Personally, I prefer to use the macOS GUI over Ubuntu and do not enjoy constantly switching between...

Docker run/exec and carriage return

Recently, I was writing a script whose function was to retrieve and parse a list of processes that were running in a docker container. The script was based on another script that did the same by ssh-ing to a remote server. However, my grep/sed/awk command set did not work despite...

Implementations of std::async and how they might Affect Applications

Intro Recently, I have been reviewing the function std::async and decided to get a better understanding. The C++ standard says: The function template async provides a mechanism to launch a function potentially in a new thread and provides the result of the function in a future object with which it...

Google Docs and C++ 11

While writing about smart pointers in C++, I noticed a funny thing: Google Docs knows about C++ syntax but not C++ 11! It showed the following suggestion: I hope the Google Docs team will adjust the spell checker to the latest C++ standards:)