-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
any
committed
Oct 30, 2024
1 parent
06d4612
commit 599b0c4
Showing
10 changed files
with
175 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
# 语法部分 | ||
|
||
- 《javascript 权威指南》是最好的一本参考书 | ||
- 本书只讲关键点,不求全 | ||
|
||
## 目录 | ||
|
||
- [声明](./declaration) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 声明 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 基本的组织元素 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,99 @@ | ||
# 语言的结构 | ||
# 语言的结构化 | ||
|
||
程序 = 数据结构+算法 | ||
|
||
## 概述 | ||
|
||
计算机语言的分类 | ||
|
||
| 用途分类 | 语言分类 | 子分类 | 语言列举 | | ||
| -------- | -------- | --------- | ------------------------- | | ||
| 程序设计 | 说明式 | 函数式 | LISP/Scheme/ML/Haskell | | ||
| 程序设计 | 说明式 | 数据流式 | Id/Val | | ||
| 程序设计 | 说明式 | 逻辑式 | Prolog/VisiCalc | | ||
| 程序设计 | 命令式 | 冯·诺依曼 | Fortran/Pascal/Basic/C | | ||
| 程序设计 | 命令式 | 面向对象 | Smalltalk/Eiffel/C++/Java | | ||
| 数据设计 | 标记式 | | HTML/XML | | ||
| 数据设计 | 交换式 | | JSON | | ||
| 模型设计 | 建模 | | UML | | ||
|
||
javaScript 兼顾说明式和命令式,是多范式语言。 | ||
|
||
所谓结构: | ||
|
||
- 控制结构 | ||
- 顺序 | ||
- 分支 | ||
- 循环 | ||
- 组织结构 | ||
- 表达式 | ||
- 语句行 | ||
- 语句块 | ||
- 过程 | ||
- 单元 | ||
- 包 | ||
- 数据结构:数据的表现形式 | ||
- 基本数据结构 | ||
- 复合数据结构 | ||
|
||
## 命令式语言 | ||
|
||
命令式语言的实质是面向存储的编程,即通过运算去改变内存。所以这类语言更关注存储的方式。 | ||
|
||
命令式语言的发展,与冯·诺依曼计算机体系存在直接关系: | ||
|
||
- 冯·诺依曼计算机系统以"存储"和"处理"为核心 | ||
- 命令式编程语言将"存储"抽象为"内存",将"处理"抽象为"运算" | ||
- 软件程序与硬件系统,在本质上存在紧密联系 | ||
|
||
intel 计算机系统在"数据结构"上的简单抽象 | ||
|
||
| 自然语义 | 机器系统 | 编程系统 | 语言/类型系统 | | ||
| ---------------- | ----------------- | ---------------------- | ----------------------- | | ||
| 基本数据单元 | 8/16/32/64 位系统 | 位/字节/字/双字/... | bit/byte/word/dword/... | | ||
| 连续数据块 | 连续存储块 | 数组/字符串/结构体/... | array/string/struct/... | | ||
| 有关系的数据片段 | 存储地址 | 指针/结构/引用/... | pointer/tree/... | | ||
|
||
## 面向对象语言 | ||
|
||
面向对象相比较命令式语言,解决了三个问题: | ||
|
||
- 不必关心数据结构中的细节 | ||
- 保证了算法结构的通用性 | ||
- 表现力更强 | ||
|
||
可见性设定 | ||
|
||
| 可见性 | 含义 | 说明 | | ||
| ------------------ | -------------------------------- | ---- | | ||
| published | 已发布。面向特殊系统的,比如 IDE | | | ||
| public | 公开,不限制访问的 | | | ||
| protected internal | 内部保护 | | | ||
| protected | 保护,访问限于此程序 | | | ||
| internal | 内部 | | | ||
| private | 私有 | | | ||
|
||
接口是更高的抽象: | ||
|
||
- 封装:提供能力 | ||
- 使用:不关注能力的来源和获取方法。 | ||
|
||
面向接口编程的理解: | ||
|
||
- 数据:对象封装了数据提以及数据的存储逻辑 | ||
- 行为:对象对外展现了可以对数据进行的运算与运算逻辑 | ||
- 关系:交互关系 | ||
|
||
面向接口编程是面向对象编程不可或缺的一部分。ECMAScript 规范为将来的语言特征保留了这些关键字:interface、implements | ||
|
||
## 语言的分类 | ||
|
||
TODO | ||
|
||
## 语源 | ||
|
||
TODO | ||
|
||
## 历史遗产 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 组织形式分块的方法 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 层次结构程序设计 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 语句与代码分块 | ||
|
||
TODO |