Re: irregulars: how to split c++ class between multiple files

2003-08-14 Thread The Fool


--
From: Horn, John [EMAIL PROTECTED]
To: Killer Bs Discussion [EMAIL PROTECTED]
Subject: RE: irregulars: how to split c++ class between multiple files
Date: Saturday, August 09, 2003 10:20 AM

 From: The Fool [mailto:[EMAIL PROTECTED]
 
 I have a c++ class that is very large (90k lines) that I 
 need to split
 up between multiple files.

I'm not a c++ programmer.  But that seems to be a very, very large
class.  Wouldn't it be better (and/or possible) to split it up into
a main class and some helper classes?

Not that that answered the original question, of course...

---
Not in this particular case.  All the functions are related / use the
same class variables etc.  Also sometimes speed and efficiency are more
important than ease of use.

___
http://www.mccmedia.com/mailman/listinfo/brin-l


Re: irregulars: how to split c++ class between multiple files

2003-08-14 Thread Jan Coffey

--- The Fool [EMAIL PROTECTED] wrote:
 
 
 --
 From: Horn, John [EMAIL PROTECTED]
 To: Killer Bs Discussion [EMAIL PROTECTED]
 Subject: RE: irregulars: how to split c++ class between multiple files
 Date: Saturday, August 09, 2003 10:20 AM
 
  From: The Fool [mailto:[EMAIL PROTECTED]
  
  I have a c++ class that is very large (90k lines) that I 
  need to split
  up between multiple files.
 
 I'm not a c++ programmer.  But that seems to be a very, very large
 class.  Wouldn't it be better (and/or possible) to split it up into
 a main class and some helper classes?
 
 Not that that answered the original question, of course...
 
 ---
 Not in this particular case.  All the functions are related / use the
 same class variables etc.  Also sometimes speed and efficiency are more
 important than ease of use.

A class of that size is certaily not well factored. Trust me, good OO
abstraction will not screw your performance in C++.

Send me your design and I can help you refactor it.

=
_
   Jan William Coffey
_

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
___
http://www.mccmedia.com/mailman/listinfo/brin-l


Re: irregulars: how to split c++ class between multiple files

2003-08-14 Thread Jan Coffey

--- Joshua Bell [EMAIL PROTECTED] wrote:
 From: The Fool [EMAIL PROTECTED]
 
  Not in this particular case.  All the functions are related / use the
  same class variables etc.  Also sometimes speed and efficiency are more
  important than ease of use.
 
 Very rarely - what's going to happen to the code in 6 months when you've
 forgotten how half of it works? Is that trade-off worth it? Programmer 
 maintenance time usually outweights processing time.
 
 It is extremely unlikely that the overhead of method calls (even vtable
 calls) are the performance bottleneck in any realistic project. About the
 only time you need to even think about those are when you're writing the
 tight inner loop of a 2D/3D/Sound rendering core - and with standard APIs
 (OpenGL, DirectX, etc) there's very little need to worry about that.
 
 Even then, one of the projects I'm working on for fun is a 3D engine for
 the
 PocketPC (no DirectX or hardware acceleration) which is entirely C++ and
 makes heavy use of code broken up into multiple classes. Using such C++
 features as the inline directive, const variables, templates,
 metaprogramming, etc. you can completely eliminate even the overhead of
 function calls and object derefencing. The trick is to make the compiler do
 it, not the programmer. Compilers are VERY good at optimizations these days
 if you have enough hints in your code.
 
 Besides, trying to optimize without doing profiling is crazy (apart from
 obvious things like using good algorithms). It's well known that you should
 write the code first and optimize later, since what you think might be the
 bottlenecks and what actually turn out to be the bottlenecks are very
 rarely
 the same thing.
 
 Joshua

Well said.

=
_
   Jan William Coffey
_

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
___
http://www.mccmedia.com/mailman/listinfo/brin-l


Re: irregulars: how to split c++ class between multiple files

2003-08-14 Thread Joshua Bell
From: The Fool [EMAIL PROTECTED]

 Not in this particular case.  All the functions are related / use the
 same class variables etc.  Also sometimes speed and efficiency are more
 important than ease of use.

Very rarely - what's going to happen to the code in 6 months when you've
forgotten how half of it works? Is that trade-off worth it? Programmer 
maintenance time usually outweights processing time.

It is extremely unlikely that the overhead of method calls (even vtable
calls) are the performance bottleneck in any realistic project. About the
only time you need to even think about those are when you're writing the
tight inner loop of a 2D/3D/Sound rendering core - and with standard APIs
(OpenGL, DirectX, etc) there's very little need to worry about that.

Even then, one of the projects I'm working on for fun is a 3D engine for the
PocketPC (no DirectX or hardware acceleration) which is entirely C++ and
makes heavy use of code broken up into multiple classes. Using such C++
features as the inline directive, const variables, templates,
metaprogramming, etc. you can completely eliminate even the overhead of
function calls and object derefencing. The trick is to make the compiler do
it, not the programmer. Compilers are VERY good at optimizations these days
if you have enough hints in your code.

Besides, trying to optimize without doing profiling is crazy (apart from
obvious things like using good algorithms). It's well known that you should
write the code first and optimize later, since what you think might be the
bottlenecks and what actually turn out to be the bottlenecks are very rarely
the same thing.

Joshua
___
http://www.mccmedia.com/mailman/listinfo/brin-l


irregulars: how to split c++ class between multiple files

2003-08-10 Thread The Fool
I have a c++ class that is very large (90k lines) that I need to split
up between multiple files.

The way it is now I have a header file with all the declarations x.h,
and a c++ source file that contains all the functions in y.cpp.  I need
to be able to split the functions up between two files like y.cpp and
z.cpp.  The primary reason being that the VC++ IDE doesn't work with
lines after line 65535 and doesn't allow debugging any function or parts
of functions after line 65535.

-TIA
___
http://www.mccmedia.com/mailman/listinfo/brin-l


RE: irregulars: how to split c++ class between multiple files

2003-08-09 Thread Horn, John
 From: The Fool [mailto:[EMAIL PROTECTED]
 
 I have a c++ class that is very large (90k lines) that I 
 need to split
 up between multiple files.

I'm not a c++ programmer.  But that seems to be a very, very large
class.  Wouldn't it be better (and/or possible) to split it up into
a main class and some helper classes?

Not that that answered the original question, of course...

  - jmh
___
http://www.mccmedia.com/mailman/listinfo/brin-l