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)
版权声明: 本文为 InfoQ 作者【codists】的原创文章。
原文链接:【http://xie.infoq.cn/article/d0eec03676a258461dcd08117】。未经作者许可,禁止转载。
评论