Reflections on Clean Architecture

Looking back at Clean Architecture by Uncle Bob. Funny how these principles are starting to feel like brand-new concepts again. :)

Uncle Bob

  • The goal of software architecture is to minimize the human resources required to build and maintain the required system.
  • The only way to go fast, is to go well.
  • Any organization that designs a system will produce a design whose structure is a copy of the organization’s communication structure. (Conway’s law)

SOLID

  • SRP: Each software module has one, and only one, reason to change. (This is NOT “A function should do one, and only one, thing, and do it well.”) A module should be responsible to one, and only one, actor. (actor == user or stakeholder)

Installing Portable Linux Binaries: A Quick Guide

Introduction

I use PeaZip on my computers. It’s a powerful cross-platform zip/unzip software.

I used to install it through yay, which re-downloads the entire source code and rebuilds it every time I update the OS. While staying up-to-date is crucial for security-sensitive applications like web browsers and cryptocurrency wallets (and plenty more), it’s not always necessary for tools like PeaZip. Even if you forget to update PeaZip, you likely won’t face security risks.

How to Configure DWM

Introduction

DWM is one of the most lightweight window managers available for Linux. While the name stands for Dynamic Window Manager, it’s primarily focused on tiling window management.

What is a Tiling Window Manager? A tiling window manager automatically arranges and sizes windows on your screen, typically in a grid-like fashion. This differs from the common floating window managers found in macOS, Windows, and Linux desktop environments like XFCE, KDE Plasma, and GNOME.

Type Conversion and Type Assertion in Go

Type conversion

The expression T(v) converts the value v to the type T.

In Go, assignment between items of different type requires an explicit conversion.

Here’s an example.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
package main

import (
	"fmt"
	"math"
)

func main() {
	var x, y int = 11, 12
	f := math.Sqrt(float64(x*x + y*y))
	var z uint = uint(f)
	fmt.Println(x, y, z)
}

Type assertion

Type assertion provides access to an interface value’s underlying concrete value.

Why Do We Need Unit Tests?

What is unit testing?

Unit testing is the process where you test the smallest functional unit of code.

Software testing helps ensure code quality, and it’s an integral part of software development.

It’s a software development best practice to write software as small, functional units then write a unit test for each code unit.

You can first write unit tests as code. Then, run that test code automatically every time you make changes in the software code. This way, if a test fails, you can quickly isolate the area of the code that has the bug or error.