Object-C为什么使用.m作为源码的扩展名?
来源:互联网 发布:北京阿里云备案拍照 编辑:程序博客网 时间:2024/05/16 03:39
在百度中苦苦搜寻无果之后,转而把希望寄托到了google,第一条结果就是我想要的答案:
Why do Objective C files use the .m extension?
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...
4 Answers
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:
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.
.m files contain the (m)ethods. Possible reason?
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.
- Object-C为什么使用.m作为源码的扩展名?
- Hello Object-C.m
- Posing 作为Object C语法的特性之一
- 作为Object C语法的特性之一Posing
- matlab脚本文件的扩展名由M改为m
- object-c @property 的使用
- object-c @property 的使用
- Object-C 的block使用
- object-c @property 的使用
- object-c ARC的使用
- Object-c-数组的使用
- Object-c KVC的使用
- 为什么hash作为内存使用的经典数据结构?
- 关于如何使用VS高亮显示无扩展名源码文件的一个小技巧
- 关于如何使用VS高亮显示无扩展名源码文件的一个小技巧
- 使用xmemcached作为客户端,存储大于1M的数据时,发生的问题。
- (object-c)属性的使用
- Object C中分类的使用
- java--时间浅谈
- AddData(添加数据)对话框的实现与扩展(C#)
- 音视频收集
- Spring中Quartz的配置
- haskell(21)
- Object-C为什么使用.m作为源码的扩展名?
- linux系统编程之信号(一):信号基本概述
- OpenSessionInView详解
- 在岁月中修养自己
- Excel 添加复选框
- grails遇到的一些问题
- compare array between shell and tcl
- bit 1088
- 【练习03】 KMP 1001 Number Sequence