乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: Kerry

variable names

[复制链接]

16

主题

506

帖子

6

银币

中流砥柱

Rank: 25

铜币
570
发表于 2015-10-15 11:47:16 | 显示全部楼层

Yep, Glenn came from an arx background
... and the p represented pointer.
BUT I personally think the usage is redundant in C# .. we 'know' these particular variables represent Classes ( the 'knowledge' is from common usage).
回复

使用道具 举报

15

主题

687

帖子

169

银币

中流砥柱

Rank: 25

铜币
582
发表于 2015-10-15 13:29:46 | 显示全部楼层
My default is to spell it out with variables as camel casing, constants as all caps, and everything else as Pascal casing.  The exception is everyday Autodesk variables, i.e. doc, db, bt, ms, tr, etc.
Prefixes like p, m, and _ are a C++ thing and I leave them there.
回复

使用道具 举报

15

主题

687

帖子

169

银币

中流砥柱

Rank: 25

铜币
582
发表于 2015-10-15 13:39:42 | 显示全部楼层
Personal quirk, but one thing I find annoying is prefixing everything with its type ie. intCounter, strName, dblDistance.  When its well named and used rationally it should be rather obvious a counter will be an int not a string, a name will be a string not a double, or a distance will be a double not a bool.
回复

使用道具 举报

61

主题

792

帖子

35

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1015
发表于 2015-10-15 16:45:38 | 显示全部楼层
@Se7en
Both Autodesk.AutoCAD.DatabaseServices and Autodesk.AutoCAD.GraphicInterface namespaces have a Polyline class.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-4 21:48 , Processed in 0.144661 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表