Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
SysRef naming

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
victorf



Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York

Posted: 15 February 2006, 18:21 PM    Post subject: SysRef naming Reply with quote

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. Smile

Vic
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 16 February 2006, 21:18 PM    Post subject: Reply with quote

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: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group