Pre-emptive Commit Messages
Write commit messages before coding. Describe how the software behaves, not what you have done.
Random thoughts about programming
Write commit messages before coding. Describe how the software behaves, not what you have done.
You want to invent a new language, and you want to do this in F#, don’t you? And, of course, you want to base its parser on Monadic Parser Combinators. You’ve always wanted, just admit it.
I’m addicted to consult.el. It is so convenient that when I found out that isearch-forward-symbol-at-point (M-s .) was a thing, I immediately felt the desire to integrate it with consult.el. Luckily, this was way easier than I thought. Let’s walk through the steps I took. As often happens with Emacs, along the path of exploring its source code, we will find some random pearls here and there to…
I promised myself to write a Tree-sitter major mode for F#. I’ve been told that it should not be such an insurmountable endeavour, but given that I start from the scratch, along the journey I will need to learn a bunch of new topics from the ground up. Nice, that’s why we use Emacs, right? For each of those themes, I will publish a little blog post to share the lesson learnt. Today it’s the…
Summaries From Matteo Vaccari: There’s no easy way to evolve the hardcoded values into general code. Alistair Cockburn said that this problem could be better solved by more mathematically-oriented thinking upfront about how many spaces should be generated where Emily Bache said that “recycling tests” is a valid way to iterate towards a difficult problem Other solutions came from Ron Jeffries,…
How an innocuous Kata shows that either emergent design does not exist, or that a better way of doing TDD is possible.
Ever wondered why parametric tests in xUnit are called “theories”? And why are tests called “facts” instead of, well, just “tests”? Investigating on this topic helped me realize that I have always used xUnit theories incorrectly. And that xUnit loves the idea of Property-Based Testing.
Let’s develop squint a little package for controlling the font height, so you won’t need to squint your eyes when you are on smaller screens. It will look like this: It will give us the chance to touch on: Face attributes. Asking the user to choose interactively from a list of options. The powerful consult--read. Lisp’s Dynamic and Lexical Binding. Few other little topics here and there.
Index Source code: github.com/arialdomartini/state-monad-for-the-rest-of-us Binary Trees Our journey starts with this problem: we want to count the number of leaves of an arbitrary Binary Tree. To keep the problem as simple as possible, we define a Binary Tree as that data structure having Nodes and Leaves, and in which every Node has exactly two branches. This is a Tree with 2 Leaves: Node / \…
Index Source code: github.com/arialdomartini/state-monad-for-the-rest-of-us In chapter 7, when we wanted to introduce a new type for the result value of index we got to this: // Tree a -> (Int -> (Tree (a, Int), Int)) let rec index = function | Leaf v -> fun count -> (Leaf (v, count), count + 1) | Node (l, r) -> fun count -> let li, lc = index l count let ri, rc = index r lc Node (li, ri), rc I…