Lost Password?

Go Back   CodeCall Programming Forum > Software Development > General Programming

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-2008, 09:34 AM
Chinmoy's Avatar   
Chinmoy Chinmoy is offline
Programming Professional
 
Join Date: Feb 2008
Location: where heaven meets earth
Posts: 301
Credits: 30
Rep Power: 6
Chinmoy has a spectacular aura aboutChinmoy has a spectacular aura about
Default Coding style.

What coding style do you follow? It is good to follow a certain standard for better coding experience. See here : http://techarraz.com/2008/06/08/tren...-coding-style/
__________________
God is real... unless declared an integer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-08-2008, 10:09 AM
owenclivet owenclivet is offline
Newbie
 
Join Date: Jun 2008
Posts: 4
Credits: 0
Rep Power: 0
owenclivet is on a distinguished road
Default Re: Coding style.

coding shud be done nicely
only

Last edited by WingedPanther; 06-09-2008 at 10:48 AM. Reason: delete spam links
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-09-2008, 01:21 AM
Chinmoy's Avatar   
Chinmoy Chinmoy is offline
Programming Professional
 
Join Date: Feb 2008
Location: where heaven meets earth
Posts: 301
Credits: 30
Rep Power: 6
Chinmoy has a spectacular aura aboutChinmoy has a spectacular aura about
Default Re: Coding style.

Agreed. I wanted a response, not an echo!
__________________
God is real... unless declared an integer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-09-2008, 12:22 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 7,432
Last Blog:
Web slideshow in JavaS...
Credits: 1,322
Rep Power: 61
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Coding style.

I think you should use the style of programming that you feel most comfortable with. It's like playing an instrument, painting a picture or masturbating - everybody does it their own way.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-09-2008, 02:01 PM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 441
Last Blog:
Just over the next hil...
Credits: 42
Rep Power: 8
G_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura about
Default Re: Coding style.

It doesn't matter as long as anyone you work with agrees on a common standard. I'd also follow any language specific conventions. I hate camel case but will use it in places it is expected such as Java.

I think more important is keeping your design sane by refactoring it to resist design rot in any case.
__________________
Code:
glBegin(GL_TRIANGLES);
    drawWorld();
glEnd();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 06-09-2008, 02:39 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 7,432
Last Blog:
Web slideshow in JavaS...
Credits: 1,322
Rep Power: 61
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Coding style.

The code should be as efficient as possible, though, especially when writing games.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-09-2008, 02:57 PM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 441
Last Blog:
Just over the next hil...
Credits: 42
Rep Power: 8
G_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura about
Default Re: Coding style.

Quote:
Originally Posted by Xav View Post
The code should be as efficient as possible, though, especially when writing games.
I think this might be on the wrong thread but I disagree strongly here. It's been proven nearly the point where its a law of nature that about 3% of our code accounts for 95% of our run time. Even if you reduce the overhead of the other 97% to zero you are only saving 5% of your resources.

The best approach is to produce the absolute simplest design possible and keep code cohesive and decoupled. This wrecks performance but makes optimisation easy. The worse thing you will ever have to do is try and optimise a code base that has been 'optimised' already. It makes real advancement extremely difficult. Premature optimisation really is the root of all evil. That said games development is well understood and they know exactly which sections will need the most efficiency.
__________________
Code:
glBegin(GL_TRIANGLES);
    drawWorld();
glEnd();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-09-2008, 03:09 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 7,432
Last Blog:
Web slideshow in JavaS...
Credits: 1,322
Rep Power: 61
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Coding style.

I disagree again - optimisation is crucial when writing games. In the rare times I have tried writing them using XNA with C#, my system slows to a crawl, with frame rates of around 1fps. And why? Because I had not optimised my code, and I was declaring a variable too many times. Once I had optimised, the frame rates climbed. From a book I have been reading, in the author's example, he wrote a game for Xbox 360. It was running at about 100fps. He did a couple of simple optimisations (like making a variable instantiated less often) and the frame rate soared to over 3000fps! Optimisation is very, VERY important in games.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-10-2008, 01:08 AM
Chinmoy's Avatar   
Chinmoy Chinmoy is offline
Programming Professional
 
Join Date: Feb 2008
Location: where heaven meets earth
Posts: 301
Credits: 30
Rep Power: 6
Chinmoy has a spectacular aura aboutChinmoy has a spectacular aura about
Default Re: Coding style.

Xav, G_morgan was talking about 'premature optimization'. That means someting else than what you are debating on. And yes, optimization is important, but you should focus on the completion of the project first. An incomplete code is impossible to optimize. And may I know the name of the game your author wrote cz, Xbox games are made by companies, not individuals! And there work is divived, so the optimization team has to be seperate than the framebuffer management team..or whatever it is called...
__________________
God is real... unless declared an integer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 06-10-2008, 01:44 AM
Chinmoy's Avatar   
Chinmoy Chinmoy is offline
Programming Professional
 
Join Date: Feb 2008
Location: where heaven meets earth
Posts: 301
Credits: 30
Rep Power: 6
Chinmoy has a spectacular aura aboutChinmoy has a spectacular aura about
Default Re: Coding style.

And, whether you do it your way or following a standard depends of what type of a coder you are. If you are making school projects, which you are Xav, I think individual style works, but in a team you have to follow a standard. This is the standard widely followed.
__________________
God is real... unless declared an integer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply

Tags
coding, style



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning Conventional Video Coding Wisdom On Its Head Kernel Programming News 0 05-22-2008 07:18 AM
How to change the standard windows console style ? kresh7 Computer Software/OS 7 11-10-2007 01:12 PM
How to style fonts of a text in a simple page? c0de Tutorials 3 09-15-2007 10:08 PM
How long have you been coding php? cpvr PHP Forum 11 07-11-2006 12:41 PM
More Coding Methods RobSoftware General Programming 2 05-30-2006 04:42 PM


All times are GMT -5. The time now is 01:23 AM.

Contest Stats

Xav ........ 1322.18
MeTh0Dz|Reb0rn ........ 1053.7
morefood2001 ........ 879.43
John ........ 877.37
marwex89 ........ 869.98
WingedPanther ........ 830.24
Brandon W ........ 735.07
chili5 ........ 309.39
Steve.L ........ 239.84
dcs ........ 216.02

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads