Tell me if anyone believes this is a problem and why.
I've been doing this last year on my assignments when I was required to use C++.
I place my classes within headers files(duh!) however the definition didn't always go into a CPP file.
My reason was simple, if a class was small, long lived(else it would be a struct) and wasn't complicated in any way I'd place the definition and declaration within the header file.
I haven't thought about this until know because I'm starting to do some serious work in C++ due to the fact I spent far too much time working with Java and not enough time in C++ since 2004.
Anyway is this a good practice?
The reason I do it is to save room.
I wish editors would integrate headers files and source files a lot better.
I've been doing this last year on my assignments when I was required to use C++.
I place my classes within headers files(duh!) however the definition didn't always go into a CPP file.
My reason was simple, if a class was small, long lived(else it would be a struct) and wasn't complicated in any way I'd place the definition and declaration within the header file.
I haven't thought about this until know because I'm starting to do some serious work in C++ due to the fact I spent far too much time working with Java and not enough time in C++ since 2004.
Anyway is this a good practice?
The reason I do it is to save room.
I wish editors would integrate headers files and source files a lot better.