the way of program--How to Think Like a computer
笔记:
第一章 the way of the program
什么是程序?
一系列的指令,会指定如何执行计算。
最基本的instructions:
- input
- output
- math: Perform basic mathematical operations
- conditional execution
- repetition。循环
natural languages and Formal
自然语言就是平时说的语言。正式语言则是被用来完成某些系统应用的语言,例如化学公式的语言。
而程序语言就是用来表示计算而设计出来的语言。
它有strict syntax rules: 有tokens和结构两类。
- token:最基本的语言,如word, numbers。
- structure: 用来让token组合起来。
自然语言和正式语言的区别:
- ambiguity:歧义,多意。 自然语言是多义的,有歧义的。
- redundancy:冗余的。 正式语言是简明的。
- literalness: 字面意思。 自然语言内含较多,比如谚语,成语,正式语言的意思就是字面上的意思。
自然语言和正式语言的区别就好像是诗歌和论文。
浙公网安备 33010602011771号