|
|
| Author |
Message |
victorf
Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York
|
|
Posted: 15 February 2006, 18:21 PM Post subject: SysRef naming |
|
|
I was just wondering about why routines are, or are not named consistantly. Take for example the I2C routines. We have I2CCmd, I2CGetByte, I2CPutByte, I2CStart and I2CStop. Then we have OpenI2C and CloseI2C. If asked, I would have named these last two I2COpen and I2CClose.
Don't read anything into this post. I was just curious.
Vic |
|
| Back to top |
|
 |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 16 February 2006, 21:18 PM Post subject: |
|
|
I would suggest that the naming scheme is historical and based on compatibility with BasicX e.g.
- OpenCom, OpenQueue, OpenSPI leads to OpenI2C.
- CloseCom leads to CloseI2C
- SPICmd leads to I2CCmd
Although don't go looking for any widespread, consistent naming scheme e.g. verb-noun as it doesn't exist. |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 16 February 2006, 21:41 PM Post subject: |
|
|
Mike's conjecture is spot on.
My personal preference is for sets of routine names to have a common prefix that suggests the fact that they are related. This strategy would have produced ComOpen, ComClose, ComDefine, etc. This convention allows related routines to be in close proximity in an alphabetical arrangement such as a manual.
I considered using I2COpen but opted, instead, to continue the Open..., Close... sequence that had already been established. |
|
| Back to top |
|
 |
|