我好惭愧!

every 2003-02-27 05:07:58
今天才知道什么所谓的只能意会不能言明?我今天试着译一段c规范,泛泛一读好像明白,可是真的一句一句译的时候我自己什么也不明白了?
希望大家能指出我不对的帮我更正下!谢谢!
////////////////////////////////////////////////////////////////////////
As said previously, no variable shared between several modules.
当做先前说, 没有变量在一些模块之间分享。
Rule 16 A local variable to a module is prefixed by the mnemonic of the module, for example:
SVAUD_SourceNumber.
对一个模块的一个局部变量被模块的标志前缀, 举例来说:SVAUD_SourceNumber。
Rule 17 A local variable to a file is not prefixed by the mnemonic of the module, for example:
AudioSourceNumber.
对一个文件的一个区域变量不被模块的标志前缀, 举例来:AudioSourceNumber。
Rule 18 The variable names are in lower case, and each word begins with an upper case, for
example: MyVariable.
变量的名字是小写字母中,而且每个字母开始一个为大写,例子: MyVariable。
Rule 19 The only underscore allowed in a variable name is the one separating the prefix from the
variable name.
唯一的下划线变量命名中允许是一个分开前缀从那变量命名。
Rec. 20 Avoid single letter variables, since they are not meaningful (even if they are used for loop
index).
避免单一文字变量, 既然他们(即使他们作为 loop 索引)命名 ????.
Rule 21 Prefix variables in order to determine their type and their size.
前缀变量为了要决定他们的类型和他们的长短。

7页

2.6 Procedures & Functions
程序与函数
There are three kind sof procedure/function: 有三个类型 sof 程序/函数:
o Those which are local to a file 那些是局部文件
o Those which are private to a module 那些是私有模块
o Those which are exported 那些被输出
Rule 22 An exported procedure/function is prefixed by the module mnemonic, for example
SVAUD_Start.
一个被输出的程序/ 函数被模块标记的前缀,举例来说
SVAUD_Start
Rule 23 A local procedure/function to a module is prefixed by the module mnemonic + i, for example SVAUDi_LevelRead.
对一个模块的一个局部程序/函数被模块标志性的前缀 +i,举例来说 SVAUDi_LevelRead
Rule 24 A local procedure/function to a file is not prefixed.
对一个文件的一个本地程序/函数不用前缀。
Rule 25 The only underscore allowed in a procedure/function name is the one separating the prefix from the function name.
唯一的下划线的在一个程序/函数命名中允许是一个分开来自功能名字的前缀。
Rule 26 Procedure names should reflect what they do. Procedure often acts on objects, and its
name is built as following: ObjectAction. First is the Object and after the Action performed
on the object. For example SVAUD_ConfigSet().
程序名字应该反映他们做的事情。 程序时常对有所反应物件, 和它的
命名依下列各项被建造: ObjectAction。 第一是物件,而且在行动运行之后
在物件上。 举例来说 SVAUD_ConfigSet.()
Rule 27 Function names should reflect what they return. Functions are used in expressions, often in things like if's, so they need to read appropriately. For example:
函数的命名应该反映他们返回的事情。 函数在展示语句中被用, 时常在事物中像如果,因此他们需要适当的读。 举例来说:
if ( SizeCheck( x ) )
is unhelpful since we can not determine whether SizeCheck() returns true on error or nonerror.
Instead:
我们不能决定是否 SizeCheck() 返回真或假。我们应该改成
if ( SizeIsValid( x ) )
makes the point clear and makes a future mistake in routine usage less likely.
指点清楚对以后修改可以减少很多错误。
Rule 28 In order to obtain homogeneous software, please use preferentially the following names
(This list can be extended):
为了使有相同的软件标准,请使用相同的命名。如下列表:

第8页
Init / Terminate 开始/终止
Open / Close 打开/关闭
Connect / Disconnect 连接/断开
Create / Delete 创建/删除
Send / Receive 发送/接受
Wait / Release
Allocate / Free
Get / Set
Add / Remove / Insert
Enter / Exit
Stop / Start / Freeze / Resume
Lock / Unlock
Select / Unselect
Show / Hide
2.7 Defines
Rule 29 A define which is exported (included in an interface file) begins with the module mnemonic. (ex: SVAUD_kChannelNumber)
定义一个输出 (库的接口文件) 由开始模块标记。.
Rule 30 All the defines are prefixed by k, for example kChannelNumber.
所有的那定义都以k为前缀,举例来说 kChannelNumber。
Rule 31 In order to obtain homogeneous software, please use preferentially the following names.
First / Last / Next / Previous
New / Old
On / Off
Min / Max
Source / Destination / Input / Output
Left / Right
Yes / No
为了要获得相同的软件标准的,先请使用下面的命名。
2.8 Macros
Even if the macros are declared using the define key word, they follow a specific naming convention.
即使宏被宣布使用关键子,他们依照一种详细命名规范。
Rule 32 A macro is always prefixed by m, for example mMyMacro.
一个宏总是以m前缀,举例来说 mMyMacro。
Rule 33 Macros follow the same rules as the functions.
宏与函数有相同的规范。
...全文
56 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangxjlb 2003-02-28
  • 打赏
  • 举报
回复
慢慢来。
商海连横 2003-02-28
  • 打赏
  • 举报
回复
mark!
danmao 2003-02-28
  • 打赏
  • 举报
回复
汗……,呵呵。

Efeis(Efeis) 厉害。
Efeis 2003-02-28
  • 打赏
  • 举报
回复
有一句忘记翻译了
====================
Rule 25 The only underscore allowed in a procedure/function name is the one separating the prefix from the function name.
规则 25 在过程/函数名中,只有在分开函数名的前缀时允许用下划线。
Efeis 2003-02-28
  • 打赏
  • 举报
回复
Rec. 20 Avoid single letter variables, since they are not meaningful (even if they are used for loop
index).
避免单字母变量, 因为他们不能表示什么意思(即使他们用作循环索引)

2.6 Procedures & Functions 过程与函数
There are three kind sof procedure/function: 有三种类型的过程/函数:
o Those which are local to a file 属于本文档的
o Those which are private to a module 属于模块私有的
o Those which are exported 外部的

Rule 25 The only underscore allowed in a procedure/function name is the one separating the prefix from the function name.
只有在程序/函数名用一个下划线分开函数名字的前缀。

Rule 26 Procedure names should reflect what they do. Procedure often acts on objects, and its name is built as following: ObjectAction. First is the Object and after the Action performed on the object. For example SVAUD_ConfigSet().
规则 26 过程名应该反映他们的做什么(功能)。 过程通常基于对象, 它的命名如下: ObjectAction。 前面是对象,后面是对象做的执行动作。例如 SVAUD_ConfigSet()

========================
不知道翻译得准不准确。
其实,编程的人不需要这样翻译,程序员都是看原版英文的。真正的程序员不用汉化的编程环境。
danmao 2003-02-28
  • 打赏
  • 举报
回复
根据你们的指点虽然我领悟不少可是我还有些地方不明请多加指教!!!
Rec. 20 Avoid single letter variables, since they are not meaningful (even if they are used for loop
index).
如果变量不是在循环中使用,应该避免定义一个单字符变量。

2.6 Procedures & Functions 程序与函数
There are three kinds of procedure/function: 有三种类型的过程/函数:
o Those which are local to a file 在一个文件内部
o Those which are private to a module 属于一个模块
o Those which are exported 用来输出

every 2003-02-28
  • 打赏
  • 举报
回复
谁能帮我刚刚上面的那段指明下!我就可以接了!

指点下!就是上面那一段就行了!

谢谢
loopyifly 2003-02-28
  • 打赏
  • 举报
回复
:)

cast a glance over
every 2003-02-28
  • 打赏
  • 举报
回复
根据你们的指点虽然我领悟不少可是我还有些地方不明请多加指教!!!
Rec. 20 Avoid single letter variables, since they are not meaningful (even if they are used for loop
index).
避免单一文字变量, 既然他们(即使他们作为 loop 索引)命名 ????.

2.6 Procedures & Functions 程序与函数
There are three kind sof procedure/function: 有三种类型 sof 程序/函数:
o Those which are local to a file 那些是局部文件
o Those which are private to a module 那些是私有模块
o Those which are exported 那些输出


Rule 25 The only underscore allowed in a procedure/function name is the one separating the prefix from the function name.
只有在程序/函数名用一个下划线分开函数名字的前缀。

Rule 26 Procedure names should reflect what they do. Procedure often acts on objects, and its
name is built as following: ObjectAction. First is the Object and after the Action performed
on the object. For example SVAUD_ConfigSet().
程序名应该反映的功能。 程序的行动目标, 它的名以此而命名: ObjectAction。 第一是物件,后面的是功能。 举例来说 SVAUD_ConfigSet.()
every 2003-02-28
  • 打赏
  • 举报
回复
uhlan(uhlan)和 OstrichFly(飞翔的鸵鸟) 谢谢你们给我有所领悟
还有你们那些只说的但是我的但是我还是要谢谢你们。

根据你们的指点虽然我领悟不少可是我还有些地方不明请多加指教!!!
Rec. 20 Avoid single letter variables, since they are not meaningful (even if they are used for loop
index).
避免单一文字变量, 既然他们(即使他们作为 loop 索引)命名 ????.

2.6 Procedures & Functions 程序与函数
There are three kind sof procedure/function: 有三种类型 sof 程序/函数:
o Those which are local to a file 那些是局部文件
o Those which are private to a module 那些是私有模块
o Those which are exported 那些输出


Rule 25 The only underscore allowed in a procedure/function name is the one separating the prefix from the function name.
只有在程序/函数名用一个下划线分开函数名字的前缀。

Rule 26 Procedure names should reflect what they do. Procedure often acts on objects, and its
name is built as following: ObjectAction. First is the Object and after the Action performed
on the object. For example SVAUD_ConfigSet().
程序名应该反映的功能。 程序的行动目标, 它的名以此而命名: ObjectAction。 第一是物件,后面的是功能。 举例来说 SVAUD_ConfigSet.()
every 2003-02-28
  • 打赏
  • 举报
回复
谢谢!
zhenxizhou 2003-02-27
  • 打赏
  • 举报
回复
软件翻译的只能起到参考作用,你还是得真正花一份工夫自己核对修改
liuhongyong 2003-02-27
  • 打赏
  • 举报
回复
UP!
danmao 2003-02-27
  • 打赏
  • 举报
回复
呵呵,是毕业设计的翻译吧?
crushor 2003-02-27
  • 打赏
  • 举报
回复
这本来就很不通嘛,比如,
1。如前所述,模块之间不共享变量。
2。变量的命名会用变量所属模块的标志做前缀。
3。从属于文件的区域变量不使用规则2 。
4。变量名用小写字母,但是组成变量名的每个词的起始字母要用大写。
5。只允许在变量名的前缀和本名之间使用下划线。
6。尽量避免使用单字母命名变量,这样无法表达足够的信息。即使是用在LOOP语句的行标号时也是如此。
7。前缀用来表明变量的类型和大小。

随便试下拉,俺的英语也很菜,俺是把你的汉语再写一下,按英语习惯写的汉语看起来还不如看英语呢。
GoldenSword 2003-02-27
  • 打赏
  • 举报
回复
楼主用的本来就是东方快车一类的东西翻译的把?这样过不了关的。哈哈哈哈
OstrichFly 2003-02-27
  • 打赏
  • 举报
回复
加几句:

2.8 Macros
2.8 宏

Even if the macros are declared using the define key word, they follow a specific naming convention.
即使宏都是使用define关键子定义,他们仍然需要遵循指定的命名规范。

Rule 32 A macro is always prefixed by m, for example mMyMacro.
Rule 32 一个宏的名称总是以m开始,比如:mMyMacro。

Rule 33 Macros follow the same rules as the functions.
Rule 33 宏遵循与函数相同的规范。
frankxht 2003-02-27
  • 打赏
  • 举报
回复
现在该做毕业论文了吧,呵呵。。。

没时间用东方快车3000。糊弄一下
suping 2003-02-27
  • 打赏
  • 举报
回复
加油!
uhlan 2003-02-27
  • 打赏
  • 举报
回复
As said previously, no variable shared between several modules.
如前所述, 很多模块之间没有共享变量。

A local variable to a module is prefixed by the mnemonic of the module, for example:SVAUD_SourceNumber.
一个模块的局部变量固定在模块的存贮体里, 例如变量:SVAUD_SourceNumber
.
.
.
对不起,没时间

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧