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:
Anonymous2004-12-31 9:06
What pissis me of on c++ is that all these people whine about it. Nut none of them get up and change the damn thing.
Name:
Anonymous2004-12-31 12:41
If you changed it then it wouldn't be C++ anymore.
Java owns teh sky!
Name:
Anonymous2004-12-31 15:23
How is Java C++ ? :p
i'm only at the very start of using c++ so don't feel like having the right to complain about it. Still Java is too loaded to replace c or c++. C++ maybe for that GUI-centered stuff, but i wouldn't do that in C++ anyway.
Name:
Anonymous2004-12-31 16:55
The virtual keyword.
Everything that isn't inline should be virtual by default.
Name:
Anonymous2005-01-01 9:20
Having to keep my headers and cpp files in sync when I change function argument lists or whatnot.
Does any IDE make this less painful?
Name:
the.last.programmer2005-01-01 10:40
i usually try to advoid c++. polymorphism is over-rated. most people only use classes as a group of functions and fields, which means you can do the exact same thing faster and easier in C. there have been a few times the logic grouping of classes and some polymorphism have made it easier to keep everrything in one of my programs straight and clear, but there's got to be a better way to do this than c++. i have this dream of an IDE for C which lets you do things like overloading. after all, overloading is not anything special, the compiler just gives everything unique names. it's really just a convienence for the programmer. but as someone said already, if you changed the language then it would be some new language... sort of.
Not really. It would just be a new revision of the language or a fork of it. I hear that C99 brings a lot of C++ improvments into C, I haven't bothered to look at it though. Maybe overloading is part of it?
Polymorphism and inheritance, etc maybe overrated an not needed for small projects, but large projects with a lot of people working on them can benefit from those types of things.
One thing that I will say though. As much as people talk about iostream being broken, the few times I've tried to read in character arrays from files using stdio.h, and then I try to strcpy the strings elsewhere all I get a segfaults.
Name:
Anonymous2005-01-02 1:43
It's not that iostream is broken, it's just plain ugly. And inconsistent. They could have done a better.
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.
Name:
anonymous2005-01-02 20:57
It never does what it says it will do. I type an expression into Scheme and it does exactly what it says it will do. I type the same thing (translated, dumbass) into C++ and it scribbles my malloc headers. Motherfucker, I pay good money for those malloc headers. And objects are easier to implement in Scheme, just lists of lists. Jesus H Christ on a pogo stick, why is "How to make a list that doesn't fuck up your computer" such an involved problem? As in, more involved than '(this is a fucking list)
Name:
Anonymous2005-01-02 22:57
Scribbles your malloc headers? What does that mean?
You've obviously never designed a programming language. And I second >>13 in saying, "WTF does 'scibbles my malloc headers' mean?" And I say that things are easier to understand in C or C++ than Scheme. Scheme is all about recursion, while C/C++ are more procedural. It's not that hard, but I would much rather use C/C++... And BTW, if Scheme is so awesome, then design an emulator in it, or an entire game, or even a web browser..
I've designed more programming languages than you can imagine. Not hard when you're such a retard that you have a hard time understanding Polish notation, but still, I've designed my share. And even when you're trying to do low level system management, BrainFuck is far more likely to actually do what the code says it will do.
Implementation of data structures should *never* be as kludgey as it is in C/++. A simple dynamicly allocated array (for, say, an arbitrary amount of text) is so bloated and illegible that if I ever try to write the same thing again it ends up bluescreening my computer.
And really, Sceme isn't that great for anything besides text processing. For truly great greatness that exceeds all greatness that is great, check out Inform, which actually manages to be readable *and* low level at the same fucking time.
Name:
Anonymous2005-01-03 2:45 (sage)
Inform? As in the ZMachine?
This thread has officially entered the realm of the surreal.
Name:
Anonymous2005-01-03 12:23
oh i made a text adventure once.
Name:
Anonymous2005-01-03 13:05
>>15 if your so into having readable text then why not program in Vb or Delphi...
C/++ are the best languages out there today
Name:
Anonymous2005-01-03 21:58
>>18, it's people like you who are the reason Bill Gates wipes his ass with gold bullion.
>>17, yeah, Inform's amazing amounts of awesome is part of the reason there are so many shitty games out there. People need to learn how to write before they get all caught up in the idea that OMG EASTEREGGS you can put Snake into an adventure game.
Um, Bill Gates' wealth has nothing to do with C/C++. It doesn't matter how many scheme/inform progams that people create for a SPARC system running CDE. People don't want it. Average Joe Computer User doesn't care what computer language is behind his favorite app. He just cares that it works. Arguing over programming languages is about as retarded as you can get. I don't believe that I've ever heard two mechanics spend hours arguing on which company makes a better wrench... Programming languages are fucking tools to get the job done. You use what makes the most sense for what you're doing, and "I could use this language that does what I want to do the best, but is fugly... Naw! I think I'll use Inform because of the pretty colors!" Well, let's just say at that point the programming language isn't the only tool there.
lol. Maybe he should program in COBOL if he wants readable code. Remember when COBOL was supposed to get rid of programmers because it was supposed to be so easy and readable that the business people/managers would just write whatever programs they needed on their own.
Name:
Kageshima!W.rJY3yfYQ2005-01-05 1:08
>>19 Only complain about Gates` wealth if you honestly wouldn`t have done the exact same thing in his position.
Name:
Anonymous2005-01-05 16:11
You can write readable code in most languages, including C++. You can write unreadable code in all (?) languages. It all depends on the professionalism of the programmer.
Name:
Anonymous2005-01-06 0:01
Talking about professionalism to people bitching about languages is like pissing into the wind.
Name:
Anonymous2005-01-06 12:36
I switched to Java. No fucking header files. Compile one file, it compiles the rest for you automatically. Massive, well-documented package library. Garbage collection. No prototypes. I can't really go back to C++ now. My only qualm in the Integer, Character etc. wrappers.
Name:
Anonymous2005-01-06 21:11
I personally miss the "abstract" keyword. What is void foo() = 0 supposed to mean? You aren't allowed to initialize anything else in the class files...
Also, it appears impossible to override the operator<< for an inner class without defining it in the class definition. That's just plain weird.
Name:
Anonymous2005-01-06 22:34
>>25
i would use java if i could find a java virtual machine that doesn't make quickbasic seem fast...
"virtual void foo() =0;" means that the function is fully virtual and relies on derived classes to implement their own. The only reason that you are able to initialize in the class definition is because it would be silly to force you to do something like:
virtual void class::foo() = 0; in the implementation. And because all the other stuff is supposed to really be initialized in the constructor, not in the definition.
They're not that slow (3D engines have been running under it). But nobody's going to be using them for real time stuff anytime soon, I'll grant you that.
Name:
Anonymous2005-01-07 23:08
Now seriously if you are complaining about such stuff about c++ you are
a) Utterly clueless
b) have not take time to figure why it is like it.
And for you C junkies who likes overloading and some features of C++ just write C code and use those features and compile the code with a C++ compiler. Nobody is going to stop you. (I have to agree that C-style procedural programming is better in some appliances, but C++ has its benefits too in larger projects )
>>1 ok So you have two different classes in two different namespaces. But both in the same header. And they both have a "void Initialize()" function. And not using the namespace::class::function in the definition, how would you tell them apart?
The only thing that pisses me off from time to time is the undefined initialisation order of static objects, that sometimes can cause annoying bugs in some advanced code setups.
C++ as a whole is a kludge because the designers insisted on backward compatibility with C.
D takes a much more logical approach, learning from the sensible syntax of Java without sacrificing the ability to program in a procedural style when desirable and even drop into assembly when necessary. This makes it suitable for everything from device drivers to enterprise scale applications.
Name:
Anonymous2005-02-04 10:32 (sage)
I hate the fact that I have to put the template signatures and definitions at the same place instead of the good ol' h/cpp separation.
I recently tried to do this for a school assignment. I read on some specs paper it was supposed to work but no compiler would support it (especially gcc) :(
Name:
Anonymous2007-03-15 7:29 ID:ddomdxhR
phew! this thread was about to die but i shaved it ! ^__^
Name:
Anonymous2007-03-15 9:35 ID:K3eCd7Qc
>>35 sensible syntax of Java
I was just about to flame this idiot, then I realised it was me from 2 years ago.
Name:
Anonymous2007-03-15 10:37 ID:fBEaGrP7
>>8
This is probably not iostream, but the little char array problems that made me choose Java over C++. Try using the string.h thing and always remember to say "new WHATEVER" before setting your vars. And you know this leads to memory leaks anyway, since we don't call delete on strings after we're done. My gripe is that you normally need 2 or 3 intermediate strings in any function for any dynamic output.
>>11
My other gripe is the exact thing with namespaces. I never liked finding out that GCC 3 was such a bitch with "standards" and all my old code would not compile. I hate warnings about "you forgot to leave an extra line at the end of each file" crap and "oh you included a file but you don't know it ONLY uses the std namespace --I won't suggest anything and give 5 errors to make you think YOUR iostream is somehow broken. Worst yet, every compiler does what it feels like, and you get weird errors with code that compiles elsewhere.