![]() |
|
| View Poll Results: How many source files do you use in your projects? | |||
| Tons! |
|
5 | 26.32% |
| A "medium" amount. |
|
5 | 26.32% |
| A few. |
|
3 | 15.79% |
| One or two. |
|
6 | 31.58% |
| Voters: 19. You may not vote on this poll | |||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 21
Rep Power: 0
![]() |
Multiple Source Files in a Project
I was wondering how many people use multiple sorce files in their programs, or if most people just stick with one...
__________________
Kids, every year, more than 400,000 people die from tobacco chewing, smoking, an- MY GOD, HERE COMES A ZOMBIE PIRATE NINJA!!!!!! |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
If you have a project of any size at all, you'll have many source files. This isn't a question you would even think about asking in a real-world situation, particularly when larger projects are written by teams. Ever hear of CVS?
Even on a small, personal project you should have a source file for each functionally different area, break one up to prevent it from being too long (quicker compilation), or perhaps, as some like, to have one file per function. Can you imagine recompiling thousands of lines of code when you change one line? Nahhhhhhhhh.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Depends on how big the program is. If there's too much to handle in one source file, split it up.
EDIT: DaWei beat me to it. Meh. |
|
|
|
|
|
#4 |
|
Newbie
Join Date: May 2006
Posts: 21
Rep Power: 0
![]() |
DaWei, why do you build me up, just to tear me down, baby? lol
![]()
__________________
Kids, every year, more than 400,000 people die from tobacco chewing, smoking, an- MY GOD, HERE COMES A ZOMBIE PIRATE NINJA!!!!!! |
|
|
|
|
|
#5 |
|
Programmer
Join Date: May 2006
Posts: 85
Rep Power: 3
![]() |
Your sounding a little gay "baby"... Get a life and stop hitting on DaWei
__________________
Code Forums |
|
|
|
|
|
#6 | |
|
Professional Programmer
|
Try not to call people gay on these forums. No matter what the argument is about, the person calling the other "gay", usually makes themselves look stupid. Everyone knows anyone calling someone gay really is gay themselves
(that's a joke).Ontopic: The most source files I've used in one program was 6. If you consider header files "source", then the most I've used was 12.
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
|
|
#7 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3
![]() |
"Takes one to know one" kinda thing, eh? :p
|
|
|
|
|
|
#8 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#9 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
Maybe I am too anal and OO minded, but I don't write procedural C++ programs. So I have one header file and one source file per class. For really small classes, about ten to twenty lines, that are just utility classes related to a larger class I will include them with that classes sources. It is quite hard to follow someones code if they haphazardly group classes in source files. Now of course C is a whole other story.
|
|
|
|
|
|
#10 |
|
Professional Programmer
|
Since none of my projects has gone over 5000 lines, I generally stick with 1 or 2 (at the most) source files. :p
__________________
The world's first athletic computer geek! The home of PrProgramsStudios How not to post a question: <-- Please don't reply |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|