Skip to content

Commit 4413e25

Browse files
committed
add posts
1 parent db3ccfd commit 4413e25

File tree

30 files changed

+4069
-154
lines changed

30 files changed

+4069
-154
lines changed

content/posts/2025-09-11_english-for-programmers-01.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ Me: ???
6969
| `^` | caret |
7070
| `&` | ampersand |
7171
| `*` | asterisk |
72-
| `(` | bracket |
72+
| `(` | bracket / parentheses |
7373
| `~` | tilde |
7474
| `\|` | pipe |
7575
| `\` | backslash |
76+
| \` | backtick |
7677

7778
| Symbol | English |
7879
| :-: | :-: |
@@ -83,7 +84,7 @@ Me: ???
8384
| `;` | semicolon |
8485
| `<` | angle bracket |
8586
| `,` | comma |
86-
| `{` | curly bracket |
87+
| `{` | curly bracket / braces |
8788
| `[` | square bracket |
8889
| `_` | underscore |
8990
| `-` | hypen |
Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,125 @@
11
+++
22
date = '2025-09-12T8:00:00+08:00'
3-
draft = true
3+
draft = false
44
title = 'English for Programmers - 02'
55
tags = ['English']
66
+++
77

8+
# Unit2: Code Review & Testing
9+
this unit will cover:
10+
- Differentiate between various **testing strategies**
11+
- Write **professional guidelines**
12+
- Sound more natural and smooth when **asking questions**
13+
- Use colloquial language in speaking to **give and accept feedback**
14+
15+
## vocabulary - None Pharses 词汇: 名词短语
16+
Testing 测试是软件开发中的重要短语, 用于检查软件是否达到特定的标准和用户需求.
17+
18+
使用这些名词语句来证明英语名词的专业性:
19+
20+
| None | Desciption | Example |
21+
| :- | :- | :- |
22+
| time box | an allocated period of time for completing a task | - allcate a 2-hour time box for regression testing |
23+
| stress test | a method to assess a system's performance under heavy loads | - simulate 1000 users accessing the login page at the same time |
24+
| sanity check 健全性测试 | a quick check to verify that something is as expected | - are the units of the output value correct? |
25+
| ad hoc test 临时测试 | a test performed without predefined test cases or plans | - input unexpected characters into a search bar |
26+
| edge case | a problem that only happens in extreme situations | upload an empty, 0-byte file |
27+
28+
一些名词短语也可以当作动词使用:
29+
- Can you *sanity check* my email before I send it? I want to make sure there aren't any errors.
30+
- We have a lot to do today. Let's *time box* this meeting so we stay on sechedule.
31+
32+
> BE CAREFUL: sanity check vs ad hoc test
33+
> *sanity check*: similar to performing a review
34+
> *ad hoc test*: exploring issues using the tester's knowledge
35+
36+
- Yesterday, while doing **ad hoc test**, I came across some unexpected behaviour when I was randomly interacting with the system.
37+
- Hey, I made a few changes to the codebase. Can you do a quick **sanity check** before I start testing?
38+
39+
## Parallel Structure 平行结构
40+
Parallel structure: Using the same grammatical structure for two or more clauses in a sentence.
41+
42+
Example:
43+
"In our coding guidelines, we emphasise **writing** clear comments, **to follow** naming conventions, and **maintain** consistent indentation."
44+
45+
注意到上面的动词了吗? (mixed verb forms)
46+
**writing** = gerund form 动名词形式
47+
**to follow** = infinitive form 不定式形式
48+
**maintain** = base form
49+
50+
为了达到平行结构, 将动词修改为相同形式. 由于上面例子由 'emphasise' 开始, 将其改成 **-ing** 形式:
51+
In our coding guidelines, we emphasise **writing** clear comments, **following** naming conventions, and **maintaining** consistent indentation.
52+
53+
平行结构的好处:
54+
- more professional
55+
- more effective
56+
- easier to read and follow
57+
58+
You can apply this technique when writing:
59+
- documentation
60+
- code comments
61+
- best practices guidelines
62+
63+
64+
## Connected Speech 连贯的语言
65+
When we talk in everyday conversations, our words shouln't stand alone.
66+
67+
Instead, some sound, words and phrases are merged together in what's called connected speech.
68+
It's a natural *rhythm* and *flow* taht make conversations sound more smooth.
69+
70+
Let's take a closer look at three different techniques that your can use while asking questions:
71+
72+
- 同化 Assimilation
73+
将两个音素融合形成新音素.
74+
如"could you"中/d/与/j/融合发成/dʒ/, 形成"coujoo"的流畅发音. /d/ + /y/ = /dʒ/
75+
76+
- 省略 Reduction
77+
缩短或省略特定音素.
78+
如"who is"中/oʊ/和/ɪ/压缩为长元音/uː/, 读作"hooz"
79+
80+
- 连读 Linking
81+
将前词尾音与后词首音无缝连接,无停顿.
82+
如"how about"中/w/与/ə/自然衔接, 形成连贯语流.
83+
84+
85+
86+
## Code Review
87+
Tom: Hey Sophie!
88+
89+
Sophie: Hi! How are you?
90+
91+
Tom: All good, all good. So I've reviewed the changes that you made to the ETL pipeline. Overall, it looks great, but I've got a few points I'd like to **go over**.
92+
93+
Sophie: Sure ok, let me **pull it up**. Ok I'm ready, go ahead.
94+
95+
Tom: Fristly, in the data transformation phase, I noticed a nested loop structure that might impact performance when we go handle large datasets. Have you thought about optimising this bit?
96+
97+
Sophie: Yeah, I see what you mean. So, instead of a loop, what are you thinking?
98+
99+
Tom: I was thinking you could use a list comperhension for that part.
100+
101+
Sophie: Ok sure, let me go back and review it and I'll **give that a go**.
102+
103+
Tom: In terms of error handing, I noticed some areas where execptions aren't being caught properly. These are crucial since it means it's not going to crash the entire system.
104+
105+
Sophie: Ok good point. I'll **have a go at** adding some try-except blocks here and then I'll go over the error logging to make sure we've got details if there are any exceptions.
106+
107+
Tom: Sound good. On a positive note, I really like **how you refactored** the data loading module. It's much cleaner and easier to follow now.
108+
109+
Sophie: Oh yeah it was a bit of a mess to be honest so it did need a good **tidy up**. Any other points?
110+
111+
Tom: Nope I think that's everything, overall, it's **looking really solid**. I'll leave some comments on the code with everything that I've mentioned for improvement, but great work overall. Well done.
112+
113+
Sophie: Perfect. Thank you. Thanks for the feedback. I'll get started on those and then I'll let you know when it's good to go.
114+
115+
Tom: Alright. Thanks! Have a great day. Bye.
116+
117+
Sophie: Yep and you! Bye.
118+
119+
词汇解释
120+
- **go over**: discuss
121+
- **pull it up**: open the code on my scream
122+
- **have/give a go**: try
123+
- **how you reafactored**: the changes you made
124+
- **tidy up**: reorganizing
125+
- **looking really solid**: very well structured
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
+++
2+
date = '2025-09-15T8:00:00+08:00'
3+
draft = false
4+
title = 'Morden Javascript Tutorial - An Introduction'
5+
tags = ['JavaScript']
6+
+++
7+
8+
## An Introduction to JavaScript
9+
Let’s see what’s so special about JavaScript, what we can achieve with it, and what other technologies play well with it.
10+
11+
### Why is it call JavaScript?
12+
13+
JavaScript initially called "Live Script". But Java was popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.
14+
But as it evolved, JavaScript became a fully independent language with its won specification called [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), and now it has no relation to Java at all.
15+
16+
Today, JavaScript can execute on any device that has a special program called [the JavaScript engine](https://en.wikipedia.org/wiki/JavaScript_engine).
17+
The browser has an embedded engine called a "JavaScript virtual machine".
18+
19+
Different engines hav different "codenames":
20+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)): in Chrome, Opera and Edge
21+
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey): in Firefox
22+
23+
24+
### What can in-browser JavaScript do?
25+
Morden JavaScript is a "safe" programming language.
26+
It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it.
27+
28+
Node.js supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.
29+
In-browser JavaScript can do everything related to webpage manipulation, interaction with the user, and the webserver.
30+
31+
- Add new HTML to the page, change the content and modify styles
32+
- React to user actions like mouse clicks
33+
- Send network requests
34+
- Get and set cookies
35+
- Remember the data on the client-side
36+
37+
### What can't in-browser JavaScript do?
38+
For safety reasons, it can't:
39+
- Limited access to files.
40+
No access to OS functions.
41+
Require explicit permission with camera/microphone devices.
42+
43+
- Different tabs/windows generally do not know about each other.
44+
This is called "Same Origin Policy" (同源策略).
45+
46+
- Easilly communicate over the server where the current page came from.
47+
Its ability to receive data from other sites/domains is crippled.
48+
It requires explicit agreement from the remote side.
49+
50+
Such limitations do not exist if JavaScript is used outside of the browser, for example on a server.
51+
52+
53+
### What makes JavaScript unique?
54+
- Full integration with HTML/CSS
55+
- Simple things are done simply
56+
- Supported by all major browsers and enabled by default
57+
58+
JavaScript is the only browser technology that combines these three things.
59+
60+
61+
### Languages "over" JavaScript
62+
The syntax of JavaScript not suit everyone's needs. Recently a plethora of new languages appered, which are transpiled to JavaScript before they run in the browser.
63+
64+
- [CoffeeScript](https://coffeescript.org/) is "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Ruby devs like it.
65+
- [TypeScript](https://www.typescriptlang.org/) is concentrated on add "strict data typing" to simplify the development and support of complex systems. It's developed by Microsoft.
66+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
67+
- [Dart](https://www.dartlang.org/) is a standalone languages that has its own engine that runs in non-browser environments, but also can transpiled to JavaScript. Developed by Google.
68+
- [Brython] is a Python transpiler to JavaScript but enables the writing of applications in pure Python without JavaScript.
69+
- [Kotlin] is a modern, concise and safe programming language that target the browser or Node. Developed by JetBrains.
70+
71+
## Manuals and Specifications
72+
73+
### Specification
74+
[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) contains the most in-depth, detailed and formalized information about JavaScript.
75+
76+
A new specification version is released every year. Between these releases, the latest specification draft is at [https://tc39.es/ecma262/](https://tc39.es/ecma262/).
77+
78+
To read about new bleeding-edge features, including those that are “almost standard” (so-called “stage 3”), see proposals at [https://github.com/tc39/proposals](https://github.com/tc39/proposals).
79+
80+
### Manuals
81+
[MDN (Mozillz) JavaScript Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference) is the main manual with examples and other information.
82+
It's great to get in-depth information about individual language functions, methods etc.
83+
84+
### Compatibility tables
85+
JavaScript is a developing language, new features get added regularly.
86+
87+
To see their support among browser-based and other engines, see:
88+
89+
- [https://caniuse.com](https://caniuse.com) – per-feature tables of support, e.g. to see which engines support modern cryptography functions: [https://caniuse.com/#feat=cryptography](https://caniuse.com/#feat=cryptography).
90+
- [https://kangax.github.io/compat-table](https://kangax.github.io/compat-table) – a table with language features and engines that support those or don’t support.

0 commit comments

Comments
 (0)