Not only is Martin Blais' explanation very helpful, his software, Beancount, is also very suitable for any personal finance projects, especially if you have a background as Developer.
Personally, I combine beancount with fava and find it much better than e.g. GnuCash.