GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Mar-2009, 11:07
genesaika genesaika is offline
Awaiting Email Confirmation
 
Join Date: Apr 2008
Posts: 80
genesaika is on a distinguished road

Formatting C++ code: industry standards


I am looking at getting a career as a C++ programmer.

I am taking a C++ programming class in High School (senior year) and so far my teach has confused me on what is considered good formatting practice. When I started the class this year I was sloppy, but I had some good habits. At the start i was told to change my habits and so I did, but now my teacher is telling me that I should have the habits i gave up.

So my question is: What is considered good practice for formatting C++ code in the industry?

Something that other programmers can look at and understand.

Also I welcome any advice to help me along with my career. I am going into the game development field, but this should not effect the answers for the formatting question.

Thank you for any help you may give me.
Regards,
Gene Saika
  #2  
Old 10-Mar-2009, 11:36
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 580
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: industry standards question


Quote:
Originally Posted by genesaika
So my question is: What is considered good practice for formatting C++ code in the induatry?
If you ask ten people, you will get ten somewhat different answers, but one never goes wrong with emulating K&R.

Likewise, go to a library & look at books by Stroustrup. Emulating the language designer's style isn't bad either (not that there is much difference he has was classic K&R...).

The point is to stay with a style that others can easily read, however, note that some companies have their own stylistic guides.
  #3  
Old 10-Mar-2009, 11:56
genesaika genesaika is offline
Awaiting Email Confirmation
 
Join Date: Apr 2008
Posts: 80
genesaika is on a distinguished road

Re: industry standards question


Thank you, and that is what I was thinking. My teacher just wants me to format like he does.

I will look into company style and Stroustrup's style. Also I will look at K&R to get an idea as to what might be good practice.
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please, This is Difficult question try for me! bcompt143 C++ Forum 4 24-Aug-2008 10:14
Question about locking surfaces to directly access pixels, SDL. george89 C++ Forum 0 18-Jun-2006 22:16
Learning C++ question JimmyOrangeSeed C++ Forum 2 06-Feb-2006 19:05
Question about sprintf() shvalb C Programming Language 1 23-Feb-2005 05:28
question of practice magiccreative C++ Forum 1 06-Feb-2004 08:17

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:59.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.