Cocoa的编码规范

Introduction to Coding Guidelines for Cocoa

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html#//apple_ref/doc/uid/10000146-SW1

Developing a Cocoa framework, plug-in, or other executable with a public API requires some approaches and conventions that are different from those used in application development. The primary clients of your product are developers, and it is important that they are not mystified by your programmatic interface. This is where API naming conventions come in handy, for they help you to make your interfaces consistent and clear. There are also programming techniques that are special to—or of greater importance with—frameworks, such as versioning, binary compatibility, error-handling, and memory management. This topic includes information on both Cocoa naming conventions and recommended programming practices for frameworks.

Organization of This Document

The articles contained in this topic fall into two general types. The first and larger group presents naming conventions for programmatic interfaces. These are the same conventions (with some minor exceptions) that Apple uses for its own Cocoa frameworks. These articles on naming conventions include the following:

The second group (currently with a membership of one) discusses aspects of framework programming:


Cocoa的编程规范介绍

开发一个Cocoa framework,插件,或者利用公共API编写的其他的可执行程序,需要一些approaches和一些不同于应用开发的规范。这些规范主要是用于产品开发者,这些的接口规范需要很清晰,以免他们会感到迷惑。这就是这篇文档想要做的事情,它能帮助你来让你的接口保持一致和清晰。也有许多编程技术对于框架的开发具有特殊性和重要性,比如版本管理,二进制兼容性,错误处理以及内存管理等。这篇文章包含了Cocoa命名规范和推荐框架编程实践两方面的内容。

这篇文章的组织结构

这篇文章包含了包含了两个普通类型的内容。第一部分是也是最大的篇幅来介绍编程接口的命名规范。苹果自己也在使用这些规范来编写Cocoa的框架。命名规范包含一下几篇文章:
     “ 代码命名基础”
     “函数命名”
     “方法命名”
      “属性和数据类型命名”
      “可接受的缩略词缩写”
第二部分会讨论框架编程部分
     “框架开发者的开发注意事项以及相关技术”
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值