Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Random things that piss you off about C++

Name: Anonymous 2004-12-31 9:02

I hate how function declarations and function definitions usually don't look the same. For example

Declaration:
virtual void doShit()

Definition:
void MyNamespace::MyClass::doShit()

Name: Anonymous 2005-01-02 13:18

>>10

I don't have problems with my code turning into a mess.  The only problems I have with code turning into an unreadable mess is when I *don't* use classes or separate functions and end up with huge, monumental functions that do 12 things.  It's especially apparent when I use switch statements.  Those are hard to read if they are 10-15 lines of code for each case.

In my opinion though, the namespace::class::function syntax isn't that bad.  At least with the class part it helps you to see what class it goes with.  Especially if it's a virtual function like in >>1 's example.  Because you could have multiple derived classes that define that function, and when you are looking at one of the definitions the class:: let's you know which one you are looking at.  As for the namespace::, I don't think that you need it for your own definitions.  Personally the only time that I use namespaces is for stuff like 'using std::cout;' or 'std::list<int> intList;'  I learned C/C++ without anything about namespaces.  When I got to college and they were talking about 'using namespace std;' I didn't have a clue what it was.  Heh.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List