Programming abstractions in C閱讀筆記:p107-p110
《Programming Abstractions In C》學習第46天,p107-p110,3.1小節——“The concept of interface”,總結如下:
一、技術總結
1.client
p108,調用library的program稱為client。
2.interface
p108,"To do so, the chapter focuses on the boundary between a library and its clients, which is called interface."。
p108,“In English, the word interface means a common boundry between two distinct entities.”

在C語言中,interface就是一個的“xxx.h”文件,如stdio.h。
3.package
p109,"If you are assigned to develop a libray, part of your job consists of producing a .h file to serve as the library interface and a corresponding .c file that provides the underlying implementation. Those file constitute the package."根據這句話,.a 和 .h和在一起稱為package。示例:stdio就是一個package。
4.approach
p110,“The two libraries embody different approaches...”。根據該句,approach指的就是函數,例如:getchar()。
二、英語總結
1."Interfaces are central to a modern treatement of libraries,"一句中treatement什么意思?
答:treatment:n. the way you deal with or behave towards to sb or sth.(對待,處理),“treatment of sth”意為“對sth的處理”,注意介詞用的是of。
2.counterpart什么意思?
答:counter(詞根contra,"facing, opposite") + part(詞根partie,“copy of a person or thing”)。counterpart的意思是“n. a person or thing that has the same purpose as another one”(相對應的東西)。作為對比,opposite含有“相反”之意,corresponding是形容詞。
3.an amount of /amounts of語法
答:單獨的使用an mount of/amounts of指表示數量,未表面數量的多少,所以,amount前面經常放置用于修飾數量的形容詞,例如:enormous,large,regular等。
4.the designer of an interface must exercise special care to get it right一句中exercise什么意思?
答:vt. use sth。所以exerciese care 等同于use caution 或者be careful。
三、參考資料
1.編程
1)Eric S.Roberts,《Programming Abstractions in C》:https://book.douban.com/subject/2003414
2.英語
1)Etymology Dictionary:https://www.etymonline.com
2)Cambridage Dictionary:https://dictionary.cambridge.org
歡迎搜索及關注:編程人(a_codists)
浙公網安備 33010602011771號