Forum

Single folder source vs. foldered

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Postby frag.machine » Tue Dec 07, 2010 7:29 pm

Feared wrote:
Spike wrote:A single file means you get better optimisations/inlining... Means you're not endlessly compiling windows.h over and over again... Ensures your prototypes _always_ match your functions...
Can't complain! :P


Yeah but when the file takes a bit to just load, damn that's a problem. This is not healthy programming, either. ;)


Chuck Norris facts:

Chuck Norris rewrote Windows alone. In one single C file.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Irritant » Tue Dec 07, 2010 7:43 pm

qbism wrote:Forget folders, Berserker Q2 puts the code in one FILE. A single file for the engine code, and a single file for the game code. Set up some bookmarks in VC++ and experience a certain freedom.


That is just a horrible coding practice though!

Personally, I like organization, and folders.
http://red.planetarena.org - Alien Arena and the CRX engine
Irritant
 
Posts: 250
Joined: Mon May 19, 2008 2:54 pm
Location: Maryland

Postby Feared » Tue Dec 07, 2010 7:56 pm

Irritant wrote:
qbism wrote:Forget folders, Berserker Q2 puts the code in one FILE. A single file for the engine code, and a single file for the game code. Set up some bookmarks in VC++ and experience a certain freedom.


That is just a horrible coding practice though!

Personally, I like organization, and folders.


Good man. He know's what's up. :)
User avatar
Feared
 
Posts: 95
Joined: Fri Jun 11, 2010 11:58 pm
Location: Wylie, TX

Postby Sajt » Tue Dec 07, 2010 7:57 pm

mh wrote:I used to write code like that...


...in 1989 when I was learning COBOL!!! :lol:


When I was starting out with C, I would put everything in one huge file, and even collapse many statements into single lines, thinking that it would somehow compile or run faster... (incidentally this was not 1989, but 1998, though all I had anyway was Turbo C++ 1.0 and some books from 1989)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby mankrip » Wed Dec 08, 2010 12:57 am

Using a single folder is better; organizing the Makaqu source into multiple folders taught me that.

And something else I've learned from practice is that it's much better to hierarchize by form than by function. So, instead of having files named like r_part.c and d_part.c, name them like part_r.c and part_d.c. Organizing it like that makes it easier to abstract and modularize the features of the engine, because stuff like particle code, MDL code or BSP code does the same thing, only in different ways.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Previous

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest