Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 05-06-2003, 08:26 AM   #61
Yui Unifex
Senior Member
 
Join Date: Apr 2002
Location: Florida
Posts: 323
Yui Unifex is on a distinguished road
Send a message via ICQ to Yui Unifex Send a message via AIM to Yui Unifex
Question

(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 =).
Yui Unifex is offline   Reply With Quote
Old 05-07-2003, 12:07 PM   #62
Kastagaar
Member
 
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
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).
Kastagaar is offline   Reply With Quote
Old 05-09-2003, 07:39 AM   #63
Kastagaar
Member
 
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
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.
Kastagaar is offline   Reply With Quote
Old 05-09-2003, 09:56 AM   #64
Tamsyn@zebedee.org
New Member
 
Join Date: Mar 2003
Posts: 23
Tamsyn@zebedee.org is on a distinguished road
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.
Tamsyn@zebedee.org is offline   Reply With Quote
Old 05-09-2003, 10:04 AM   #65
KaVir
Legend
 
KaVir's Avatar
 
Join Date: Apr 2002
Name: Richard
Home MUD: God Wars II
Posts: 2,052
KaVir will become famous soon enoughKaVir will become famous soon enough
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
KaVir is offline   Reply With Quote
Old 05-09-2003, 11:15 AM   #66
Yui Unifex
Senior Member
 
Join Date: Apr 2002
Location: Florida
Posts: 323
Yui Unifex is on a distinguished road
Send a message via ICQ to Yui Unifex Send a message via AIM to Yui Unifex
Question

Quote:
Originally Posted by (Tamsyn@zebedee.org @ Foobados)
In my opinion:
Java is better than C++ is better than C.
Java is an interesting language. It has some higher-level constructs that C++ lacks, but it's always tieing your hands behind your back in the name of safety. So it actually suffers from some of the same problems that C does which I talked about earlier, particularly that of operator overloading. It all reminds me of this slide from a talk given by a Perl programmer. The entire list of slides makes for some pretty good reading, too =).
Yui Unifex is offline   Reply With Quote
Old 05-09-2003, 11:39 AM   #67
Kastagaar
Member
 
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
Quote:
Originally Posted by (Tamsyn@zebedee.org @ May 09 2003,14:56)
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.
Java's fun; it's simple and has many features. If its designers would lighten up a little bit wrt templates and operator overloading, it would be the best language in the world.

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.
Kastagaar is offline   Reply With Quote
Old 05-30-2003, 01:53 PM   #68
angelbob
Member
 
Join Date: Feb 2003
Location: Bay Area, CA, USA
Posts: 39
angelbob is on a distinguished road
Wow.  I haven't looked back here in, like, forever.

Quote:
Originally Posted by
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".
My favorite reasons to use C instead of C++ are:

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
angelbob is offline   Reply With Quote
Old 06-06-2003, 05:52 AM   #69
Kastagaar
Member
 
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
(Reasons to use C over C++)

Quote:
Originally Posted by
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 :-)
I can't say I've found a C++ compiler that, after having successfully compiled and linked, did not produce the expected output.  What I have found is that some C++ compilers do not implement portions of the langauge.  MSVC++ 6 does not support template-templates, for example.  There is a set of C++, however, that is implemented by all C++ compilers, though, and it is possible to stick to this.

Quote:
Originally Posted by
linking:  you can link almost anything to a C library, and almost nothing to a C++ library.  Name-mangling sucks.
I link to C++ libraries quite often, actually.  But in general, in either language, you only link against a library compiled by your own compiler.  In some cases, there are tools to help (Borland C++ has a tool to convert libraries between Borland and MS formats, for example).

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:
Originally Posted by
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.
What, that you "can't debug operator=() because the only way to track an error is to throw an exception"?  Have you ever even looked up the rules of exception safety?  Come back when you can tell me what the "strong exception safety guarantee" is, and why it would apply to this operator.

Quote:
Originally Posted by
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.  
Sure, MSVC++ is a pretty good compiler, despite its language support.  I suspect MSVC++.NET is pretty good too.  GNU C++ will, when compiling C-like code, will produce the same output as GNU C (tested as of version 3.2).  Except with better type checking, the ability to use *_cast<>, etc.  This is why you can use it as a "better C"...

Quote:
Originally Posted by
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.
The language is a better C.  But compiler support (sigh) is still lacking in some departments.  Such as compilers for proprietary platforms.  C, the compiler, is relatively easy to write.  C++ has many more features, and is a far more expressive and powerful language, and this is how it pays.

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.
Kastagaar is offline   Reply With Quote
Old 06-06-2003, 08:03 AM   #70
enigma@zebedee
Member
 
Join Date: Mar 2003
Posts: 70
enigma@zebedee is on a distinguished road
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.
enigma@zebedee is offline   Reply With Quote
Old 06-13-2003, 12:20 PM   #71
xanes
New Member
 
Join Date: Feb 2003
Posts: 29
xanes is on a distinguished road
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)
xanes is offline   Reply With Quote
Reply


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 08:01 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 03:23 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014