Click here to Skip to main content
15,898,371 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Today Pin
ChandraRam29-Apr-24 21:40
ChandraRam29-Apr-24 21:40 
GeneralRe: Today Pin
James Ingram29-Apr-24 22:31
James Ingram29-Apr-24 22:31 
GeneralRe: Today Pin
maze329-Apr-24 23:34
professionalmaze329-Apr-24 23:34 
GeneralRe: Today Happy Birthday! Pin
Peter Kelley 202130-Apr-24 1:16
Peter Kelley 202130-Apr-24 1:16 
GeneralRe: Today Pin
Stephen Zelonis30-Apr-24 3:10
Stephen Zelonis30-Apr-24 3:10 
GeneralRe: Today Pin
Steve Naidamast30-Apr-24 4:07
professionalSteve Naidamast30-Apr-24 4:07 
GeneralRe: Today Pin
Choroid30-Apr-24 6:33
Choroid30-Apr-24 6:33 
GeneralDo you embed classes within classes? Pin
charlieg29-Apr-24 1:45
charlieg29-Apr-24 1:45 
I started my software development career using FORTRAN, taught myself C, suffered through Pascal and despise Visual Basic. I'm an EE that just learned how to do this. Back in the beginning, there were no IDEs just text editors, so I naturally developed the habit of putting one function in one file. As I moved on to C++, I continued this style with my class development - one class per file. I suppose I picked up this style from the people I worked with, early source control systems I used (CMS/MMS anyone?) and what not.

Now I admit I am no C++ guru. I have seen people on stack overflow answer a C++ question with so much mind numbing detail that my eyes glaze. I view some or most of the esoteric aspects of c++ (like operator overloading) as dubious at best. Sounds good initially but later on in maintenance, ugh.

So, coding style question - do you embed classes within classes? I suppose if the object is never used outside of it's main file, it sort of makes sense. But it makes it a $itch to track things down. Then, other modules that include the header file for the parent start referencing the embedded classes, and it becomes spaghetti code. I know it's valid C++, but....

Thoughts? I'm probably just being a curmudgeon. Currently doing battle with lifting a VC6 project to VS2022. To say it's "interesting" is putting it lightly but that's for another post.
Charlie Gilley

“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

Has never been more appropriate.

GeneralRe: Do you embed classes within classes? Pin
pkfox29-Apr-24 2:02
professionalpkfox29-Apr-24 2:02 
GeneralRe: Do you embed classes within classes? Pin
trønderen29-Apr-24 5:25
trønderen29-Apr-24 5:25 
GeneralRe: Do you embed classes within classes? Pin
Maximilien29-Apr-24 2:06
Maximilien29-Apr-24 2:06 
GeneralRe: Do you embed classes within classes? Pin
trønderen29-Apr-24 5:22
trønderen29-Apr-24 5:22 
GeneralRe: Do you embed classes within classes? Pin
Maximilien29-Apr-24 10:13
Maximilien29-Apr-24 10:13 
GeneralRe: Do you embed classes within classes? PinPopular
OriginalGriff29-Apr-24 2:56
mveOriginalGriff29-Apr-24 2:56 
GeneralRe: Do you embed classes within classes? Pin
charlieg29-Apr-24 3:31
charlieg29-Apr-24 3:31 
GeneralRe: Do you embed classes within classes? Pin
dandy7229-Apr-24 8:56
dandy7229-Apr-24 8:56 
GeneralRe: Do you embed classes within classes? Pin
obermd29-Apr-24 3:19
obermd29-Apr-24 3:19 
GeneralRe: Do you embed classes within classes? Pin
charlieg29-Apr-24 3:59
charlieg29-Apr-24 3:59 
GeneralRe: Do you embed classes within classes? Pin
Salvatore Terress29-Apr-24 15:00
Salvatore Terress29-Apr-24 15:00 
GeneralRe: Do you embed classes within classes? Pin
Matt Bond30-Apr-24 7:38
Matt Bond30-Apr-24 7:38 
GeneralRe: Do you embed classes within classes? Pin
englebart30-Apr-24 15:26
professionalenglebart30-Apr-24 15:26 
GeneralRe: Do you embed classes within classes? Pin
maze329-Apr-24 23:41
professionalmaze329-Apr-24 23:41 
GeneralRe: Do you embed classes within classes? Pin
BernardIE531730-Apr-24 0:28
BernardIE531730-Apr-24 0:28 
GeneralRe: Do you embed classes within classes? Pin
Gary Wheeler30-Apr-24 1:13
Gary Wheeler30-Apr-24 1:13 
GeneralRe: Do you embed classes within classes? Pin
charlieg30-Apr-24 16:45
charlieg30-Apr-24 16:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   415 votes