Skip to content

Instantly share code, notes, and snippets.

Anti-corruption layer

When a new system is being built that must have a large interface with another, the difficulty of relating the two models can eventually overwhelm the intent of the new model altogether, causing it to be modified to resemble the other system’s model, in an ad hoc fashion. The models of legacy systems are usually weak, and even the exception that is well developed may not fit the needs of the current project. Yet there may be a lot of value in the integration, and sometimes it is an absolute requirement.

Therefore, the developer should create an isolating layer to provide clients with functionality in

I think the best place to start is this book:

https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164

This book is worth reading twice.

One thing you will notice with these OO authors especially is that it might come across like they treat their ideas as a recipe to success. Don't think of it that way. Try to see the transendental ideas behind the concepts. The book above does get around to this at later chapters (explaining SOLID outside the OO sandbox), but just think about it this way: the main idea that this book is trying to convey

# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa`
# Remove all volumes

There are two goals we often see in programming that I consider almost synonymous: writing readable, clean, maintainable code, and writing correct code. This is because unmaintainable and hard-to-understand code leads to bugs: even if the original author didn't leave any bugs, eventually a maintainer will misunderstand the code and introduce a bug. And in this situation the original author is equally to blame for the bug as the maintainer.

Type systems are the single most powerful weapon for writing readable, clean, maintainable code. This is the principle of abstraction: types are what gives meaning to bytes. If all programmers had room-sized brains, they wouldn't need

use bitcoin::consensus::Decodable;
use bitcoin::consensus::Encodable;
use bitcoin::hashes::hex::FromHex;
use bitcoin::hashes::hex::ToHex;
use bitcoin::secp256k1::Secp256k1;
use bitcoin::secp256k1::SecretKey;
use bitcoin::PrivateKey;
use bitcoin::Transaction;
use std::str::FromStr;
<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sample Title</title><link>https://bitwissen.de/</link><description>Just a sample</description><language>de</language><managingEditor>[email protected] (Phanto Mias)</managingEditor><webMaster>[email protected] (Phanto Mias)</webMaster><atom:link href="https://bitwissen.de/" rel="self" type="application/rss+xml"/><item><title>Bitfinex weigert sich, russische Kryptowährungen einzufrieren</title><link>https://bitwissen.de/blogs/bitfinex-weigert-russische-kryptowahrungen-einzufrieren</link><description><![CDATA[Eine Krypto-Community setzt sich für die Rechte der Russen ein, während Hunderte von Unternehmen das Land verlassen, aber die endgültige Entscheidung liegt bei den Regulierungsbehörden.]]></description><guid>https://bitwissen.de/blogs/bitfinex-weigert-russische-kryptowahrungen-einzufrieren</guid><pubDate>Sat, 12 Mar 2022 09:52:08 +0000</pubDate></item><item><title>Die Perspektive der Blockchain

Event Sourcing

The limits of storage and processing power have been rapidly receding from view. Nowadays it is common for processors to execute billions of instructions per second and to have billions of bytes of RAM. The more memory we have, and the faster our machines are, the less we need mutable state.

As a simple example, imagine a banking application that maintains the account balances of its customers. It mutates those balances when deposit and withdrawal transactions are executed.

@sistemd
sistemd / REPL session
Created July 30, 2017 16:31
The master cryptanalyst
http://imgur.com/a/jxmFb