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.
Name:
Anonymous2007-03-15 11:25 ID:aBY0WEwU
I HATE HOW THE TAB KEY DOESNT GIVE ME COFFEE...
Name:
Anonymous2007-03-15 17:50 ID:Jw6QZtCm
function declarations and function definitions usually don't look the same
"using" is your friend.
Java owns teh sky
Java is crippled C++, it owns nothing.
Everything that isn't inline should be virtual by default
Moron. C++ has been designed so that your speed is not affected by features you don't use! virtual tables are too slow for some stuff. Everything that is not inline should not be virtual unless you need it!
Having to keep my headers and cpp files in sync when I change function argument lists
Interfaces are not meant to be changed once they are stable. Rewrite your shitty code instead.
polymorphism is over-rated. most people only use classes as a group of functions and fields
Just because people don't know how to use classes, polymorphism is overrated? You're another moron.
it's really just a convienence for the programmer
Dynamically allocated objects are just a convenience? You don't get it, do you?
It's not that iostream is broken, it's just plain ugly. And inconsistent
Ugly? No. Inconsistent? Where?
I switched to Java
You fail.
No prototypes
Enjoy your lack of features. Oh, I heard they cloned the template system, maybe next you'll have some pointers and multiple inheritance to play with.
What is void foo() = 0 supposed to mean?
It's a pure virtual method, it's in all the books.
You aren't allowed (...)
Yes you are.
D [is] suitable for everything from device drivers to enterprise scale applications
I hope this is a joke.
Name:
Anonymous2007-03-15 18:07 ID:F6tSDzbB
>>35 D [is] suitable for everything from device drivers to enterprise scale applications
Not yet it isn't.
It's a fantastic language (it really is!), and continues to improve at a dramatic pace, but it's immature. I'd only use it for personal projects at the moment.
Maybe in a couple more years.
Name:
Anonymous2007-07-05 6:56 ID:5HcRXN87
What I hate about C++ is templates, they need *proper* macros like scheme has.
>>22
I wouldn't, instead of wasting money on gold boullion tp i'd waste it on buying a country and building a secret underground evil lair, the nerd/geek/whatever they call us now's wet dream.
Name:
Anonymous2008-03-04 18:09
>>52 >>53
yes, that was intentional, u fag bitches
If you can't use strcpy, memset, memcpy, malloc, free etc. without causing segfaults and you're not a noob to programming CONGRAGULATIONS YOU ARE A FUCKING RETARD!!!
Seriously don't ever use any programming language ever again.
Name:
Anonymous2008-03-04 23:48
If you can't use MOV, Jcc, STOSB, CMP, STI, FADD etc. without causing double exceptions and you're not noob to programming CONGRAGULATIONS YOU ARE A FUCKING RETARD!!!
Seriously don't ever use any programming language ever again.
Name:
Anonymous2008-03-05 0:52
>>63,64
It's not that I can't do those things, it's just that I can do more work with less effort with a real language.
Name:
Anonymous2008-03-05 11:00
>>62
Don't like Windows? What's the matter? Too REAL OS for you?
>>74
Really? That's disgusting, what the hell was wrong with NULL? Too uppercase?
Writing 0 is mega bad, because it makes it impossible to tell at a glance that something is supposed to be a pointer type. With NULL, a variable, or an explicitly-cast direct memory location, it's plainly obvious that it isn't just an integer.
>>77
I'm referring to function calls, not plain assignments, and I think you are vastly underestimating the usefulness of a special keyword or macro to identify a pointer type.
Suppose you have a function mutate() which takes an array, its size, a scalar value to multiply each value, and maybe another array with which to perform an entry-wise sum. You know that with this particular API, which with you are only passingly familiar, that its functions all take an array and size as the first parameter, but beyond that, the parameters are less well-defined.
Now, if you see this function being used once as: int x[4] = {29, 315, 4929, 0};
mutate(x, 4, 0, NULL);
then you will be able to figure out that it's basically zeroing out the array. (Admittedly, this is a rather pedantic example, but suppose the values were not plain integers but rather some special type which could not simply be cleared out with memset, or perhaps this is running on special hardware where such an operation is faster than memset, etc.) Given your passing familiarity with the nature of the function, if you needed later to use this function to perform a scalar multiply, you could write mutate(x, 4, 6, NULL); and it would function as expected.
If, on the other hand, the code used 0 haphazardly instead of NULL like it should, you would be faced with the visually ambiguous mutate(x, 4, 0, 0); and you would need to either stop and look up the documentation or hunt around for the declaration in the header files (which, depending on the complexity of the system and the adequacy of the documentation, might prove to be a time-consuming task), or make a random guess at whether the first or second 0 was the pointer type.
>>75
If NULL is defined as ((void*)0) like in C, doesn't work in Sepples as void* can't be implicitly converted to other pointer types. Nowadays any decent implementation has it as defined as 0, though. And 0x is getting nullptr so all's good.
>>79 Or you could just mouseover mutate.
Over-reliance on a crutch provided by IDEs is absolutely no excuse for bad code. Next are you going to try arguing that no one should indent their code because you can bounce between brackets?
Also I just realized that I'm arguing with a Sepples programmer. IHBT
(And I find it hilarious that Sepples prohibits use of void * in place of another pointer type, but allows using int there. It's completely arbitrary and stupid.)
>>80
| Over-reliance on a crutch provided by IDEs is absolutely no excuse for bad code.
I wouldn't call a feature that saves me from "look[ing] up the documentation or hunt[ing] around for the declaration in the header files" a "crutch".
|Also I just realized that I'm arguing with a Sepples programmer.
( ≖‿≖)