Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

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

Reply
 
Thread Tools Display Modes
Old May 25th, 2006, 11:22 PM   #11
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 343
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
Quote:
Originally Posted by Varrickmana
DaWei, why do you build me up, just to tear me down, baby? lol
http://en.wikipedia.org/wiki/BDSM
__________________
i dont know much about programming but i try to help

Last edited by mrynit; May 25th, 2006 at 11:40 PM.
mrynit is offline   Reply With Quote
Old May 25th, 2006, 11:26 PM   #12
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
Quote:
Originally Posted by Game_Ender
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.
Similar case here
Jimbo is offline   Reply With Quote
Old May 25th, 2006, 11:39 PM   #13
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3 King is on a distinguished road
Quote:
Originally Posted by Prm753
Since none of my projects has gone over 5000 lines, I generally stick with 1 or 2 (at the most) source files. :p
You really need to make more files then. Each class should be going in seperate files.
__________________
I am Addicted to Linux!
King is offline   Reply With Quote
Old May 25th, 2006, 11:52 PM   #14
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
Quote:
Originally Posted by King
You really need to make more files then. Each class should be going in seperate files.
That's assuming he has lots of (or any) classes. Remember C++ can be procedural too. Even so, I'd try to split it up at that point, even if for nothing other than compilation reasons like DaWei mentioned.
Jimbo is offline   Reply With Quote
Old May 25th, 2006, 11:59 PM   #15
Toro
Hobbyist Programmer
 
Toro's Avatar
 
Join Date: Apr 2006
Posts: 136
Rep Power: 0 Toro is an unknown quantity at this point
I usually create a lot of classes with in turn into a lot of different sources, :p . I also am a OOP minded person.
Toro is offline   Reply With Quote
Old May 26th, 2006, 6:28 AM   #16
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
...OO minded, but I don't write procedural C++ programs....Now of course C is a whole other story.....
I'll take issue with this expression of incipient guru-masterness. It's not an attack, I've said it before. OO is not new. Oog used it when he designed the wheel, and he didn't have classes. Mechanical engineers and hardware logic designers use it all the time (without "classes"). When OO is indicated, one uses it. When it's not, one uses the procedural approach. C or C++ be damned. A lawnmower is an object. It is not a member of your lawn object, nor is mowing a method of your lawn object. You bring your lawnmower to the lawn and do the job procedurally.
__________________
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
DaWei is offline   Reply With Quote
Old May 26th, 2006, 8:52 AM   #17
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
For better or for worse, right now I am at the stage where I see everything through object oriented glasses (drunken the coolaid so to speak). So if am I using a language that allows easy object oriented development I will use that method. I listed C as an example of a language I program procedurally in. You can of course to procedural in C++ and OO in C, or a mix of both.

I haven't done large C projects but I assume you break functions into groups (modules) that accomplish one task and create a header source file pair for them. So my "one class, 2 files" approach makes no sense in C.
Game_Ender is offline   Reply With Quote
Old May 26th, 2006, 9:27 AM   #18
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
To my way of thinking, OO is not a software discipline. It's a natural approach to any design that often (not always) results in a more effective and useful "thing". No point in repeating myself here, but you can see some thoughts at the link, "Why OOP, My View", in my signature.
__________________
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
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC