- 完稿于 2019 年 2 月
- Outline
- 01.preface(前言)
- 贩卖焦虑的悖论,其实是自己焦虑
- 02.proof-of-work(如何证明你真的读过这本书?)
- 積ん読,指那些买回来堆在那里还没读过的(甚至后来干脆不看了的)书
- 据说,Kindle 的后台数据里可以看到清楚的 “打开率”,大抵上也是在 ¼ ~ ⅓ 之间,也就是说,差不多有 ⅔ ~ ¾ 的电子书籍被购买下载之后,从来就没有被打开过。
- 使用 GitHub
- Part.1.A.better.teachyourself(为什么一定要掌握自学能力?)
- 没有自学能力的人没有未来
- 自学能力是唯一值得被不断磨练的长技
- Part.1.B.why.start.from.learning.coding(为什么把编程当作自学的入口?)
- 道理当然很重要;可是,在传递道理的时候,例子相对来看好像更重要。
- 编程领域,实际上是当今世上极为罕见的 “教育机会公平之地”。
- 这个领域的知识结构,最接近每个人所面对的人生中的知识结构。
- Forward References
- Part.1.C.must.learn.sth.only.by.reading(只靠阅读习得新技能)
- 不是什么东西都可以从书本里学到的,只不过是因为自己读书不够多、不够对
- 勾心斗角的套路历史上全都被反复用过了。倒是有本中文书值得吐血推荐,民国时代的作者连阔如先生写的《江湖丛谈》,粗略扫过你就知道了,江湖那点事,也早就有人给你里里外外翻了个遍
- 我把那些能给你带来新视野,能让你改变思考模式,甚至能让你拥有一项新技能的内容称之为 “有繁殖能力的内容”。
- Part.1.D.preparation.for.reading(开始阅读前的一些准备)
- Part.1.E.1.entrance(入口)
- 乔治・布尔
- 布尔运算
- Part.1.E.2.values-and-their-operators(值及其相应的运算)
- Part.1.E.3.controlflow(流程控制)
- Part.1.E.4.functions(函数)
- 位置参数(Positional Arguments,在官方文档里常被缩写为 arg)
- 关键字参数(Keyword Arguments,在官方文档里常被缩写为 kwarg)
- 可选的位置参数(Optional Positional Arguments)
- 可接收很多值的位置参数 *object
- Part.1.E.5.strings(字符串)
- Part.1.E.6.containers(数据容器)
- 迭代(Iterate)
- 列表(List)可变有序容器 []
- 元组(Tuple) 不可变有序容器 ()
- 集合(Set)
- Part.1.E.7.files(文件)
- 01.preface(前言)
with open(‘file_path’, ‘a+’) as f:
f.write(’test’)- [Part.1.F.deal-with-forward-references(**如何从容应对含有过多 “过早引用” 的知识?**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.1.F.deal-with-forward-references.ipynb) - 不懂也要硬着头皮读完:读不懂也要读完,然后重复很多遍 - 磨练 “只字不差” 的能力 - 好的记忆力很重要 - 尽快开始整理归纳总结 - 先关注使用再研究原理 - 尊重前人的总结和建议 - PEP - [Part.1.G.The-Python-Tutorial-local(**官方教程:The Python Tutorial**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.1.G.The-Python-Tutorial-local.ipynb) - 官方文档中最重要的链接 - Tutorial: https://docs.python.org/3/tutorial/index.html - Library Reference: https://docs.python.org/3/library/index.html - 为什么一定要阅读官方文档:全面,第一查询对象只能是官方文档 - [Part.2.A.clumsy-and-patience(**笨拙与耐心**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.A.clumsy-and-patience.ipynb) - 四个阶段:学练用造 - 绝对不做预算不够的事情 - 事跟天分与智商几乎没有任何关系 - [Part.2.B.deliberate-practicing(**刻意练习**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.B.deliberate-practicing.ipynb) - 刻意思考哪里需要刻意练习 - [Part.2.C.why-start-from-writing-functions(**为什么从函数开始?**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.C.why-start-from-writing-functions.ipynb) - [Part.2.D.1-args(**关于参数(上)**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.1-args.ipynb) - 函数参数传递的是 value,例外:可变容器(如列表) - [Part.2.D.2-aargs(**关于参数(下)**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.2-aargs.ipynb) - Positional - Arbitrary Positional 类似列表 - Keyword - Arbitrary Keyword 类似字典 - [Part.2.D.3-lambda(**化名与匿名**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.3-lambda.ipynb) - `lambda_expr ::= "lambda" [parameter_list] ":" expression` - 作为某函数的返回值 - 作为某函数的参数 - [Part.2.D.4-recursion(**递归函数**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.4-recursion.ipynb) - 递归函数(Recursive Functions)—— 那些在自身内部调用自身的函数。 - [Part.2.D.5-docstrings(**函数的文档**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.5-docstrings.ipynb) - Docstring,必须在函数定义的内部语句块的开头,也必须与其它语句一样保持相应的缩进(Indention) - `help(function_name)` - `function_name.__doc__` - 书写 Docstring 的规范 - PEP 257: Docstring Convensions https://www.python.org/dev/peps/pep-0257/ - PEP 258: Docutils Design Specification https://www.python.org/dev/peps/pep-0258/ - example
javascript
def say_hi(*names, greeting=‘Hello’, capitalized=False):
"""
Print a string, with a greeting to everyone.
:param *names: tuple of names to be greeted.
:param greeting: ‘Hello’ as default.
:param capitalized: Whether name should be converted to capitalized before print. False as default.
:returns: None
"""
- Sphinx 版本的 Docstring 规范 - http://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html - https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html - [Part.2.D.6-modules(**保存到文件的函数**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.6-modules.ipynb) - 模块 - 模块文件系统目录检索顺序 - 引入指定模块中的特定函数
javascript
from mycode import *
from mycode import is_prime
from mycode import is_prime as isp
import mycode as m
- [Part.2.D.7-tdd(**测试驱动的开发**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.7-tdd.ipynb) - TDD - https://docs.python.org/3/library/doctest.html - https://docs.python.org/3/library/unittest.html - [Part.2.D.8-main(**可执行的 Python 文件**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.D.8-main.ipynb) - [Part.2.E.deliberate-thinking(**刻意思考**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.2.E.deliberate-thinking.ipynb) - 刻意思考哪儿需要刻意练习 - 这东西能用在哪儿呢? - https://en.wikipedia.org/wiki/MoSCoW_method - Must have - Should have - Could have - Won't have - [Part.3.A.conquering-difficulties(**战胜难点**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.A.conquering-difficulties.ipynb) - 困难幻觉:所有的难点,事实上都可以被拆解成更小的单元,而后在逐一突破的时候,就没那么难了。逐一突破全部完成之后,再拼起来重新审视的时候就会发现那所谓的难常常只不过是错觉、幻觉而已 - [Part.3.B.1.classes-1(**类 —— 面向对象编程**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.B.1.classes-1.ipynb) - 面向对象编程(Object Oriented Programming, OOP) - 对象,封装,抽象 - 界面,属性,方法 - 继承,类,子类,实例 - [Part.3.B.2.classes-2(**类 —— Python 的实现**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.B.2.classes-2.ipynb) - Defining Class - Inheritance - Overrides - Inspecting A Class - 1. help(object) - 2. dir(object) - 3. object.__dict__ - Encapsulation - [Part.3.B.3.decorator-iterator-generator(**函数工具**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.B.3.decorator-iterator-generator.ipynb) - 迭代器、生成器和装饰器,这些都是函数工具。有人把它们称为 DIG(Decorator,Iterator,Generator) - 迭代器(Iterator) iter()
javascript
class Counter(object):
def init(self, start, stop):
self.current = start
self.stop = stop
def iter(self):
return self
def next(self):
if self.current > self.stop:
raise StopIteration
else:
c = self.current
self.current += 1
return c
c = Counter(11, 20)
next(c)
next(c)
next(c)
for c in Counter(101, 105):
print(c, end=', ')
type(Counter)
```
- 装饰器(Decorator)
- https://wiki.python.org/moin/PythonDecoratorLibrary
- [Part.3.B.4.regex(**正则表达式**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.B.4.regex.ipynb)
- [Part.3.B.5.bnf-ebnf-pebnf(**BNF 以及 EBNF**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.B.5.bnf-ebnf-pebnf.ipynb)
- [Part.3.C.breaking-good-and-bad(**拆解**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.C.breaking-good-and-bad.ipynb)
- 纵向拆解
- 横向拆解
- 触类旁通
- [Part.3.D.indispensable-illusion(**刚需幻觉**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.D.indispensable-illusion.ipynb)
- 感觉总是最大的坑
- 你不会的东西,对你来说感觉上就不是刚需
- 对任何一项技能来说,刚需是自学的结果,而不是自学的原因
- 做个自驱动的人,而非被外部驱动的被动的人
- [Part.3.E.to-be-thorough(**全面 —— 自学的境界**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.E.to-be-thorough.ipynb)
- [Part.3.F.social-selfteaching(**自学者的社交**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.F.social-selfteaching.ipynb)
- 自学者的基本素养:学就学得全面,做就做得完整
- 要有完整的作品
- 带给你看个 Wikipedia 上的链接列表,在编程领域里,有无数可以借鉴到生活中的哲学、方法论:
- [If it ain't broke, don't fix it](https://en.wikipedia.org/wiki/If_it_ain%27t_broke,_don%27t_fix_it)
- [KISS principle](https://en.wikipedia.org/wiki/KISS_principle)
- [Don't repeat yourself](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
- [Feature creep](https://en.wikipedia.org/wiki/Feature_creep)
- [List of software development philosophies](https://en.wikipedia.org/wiki/List_of_software_development_philosophies)
- [Minimum viable product](https://en.wikipedia.org/wiki/Minimum_viable_product)
- [MoSCoW method](https://en.wikipedia.org/wiki/MoSCoW_method)
- [Overengineering](https://en.wikipedia.org/wiki/Overengineering)
- [Worse is better](https://en.wikipedia.org/wiki/Worse_is_better)
- [S.O.L.I.D.](https://en.wikipedia.org/wiki/SOLID)
- [Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy)
- [Part.3.G.the-golden-age-and-google(这是自学者的黄金时代)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.G.the-golden-age-and-google.ipynb)
- 疯狂安利 Google
- [Part.3.H.prevent-focus-drifting(**避免注意力漂移**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Part.3.H.prevent-focus-drifting.ipynb)
- 把 “全面完整” 放到最高优先级
- 自己的毛病 —— 做事不分轻重
- [Q.good-communiation(**如何成为优秀沟通者**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/Q.good-communiation.ipynb)
- 入门:
- 内容第一 (这也是做事分轻重的要求)
- 内容质量
- 重点突出
- 例证生动
- 消除歧义
- 内容组织:层层递进
- 进阶:输送价值观,你的价值观,就是你认为什么比什么更重要
- why not cheat? you hurt yourself
- 高级:“造化”,指的应该是一个人的 “融会贯通的能力” —— 有 “造化” 的人,不过是把大量其他领域里的技能、技巧、甚至手艺学来而后应用到自己的手艺之中
- 学无止尽
- [R.finale(**自学者的终点**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/R.finale.ipynb)
- 人生苦长,无需惊慌
- [S.whats-next(**下一步干什么?**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/S.whats-next.ipynb)
- [T-appendix.editor.vscode(**Visual Studio Code 的安装与配置**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/T-appendix.editor.vscode.ipynb)
- [T-appendix.git-introduction(**Git 简介**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/T-appendix.git-introduction.ipynb)
- [T-appendix.jupyter-installation-and-setup(**Jupyterlab 的安装与配置**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/T-appendix.jupyter-installation-and-setup.ipynb)
- [T-appendix.symbols(**这些符号都代表什么?**)](https://github.com/selfteaching/the-craft-of-selfteaching/blob/master/T-appendix.symbols.ipynb)