Keep It Simple.

Google开源项目风格指南

如何编写无法维护的代码

Python Zen:import this

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

书单:

  • 《代码整洁之道》
  • 《代码整洁之道:程序员的职业素养》
  • 《重构:改善既有代码的设计》
  • 《代码大全》

代码的可读性和简洁性 产生效率
离开时要比来时更整洁
代码不是结果,而是过程,保持微重构
对于技术债:Later is never.

Trick:
!!(int)规范转换bool值
tab缩进规范不统一,使用四个空格缩进保证格式的统一性,vim中可cc智能缩进来回退4空格

编程范式:
FP函数式编程,高度复用,健壮且安全。

安全编码思维:
数据和代码的严格区分

保持优雅的代码风格与写一手好字同等重要。
书单待阅读,持续更新想法。