玩转编程语言:编程技巧

摘要

  • 1.1 如何阅读源码?
  • 1.2 程序命名规范

If you’re doing an experiment, you should report everything that you think might make it invalid - not only what you think is right about it. —— Richard Feynman

一、如何阅读源码?

1.1 阅读源码的一般流程

  1. 划分核心子系统(eg: Linux kernel 进程管理子系统、文件管理子系统)
  2. 分析主要数据结构 (结构体)
  3. 关键程序列表(加载顺序,调用关系call flow,消息传递路径,性能消耗)
  4. 主题式探索、带着目的分析实例(eg: Linux 支持闰秒吗?)

技能提高的秘诀:迫于需要的学习。

Problem Domain Model Arch & Implement Improvement Best Practice
项目、框架和关键性概念 Architecture Key Concept ——- 问题模型化、验证Demo ——- ——-

框架为应用而生:平衡技术实现、业务应用、项目

1.2 程序命名规范

The most important consistency rules are those that govern naming. The style of a name immediately informs us what sort of thing the named entity is: a type, a variable, a function, a constant, a macro, etc., without requiring us to search for the declaration of that entity. The pattern-matching engine in our brains relies a great deal on these naming rules.

Naming rules are pretty arbitrary, but we feel that consistency is more important than individual preferences in this area, so regardless of whether you find them sensible or not, the rules are the rules.

二、编程工具与开发自动化

参考文献

Catalog:Language,开发语言

source:https://riboseyim.github.io/

欢迎扫码关注微信公众号获取最新动态,读者交流 QQ 群:338272982 。

推荐文章