Unit 1. Implementing Code

This unit will cover:

vocaluary - action verbs 动词词汇

He optimised the queries to improve the response time.

Can you implement the new feature we discussed yesterday?

The team will integrate a third-party API to get real-time data.

As our user base grows, we’ll need to scale our infrastructure.

Have you had a chance to refactor the code yet?

The process it taking too long. How can we streamline it?

Let’s execute the script before we go for lunch.

The settings haven’t been configured yet.

Note: optimise spelling
British English ‘-ise’ vs. Amercian English ‘-ize’

grammar - imperative present tense 语法: 祈使现在时

For readability and consistency in commit messages within a team, Git recommends using the Impreative Present Tense.
Git 建议使用祈使命令式编写提交信息, 编写时将其看成给版本控制和其他开发者看的命令.

Tip: message 应该描述这个修改将实现的功能, 而不是已经编写的功能.
下面是一个例子:

RecommendedNot Recommended
Add new feature for user authentication. Resolve issue with data validationAdded a new feature for user authentication. Resolved the issue with data validation

当编写 imperative 句子的时候, 可以省略 a/an/the

Keyboard Symbols 键盘符号

想象一下, 你在一个团队中合作, 当他们查看你的代码并给予建议的时候, 某人说:
“Can you try replacing the asterisk with an ampersand and adding a tilde after the pipe?”

Me: ???

SymbolEnglish
!exlamation mark
#hash
^caret
&ampersand
*asterisk
(bracket / parentheses
~tilde
|pipe
\backslash
`backtick
SymbolEnglish
"double quote
'single quote
/forward slash
:colon
;semicolon
<angle bracket
,comma
{curly bracket / braces
[square bracket
_underscore
-hypen
  1. Kebab case is a naming convention where all letters are lowercase and words are sperated by hypen.
    e.g. my-variable

  2. Sanke case is a naming convention where all letters are lowercase and words are separated by underscore.
    e.g. my_variable

  3. Many programming languages ues single qoutes or double qoutes to denote strings.
    e.g. "my variable"

  4. HTML tags are enclosed in angle brackets.
    e.g. <div>

常见命名风格形式示例常见场景特点 / 备注
camelCase 驼峰式userProfileJavaScript 变量、函数名; Java、C# 方法名首字母小写,后续单词首字母大写
PascalCase 大驼峰UserProfile类名(Java、C#、TypeScript)、组件名(React)每个单词首字母大写
snake_case 蛇形命名user_profilePython 变量/函数名; 数据库字段单词用 _ 分隔, 全小写
SCREAMING_SNAKE_CASE 全大写蛇形MAX_VALUE常量(C、Python、Java)全大写 + 下划线
kebab-case 烤肉串式user-profileURL、CSS 属性、CSS 类名、配置项、文件名单词用 - 分隔, 全小写. 不能当变量名(- 被视为减号)
Train-Case 标题式 / Header-CaseUser-Profile文档标题、部分配置(HTTP Header: Content-Type)类似 PascalCase, 但用 - 分隔
dot.caseuser.profile部分配置文件、键路径(MongoDB、Elasticsearch). 分隔单词
Space CaseUser ProfileUI 文本、自然语言单词直接空格分隔(不用于代码)

listening syntax

你的朋友正在为你介绍一门新语言的语法 syntax (rule defining the structure of the symbols, punctuation and words of a programming language)

音频在这里

文本如下

PLAINTEXT
Let me explain the syntax of my programming language.

So firstly, variable names aren't case sensitive and only contain alphanumberic characters.
Secondly, comments can be denoted using an ampersand at the beginning.
Thirdly, indentation is not mandatory but it is encouraged for readability.
Fourthly, function names must start with a verb and be descriptive of purpose.
And finally then, mathematical symbols are not allowed to be used.
Click to expand and view more

词汇:

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut