Raydium 3D Game Engine
http://memak.raydium.org/

Weird coding style
http://memak.raydium.org/viewtopic.php?f=10&t=539
Page 1 of 1

Author:  nirva [ Sun Sep 03, 2006 10:14 am ]
Post subject:  Weird coding style

First, congratulations on creating a truly addictive and fun game. Linux doesn't have too many of these.

There were some things that I wanted to tweak, so I downloaded the source code and took a look at the internals. Here are some of my gripes:

- It looks like the source for the whole game (except for the radium engine) is in one big C file (mania_drive.c). I would definitely chop it into smaller pieces, especially if you're going to keep developing new features.

- The indentation style is something I have rarely seen. It's often difficult to see where the longer functions end because the main block has no indentation at all. This seriously kills readability of the code. And sometimes spaces are used for indentation, sometimes tabs. I don't think there's any C style guide that recommends this. This whole indentation problem is fortunately very easy to fix with an automated tool like GNU Indent (http://www.gnu.org/software/indent/).

- Some functions (like void display()) are too long. They should be divided into smaller pieces as well, to improve readability.

Author:  Xfennec [ Sun Sep 03, 2006 3:18 pm ]
Post subject: 

We know all this :) This is not a problem at all currently, since the game is less than 3000 lines longs ... All this can easily change over time, but ManiaDrive is still a small application.

Author:  Guest [ Sun Sep 03, 2006 4:31 pm ]
Post subject: 

Quote:
This is not a problem at all currently, since the game is less than 3000 lines longs ...


True. I just thought that if you're going to keep adding new features the project will begin to collapse under its own weight. And things are easier to fix when they're small.

Anyway, keep up the good work.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/