+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 10 of 26

Thread: Coding style.

  1. #1
    Programming Expert Chinmoy has a spectacular aura about Chinmoy has a spectacular aura about Chinmoy's Avatar
    Join Date
    Feb 2008
    Location
    where heaven meets earth
    Posts
    404

    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

  2. #2
    Newbie owenclivet is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    4

    Re: Coding style.

    coding shud be done nicely
    only
    Last edited by WingedPanther; 06-09-2008 at 10:48 AM. Reason: delete spam links

  3. #3
    Programming Expert Chinmoy has a spectacular aura about Chinmoy has a spectacular aura about Chinmoy's Avatar
    Join Date
    Feb 2008
    Location
    where heaven meets earth
    Posts
    404

    Re: Coding style.

    Agreed. I wanted a response, not an echo!
    God is real... unless declared an integer

  4. #4
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    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.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  5. #5
    Guru G_Morgan is a jewel in the rough G_Morgan is a jewel in the rough G_Morgan is a jewel in the rough
    Join Date
    Oct 2007
    Age
    25
    Posts
    537

    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.

  6. #6
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: Coding style.

    The code should be as efficient as possible, though, especially when writing games.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  7. #7
    Guru G_Morgan is a jewel in the rough G_Morgan is a jewel in the rough G_Morgan is a jewel in the rough
    Join Date
    Oct 2007
    Age
    25
    Posts
    537

    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.

  8. #8
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    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.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  9. #9
    Programming Expert Chinmoy has a spectacular aura about Chinmoy has a spectacular aura about Chinmoy's Avatar
    Join Date
    Feb 2008
    Location
    where heaven meets earth
    Posts
    404

    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

  10. #10
    Programming Expert Chinmoy has a spectacular aura about Chinmoy has a spectacular aura about Chinmoy's Avatar
    Join Date
    Feb 2008
    Location
    where heaven meets earth
    Posts
    404

    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

+ Reply to Thread
Page 1 of 3
1 2 3 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 0
    Last Post: 05-22-2008, 07:18 AM
  2. How to change the standard windows console style ?
    By kresh7 in forum Computer Software/OS
    Replies: 7
    Last Post: 11-10-2007, 01:12 PM
  3. Replies: 3
    Last Post: 09-15-2007, 10:08 PM
  4. How long have you been coding php?
    By cpvr in forum PHP Forum
    Replies: 11
    Last Post: 07-11-2006, 12:41 PM
  5. More Coding Methods
    By RobSoftware in forum General Programming
    Replies: 2
    Last Post: 05-30-2006, 04:42 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts