Take a look at tinywm to get an idea of the basics behind writing your own window manager. I'm using evilwm, and have been for years. However, I've tried about 15 different tiling window managers, and I have yet to find one that suits my needs perfectly. I stayed with subtle for about a week, but it just wasn't for me.