Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

接上: attach vs. connect #65

Open
twy30 opened this issue Oct 1, 2020 · 3 comments
Open

接上: attach vs. connect #65

twy30 opened this issue Oct 1, 2020 · 3 comments

Comments

@twy30
Copy link
Contributor

twy30 commented Oct 1, 2020

https://www.facebook.com/m4n14c.tw/posts/3362914743775576

我覺得 detach 和 disconnect 算好分
可以看 attach 和 connect 配什麼字
這兩種差蠻多的

@remorsecs
Copy link

remorsecs commented Oct 1, 2020

經驗上來說
connect 用在 network, database
attach 用在 file, document (attachment)
或是某個 Linux/BSD 軟體 Screen (https://www.gnu.org/software/screen/screen.html)
可以在一個 terminal 上面啟動多個 session,"連上" 其中一個 session 時主要用字是 attach
https://www.gnu.org/software/screen/manual/html_node/Invoking-Screen.html

字典
https://www.ldoceonline.com/dictionary/attach
https://www.ldoceonline.com/dictionary/connect

attach

  1. to fasten or connect one object to another
  2. to connect a document or file to an email so that you can send them together (附件)
  3. the attached form/cheque/leaflet etc

connect

  1. to join two or more things together
  2. to join something to the main supply of electricity, gas, or water, or to a telephone or computer network

(看了覺得 join 似乎也可以參戰 XD)

感覺上,connect 會跟 "線" 有關聯
例如:

  1. to join something to the main supply of electricity, gas, or water, or to a telephone or computer network
    電線、天然氣管線、水管、電話線、網路線...

然後 attach 比較用在 "文件" 類型的

  1. the attached form/cheque/leaflet etc

@twy30
Copy link
Contributor Author

twy30 commented Oct 1, 2020

@remorsecs

感覺上,connect 會跟 "線" 有關聯

同意,我之前在整理 "detach vs. disconnect" 時也歸納出同樣的結論。

  • 如果連接兩個東西的是「連接物」,尤其是「管、線」,會用 connect/disconnect 。
  • 如果連接兩個東西的是「連接點」,會用 attach/detach 。

@aqzhyi
Copy link

aqzhyi commented Oct 17, 2020

提供參考 前端工程中的熱門 library:redux 的 connect 函式

The connect() function connects a React component to a Redux store.

這個 connect 函式能夠將「介面組件」連接到一個「中心化的 state 物件」

當「中心化的 state 物件」狀態改變時,會連動通知「介面組件」作相關的商業邏輯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants