PokeZam Forums  

Go Back   PokeZam Forums > Off-Topic > Technology

Technology For everything from Video Games to Cellphones.

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 06-16-2008
DX-MON's Avatar
DX-MON DX-MON is offline
On the Road
 
Join Date: Mar 2008
Age: 17
Posts: 57
Default 2 Cents about good programming practices in C/C++

I desided to make a thread on what are the best programming practices to use in C/C++, please comment on what you feel about these to useful and powerful languages, my initial list follows.....
  1. Don't use a compressed format (no if (a == b) {
    statements;
    })
    if you have to use brackets, use the form if (a == b)
    {
    statements;
    }
    as from that it's always clear as to what each braket belongs to.
  2. Always comment upon the code, not just for others sakes, but for yours in the future
  3. Whenever you have to do complex things, split it up into separate functions
  4. NEVER with hold on using switch/select statements
  5. If you're thinking that you've not got enough checking happening in your code, you don't.... never think that lots of if statemnts are bad, they aren't.
  6. too many functions are bad, you're probably repeating something, or not optimizing it properly.

If you do the above in C/C++ then you will get good, optimized code out of any compiler, and it'll always be easy to debug.
__________________
The worst thing about the darkness is the light at the end - DX-MON
Spoiler Alert:  Dragons    



Click us or we'll die!
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:00 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
© 1999-2009 PokeZam. All Rights Reserved.