Building docker images with ansible
Docker is something really hot recently. It allows you to run your software with linux container easily. It’s actually kind of OS level isolation rather than hardware simulation nor kernel simulation. So you won’t have too much performance penalty but still have pretty nice virtual machine features. I really like the analog used by Docker community, shipping software should be easier and Docker serves as just like the standard container in shipping industry.
...
Read the full articleAuto post-commit PEP8 correction
It’s always an hateful job to correct PEP8 warnings manually.
$ flake8 billy --ignore=E501,W293
billy/tests/integration/test_basic.py:401:45: W291 trailing whitespace
billy/models/processors/balanced_payments.py:116:44: W291 trailing whitespace
billy/models/processors/balanced_payments.py:133:30: W291 trailing whitespace
I bet you don’t like this either. Today I cannot take it anymore. I was wondering, why I should do this thing machine should do? So I seek solutions on the Internet, and I found an article looks helpful - Syntax+pep8 checking before committing in git. The basic idea is to add a pre-commit hook script to git for checking PEP8 syntax before commit. By doing that, you cannot commit code with PEP8 warnings anymore, when you do, you see errors like this
...
Read the full articleTechnical debts
When you buy a house, you raise a mortgage. When you buy a car, you raise an auto loan. Maybe you are rich enough to clear all the debts at once, but anyway, we all live with debts, more or less. In fact, for software developers, we all live with debts as well. They’re so called technical debts. I really like the debt analog, technical debts are similar to debts in real life. Funny enough, most of people know how real debts work, but technical debts are not well known by developers. However, it makes sense. People live with the idea of debts maybe for thousands years, but there are only few decades history of computer.
...
Read the full articleKeep a readable Git history
Readability of code is important, there is a fact
Code is read more than it is written
This is so true, even when you are writing code, actually, you need to read the current code base again and again. Back to the ancient programming era, people are still using forbidden black magic - goto statements. Powered by the black magic, there is a demon Spaghetti code, and it looks like this
(From http://en.wikipedia.org/wiki/File:Spaghetti.jpg under Creative Commons 2.0 license)
...
Read the full article