Object-C为什么使用.m作为源码的扩展名?
2013-05-17 16:47
645 查看
在百度中苦苦搜寻无果之后,转而把希望寄托到了google,第一条结果就是我想要的答案:
activeoldestvotes
Why
do Objective C files use the .m extension?
up vote53down votefavorite 7 | Since I started learning Objective C and Cocoa, I've been wondering why they have chosen the extension .m for the implementation files - was it supposed to mean something, or was it just a random letter? Does anyone know? I couldn't find such information anywhere on Google... objective-c file-extension
| ||||
|
4 Answers
activeoldestvotesup vote119down voteaccepted | Today most people would refer to them as "method files", but "The .m extension originally stood for "*m*essages" when Objective-C was first introduced, referring to a central feature of Objective-C [...]" (from the book "Learn Objective-C on the Mac" by Mark Dalrymple and Scott Knaster, page 9) EDIT: To satisfy an itch I emailed Brad Cox, the inventor of Objective-C, about the question and he answered with this single line: "Because .o and .c were taken. Simple as that." Here's the email as visual prove:
| ||||||||||||||
|
up vote6down vote | From the first Google result (Wikipedia entry) for "objective c" file extension: The interface only declares the class interface and not the methods themselves; the actual code is written in the implementation. Implementation (method) files normally have the file extension .m.
| ||
up vote2down vote | .m files contain the (m)ethods. Possible reason?
| ||
up vote2down vote | It stands for "methods". From the comp.lang.objective-C FAQ: The organisation of Objective-C source is typically similar to that of C or C++ source code, with declarations and object interfaces going into header files named with a .h extension, and definitions and object implementations going in files named with a .m (short for methods) extension.
|
相关文章推荐
- ASP.NET2.0使用Enter Key作为默认提交问题分析(附源码)
- 为什么dubbo使用ZkClient作为zookeeper的客户端
- 显示对象列表-为什么要使用list_detail.object_list(...)视图函数
- MongoDB使用ObjectId作为_id字段值,简述ObjectId构造
- [Flex]为什么国内的公司都不敢使用Flex作为产品的平台与主要开发语言
- WPF之Binding基础九 使用ObjectDataProvider作为Binding的源
- MQTT---HiveMQ源码详解(外传)为什么使用Xodus
- JAVA源码分析之---Object类(一)---registerNatives,getClass方法的使用
- 为什么Handler在主线程中不需要使用Looper.prepare()和loop()方法?看源码!
- 作为Web开发人员 我为什么喜欢 Chrome(或chrome 开发工具使用)
- 为什么国内的公司都不敢使用Flex作为产品的平台与主要开发语言
- 为什么我们使用192.168.0.1作为内网ip
- 为什么要使用CMake+VS编译OpenCV的源码
- 为什么 Vim 使用 HJKL 键作为方向键
- 为什么 Vim 使用 HJKL 键作为方向键
- WPF使用 ObjectDataProvider 为方法作为绑定数据源
- [Flex]为什么国内的公司都不敢使用Flex作为产品的平台与主要开发语言
- 为什么JDK源码中,无限循环大多使用for(;;)而不是while(true)?
- 为什么不能使用成员变量的值作为成员函数的默认参数?