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
Programming Style Guide

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



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

Posted: 22 January 2006, 21:11 PM    Post subject: Programming Style Guide Reply with quote

Is there a programming style guide for ZBasic programs. Being somewhat new to this flavor of BASIC and wanting to be sure that I husband the processor's resources, I would like to have a discussion of "proper" programming style.

I also like to have things neat in the code. I have tons of experience with Pascal especially Borland's and have used their products from TP3 to Delphi. I have sort of developed my style. Such things a never capitalizing the words function and procedure (function and subroutine here). I try to capitalize variable names like MyVariable (which I have seen refered to as Camel Caps) and I always (almost) capitalize constants completely (MYCONST). I do not identify variables - strMyVariable. I would like to see the editor do like the help files and enforce capitalzation like this ( MakeString) so I don't have too. Tabbing is an issue with me. Smile I have always indented with two spaces per level and dkinzer was kind enough to explain how to set my tab levels gobally for this.

Anyway I think style is important and makes for easier reading of programs. I would like to hear how others approach this issue.

Any enlightenment will be appreciated.

Vic
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 689

Posted: 22 January 2006, 23:21 PM    Post subject: Reply with quote

Well, you can capitalize it anyway you like. It will not change your resource utilization on the ZX. What ever makes it more legible to you.

But stuff like goto's and while's, and the like that affect program flow DO affect resource utilization, but the actual outcome in bytes used and processing speed are sometimes surprising.


I recently saw somebody's sig than siad something like:

If you just wrote a super-slick section of code, re-write it because you will not understand what you did in a month.

In the end, clarity is the beginning and the end.

-Tony
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic IDE 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