|
| 1 | ++++ |
| 2 | +date = '2025-09-11T8:00:00+08:00' |
| 3 | +draft = false |
| 4 | +title = 'English for Programmers - 01' |
| 5 | +tags = ['English'] |
| 6 | ++++ |
| 7 | + |
| 8 | +# Unit 1. Implementing Code |
| 9 | +This unit will cover: |
| 10 | +- Use technical verbs to **accurately define tasks** and actoins |
| 11 | +- Write **commit messages** in the corret Git format |
| 12 | +- Confidently **name** the **symbols** used when writing code |
| 13 | +- Understand **vocabulary** for **syntax** and programming rule |
| 14 | + |
| 15 | +## vocaluary - action verbs 动词词汇 |
| 16 | +He **optimised** the queries to improve the response time. |
| 17 | +- **optimised**: 提高 (improved) |
| 18 | + |
| 19 | +Can you **implement** the new feature we discussed yesterday? |
| 20 | +- **implement**: 实现 (put int action) |
| 21 | + |
| 22 | +The team will **integrate** a third-party API to get real-time data. |
| 23 | +- **intergrate**: 整合 (combine) |
| 24 | + |
| 25 | +As our user base grows, we'll need to **scale** our infrastructure. |
| 26 | +- **scale**: 扩展 (increase capacity) |
| 27 | + |
| 28 | +Have you had a chance to **refactor** the code yet? |
| 29 | +- **refactor**: 重构 (change) |
| 30 | + |
| 31 | +The process it taking too long. How can we **streamline** it? |
| 32 | +- **straemline**: 简化 (simplify) |
| 33 | + |
| 34 | +Let's **execute** the script before we go for lunch. |
| 35 | +- **execute**: 执行 (run) |
| 36 | + |
| 37 | +The settings haven't been **configured** yet. |
| 38 | +- **configured**: 配置 (set up) |
| 39 | + |
| 40 | +> Note: optimise spelling |
| 41 | +> British English '-ise' vs. Amercian English '-ize' |
| 42 | +
|
| 43 | +## grammar - imperative present tense 语法: 祈使现在时 |
| 44 | +- Imperative 祈使语气: 用来下达命令、发出请求、给予指示或建议的语气. 核心功能是告诉某人做某事. |
| 45 | +- Present Tense 现在时: 这里的"现在时"并不是指描述现在正在发生的动作, 而是指这个动词形式 |
| 46 | + |
| 47 | +For readability and consistency in commit messages within a team, Git recommends using the **Impreative Present Tense**. |
| 48 | +Git 建议使用祈使命令式编写提交信息, 编写时将其看成给版本控制和其他开发者看的命令. |
| 49 | + |
| 50 | +> Tip: message 应该描述这个修改将实现的功能, 而不是已经编写的功能. |
| 51 | +> 下面是一个例子: |
| 52 | +
|
| 53 | +| Recommended | Not Recommended | |
| 54 | +| :-: | :-: | |
| 55 | +| Add new feature for user authentication. Resolve issue with data validation | Added a new feature for user authentication. Resolved the issue with data validation | |
| 56 | + |
| 57 | +> 当编写 imperative 句子的时候, 可以省略 a/an/the |
| 58 | +
|
| 59 | +### Keyboard Symbols 键盘符号 |
| 60 | +想象一下, 你在一个团队中合作, 当他们查看你的代码并给予建议的时候, 某人说: |
| 61 | +"Can you try replacing the **asterisk** with an **ampersand** and adding a **tilde** after the **pipe**?" |
| 62 | + |
| 63 | +Me: ??? |
| 64 | + |
| 65 | +| Symbol | English | |
| 66 | +| :-: | :-: | |
| 67 | +| `!` | exlamation mark | |
| 68 | +| `#` | hash | |
| 69 | +| `^` | caret | |
| 70 | +| `&` | ampersand | |
| 71 | +| `*` | asterisk | |
| 72 | +| `(` | bracket | |
| 73 | +| `~` | tilde | |
| 74 | +| `\|` | pipe | |
| 75 | +| `\` | backslash | |
| 76 | + |
| 77 | +| Symbol | English | |
| 78 | +| :-: | :-: | |
| 79 | +| `"` | double quote | |
| 80 | +| `'` | single quote | |
| 81 | +| `/` | forward slash | |
| 82 | +| `:` | colon | |
| 83 | +| `;` | semicolon | |
| 84 | +| `<` | angle bracket | |
| 85 | +| `,` | comma | |
| 86 | +| `{` | curly bracket | |
| 87 | +| `[` | square bracket | |
| 88 | +| `_` | underscore | |
| 89 | +| `-` | hypen | |
| 90 | + |
| 91 | +1. *Kebab case* is a naming convention where all letters are lowercase and words are sperated by **hypen**. |
| 92 | + e.g. `my-variable` |
| 93 | + |
| 94 | +2. *Sanke case* is a naming convention where all letters are lowercase and words are separated by **underscore**. |
| 95 | + e.g. `my_variable` |
| 96 | + |
| 97 | +3. Many programming languages ues **single qoutes** or **double qoutes** to denote strings. |
| 98 | + e.g. `"my variable"` |
| 99 | + |
| 100 | +4. HTML tags are enclosed in **angle brackets**. |
| 101 | + e.g. `<div>` |
| 102 | + |
| 103 | +| 常见命名风格 | 形式示例 | 常见场景 | 特点 / 备注 | |
| 104 | +| :-: | :-: | :-: | :-: | |
| 105 | +| **camelCase 驼峰式** | `userProfile` | JavaScript 变量、函数名; Java、C# 方法名 | 首字母小写,后续单词首字母大写 | |
| 106 | +| **PascalCase 大驼峰** | `UserProfile` | 类名(Java、C#、TypeScript)、组件名(React) | 每个单词首字母大写 | |
| 107 | +| **snake\_case 蛇形命名** | `user_profile` | Python 变量/函数名; 数据库字段 | 单词用 `_` 分隔, 全小写 | |
| 108 | +| **SCREAMING\_SNAKE\_CASE 全大写蛇形** | `MAX_VALUE` | 常量(C、Python、Java) | 全大写 + 下划线 | |
| 109 | +| **kebab-case 烤肉串式** | `user-profile` | URL、CSS 属性、CSS 类名、配置项、文件名 | 单词用 `-` 分隔, 全小写. 不能当变量名(`-` 被视为减号) | |
| 110 | +| **Train-Case 标题式 / Header-Case** | `User-Profile` | 文档标题、部分配置(HTTP Header: `Content-Type`) | 类似 PascalCase, 但用 `-` 分隔 | |
| 111 | +| **dot.case** | `user.profile` | 部分配置文件、键路径(MongoDB、Elasticsearch) | 用 `.` 分隔单词 | |
| 112 | +| **Space Case** | `User Profile` | UI 文本、自然语言 | 单词直接空格分隔(不用于代码)| |
0 commit comments