|
|||||||
This is a discussion on "Which is preferred?" in the Top Mud Sites MUD Coding forum : (it appears that nested quotes are broken :/) My opinion is mostly based on MFC, since just about every piece of C++ code I've seen MS put out was built using it. I do recognize that this was due to a bad initial design that they simply never recovered from due to their own backwards compatibility, but it does well to serve as a warning to others. Although I'm not fond of their bloated style of Hungarian either =).... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#61 |
|
Senior Member
|
(it appears that nested quotes are broken :/)
My opinion is mostly based on MFC, since just about every piece of C++ code I've seen MS put out was built using it. I do recognize that this was due to a bad initial design that they simply never recovered from due to their own backwards compatibility, but it does well to serve as a warning to others. Although I'm not fond of their bloated style of Hungarian either =). |
|
|
|
|
|
#62 |
|
Member
|
I got the whole backstory on MFC when I went and did a course in it. Some horrible decisions went into that. The recent ATL stuff isn't too bad, though.
And I don't like Hungarian, either. Kas. (edit: ATL, not AFX. And it's not that recent either, but what the heck). |
|
|
|
|
|
#63 |
|
Member
|
Oh yeah, to the OP: C++ is a multiparadigm language that is a near superset to C. The only reason I see to use C over C++ is the lack of a good compiler.
In summary, I would say to use C++, even if it's only as a "better C". Kas. |
|
|
|
|
|
#64 |
|
New Member
Join Date: Mar 2003
Posts: 23
![]() |
In my opinion:
Java is better than C++ is better than C. There's never a reason to use C except when you are forced. Or unless you want to name a variable "class" Thankyou. And goodnight. |
|
|
|
|
|
#65 |
|
Legend
Join Date: Apr 2002
Name: Richard
Location: München
Home MUD: God Wars II
Posts: 1,518
![]() ![]() |
In my opinion:
Bananas are better than oranges are better than apples. There's never a reason to eat apples except when you are forced. Or unless you want to eat your fruit without peeling it |
|
|
|
|
|
#66 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
|
#67 | |
|
Member
|
Quote:
Your statement on C is a non-sequitur; it has nothing to do with Java. My original statement is based that comparing C to C++ is not an apples-to-oranges comparison, since with a good C++ compiler, you can compile (with minor modifications) C. Kas. |
|
|
|
|
|
|
#68 | |
|
Member
Join Date: Feb 2003
Location: Bay Area, CA, USA
Posts: 39
![]() |
Wow. I haven't looked back here in, like, forever.
Quote:
compatibility: any two C compilers will produce *much* more similar output (in terms of what bugs occur, for instance) than two C++ compilers. You avoid the standard Java "write once, debug everywhere" problem :-) linking: you can link almost anything to a C library, and almost nothing to a C++ library. Name-mangling sucks. Yes, I'm aware you can use a lot of 'extern "C"' statements to get roughly this behavior, but that requires an extra layer of adapting your interface in most cases, which is slow, inconvenient and ugly. "C plus a layer of slow, inconvenient and ugly" is not "a better C". Debuggers and tools. Remember that discussion between Yui and me earlier about debuggers and tools? I still agree with all those things I said earlier. Remember those examples? They're still examples. The lack of a good compiler. You mention this one. "C++ isn't any slower than C with a good compiler, C++ isn't any larger than C with a good compiler, C++ compiles as fast as C with a good compiler", yadda yadda yadda. Show me a good compiler, anywhere, on any platform, and maybe we'll talk. Incidentally, most C++ compilers *do* catch more bugs than most C compilers, even today. GCC, at least with "-Wall" (which I always use, in both languages) is a notable exception. You can fix this by using a Lint program, though. I'd refer to C++ as "a larger, more complex C". Calling it a "better C" is something I still find amusing. Who still uses C in this day and age? Well, Palm, Broadcom and NVidia, to name my last three employers. Operating Systems companies don't like extra data being added in random places, and they need compatibility and linking. Hardware companies? Ditto, plus they need code that is fast, small and controllable. And people who really need things to work can't afford compiler bugs, and prefer older, better-tested languages. Alas, that's why some of them even use things like ForTran and Pascal -- for what they're doing, that's still the best available. Embedded software companies (Palm, Broadcom, VxWorks...) need stuff to be small, but also need to know where data gets allocated... All of these folks still, by and large, use C. It's not because of inertia. It's because C++ still honestly doesn't work as well for them. Is C++ a "better C"? Not for any of the kinds of companies I mention. That's why they don't use it, at least not for their core stuff. Palm used some C++ for non-handheld non-OS stuff, for instance, like their desktop software. Broadcom is being enough that I'm *sure* somebody there uses it, I only worked on their embedded set-top video and graphics stuff. On the other hand, is C++ a "larger C"? Yes, and not just in terms of feature set. That's why you don't see many C++ apps on the Palm :-) Palm apps are tiny, and C++ bloats that by a vast amount in very short order. I'm sure you can give me all the reasons that doesn't have to happen, in theory. In practice, that's what happens. Random aside: I'm definitely not Java's biggest fan, since it's a single-inheritance single-dispatch attempt at an OO language, and the bytecode is just *horrible*. That's why the repeated Sun attempts at a Java processor (one that runs Java bytecode directly in the hardware) have flopped so miserably. But I *do* thing that Java, language-design-wise, is a half-step up from C++. Or a half-step down from C. When Ghandi was asked what he thought of Western Civilization, he responded, "I think it would be a good idea." If you ask me about what I think of Object Oriented-ness in C++, I'd say, "I think it would be a good idea." :-P |
|
|
|
|
|
|
#69 | |||||
|
Member
|
(Reasons to use C over C++)
Quote:
Quote:
Some of the more powerful C++ libraries are also header-based, which means that there's no separate library to link against, meaning that it "just works". Quote:
Quote:
Quote:
But, for what it's worth, many companies also use C++ in their embedded software. It might be worth googling on "embedded C++" - a subset of the language considered by experts to be "safe" for embedded use. That said, embedded software has its own set of rules, and is not a perfect counterexample. So, in summary, I stand by my statement that there is no reason to use C over C++ except for the lack of a good compiler. |
|||||
|
|
|
|
|
#70 |
|
Member
Join Date: Mar 2003
Posts: 70
![]() |
Not having had time to read all the posts I may be wrong - but I think we are seeng the sort of religious fundamentalism that humans always seem to fall into:
My god is better than yours. My football team is better than yours. My language is better than yours. Try to convince a dedicated fan that someone elses team might be better, or a religious fanatic that perhaps someone elses beliefs might be valid. The truth is, as always, that there are different advantages and disadvantages to each - whether its a religion, a football team, or a language. Faith has very little connection with reason or logic. Personally I am agnostic - so apologies to any of the previously mentioned fanatics who now want to send me a rant to the effect that their football team really is better. Now on the subject of languages - there is a very simple reason why there are so many different languages out there, all being used for different purposes by different people. Each of those languages has something which makes it good for that purpose. Sure there are 'junk' languages too, but they all tend to die out and fall by the wayside - or evolve into something better. It's natural selection at computer speeds. Take the 'big 3' (Java, C++, C - lets ignore microsoft's attempts to muscle in with J++ and C#). Everyone has already said in great detail how their language is better than the other languages. Congratulations. You are all right. There are a number of situations where C is better, but there are also a number where C++ is better - and then others where Java takes the lead. There are even situations where Prolog is better - although I pity the poor programmers in that situation <shudders>. A lot of jobs can be done by all languages with roughly equal effectiveness. In those cases people will naturally choose the language they are most used to - since for them their knowledge of that language makes that the best for the situation. Someone familiar with a different language might well choose that language - and their choice is equally valid for them. One of my friends is a Java expert, while I am more a C/C++ man. Given a suitable challenge we would choose our own languages - but would produce equally valid solutions. So what I say is choose your Language/Team/God and live within the limitations that gives you - or remain agnostic and live your own life with the limits you set yourself and the language best for the task at hand. |
|
|
|
|
|
#71 |
|
New Member
Join Date: Feb 2003
Posts: 29
![]() |
Well, C++, the name, literally means, after this, C will be incremented (greater). Poor marketting choice. I should develop a C superset and call it ++C or (C+1) or any #### thing bug C++.
-Xanes -=- Lone Coder of WinterMute (curses for the masses) |
|
|
|
![]() |
| Thread Tools | |
Which is preferred? - Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Preferred Role Playing Level | enigma@zebedee | Advertising for Players | 27 | 04-23-2003 07:01 AM |
|
|