PDA

View Full Version : C or C++



Pages : [1] 2

Garfield
10-21-2001, 12:30 PM
Choose -- C or C++ or both

Garfield
10-21-2001, 12:31 PM
I choose C. LONG LIVE C.

--Garfield

Pendragon
10-21-2001, 01:11 PM
C++ was my first language. I'm most comfortable with that than C.

Aran
10-21-2001, 01:27 PM
i love C++. may it live long and prosper.

Troll_King
10-21-2001, 01:56 PM
Definately both. C++ is more fun to work with because the code is more ellegant and managable, and C programmers still own the muscles.

Garfield
10-21-2001, 02:19 PM
> C programmers still own the muscles.
Don't forget that.

Aran
10-21-2001, 05:40 PM
last time i went to the supermarket, they weren't selling muscles...unless, of course, you are talking about those little black clam-like things.

Aran
10-21-2001, 07:44 PM
that was proof:
C++ is all you ever need to know.

Garfield
10-21-2001, 07:44 PM
I don't get it, gamegod. What does that mean?

Garfield
10-21-2001, 07:45 PM
> C++ is all you ever need to know.


C is all you ever need to know.

Aran
10-21-2001, 07:49 PM
well, you don't need one for the other, and C++ is much more versatile and i like it more than C, so, it is all you need to know.

Garfield
10-21-2001, 07:52 PM
> i like it more than C

I LOVE C. C is the perfect language. Leading in development.

But, we are allies (C and C++). We do not fight. We fight others (Visual Basic preferably). Let us unite.

Join the C force!

--Garfield

Aran
10-21-2001, 07:54 PM
Yes, down with the evil microshaft powered machine that is VisualBasic! C languages forever!

Garfield
10-21-2001, 07:59 PM
> get it?
Yeah. I don't think it's great though. I LOVE C.

> Yes, down with the evil microshaft powered machine that is VisualBasic! C languages forever!
Yes, let us unite against the evil forces.

SilentStrike
10-21-2001, 08:01 PM
Each langauge has their own uses, but C++ can do pretty much everything C can do, and do more.

Aran
10-21-2001, 08:01 PM
they don't stand a chance against our cumulative millitary might.

Garfield
10-21-2001, 08:02 PM
> they don't stand a chance against our cumulative millitary might.

C/C++ OVERPOWERS!!!

--Garfield

Aran
10-21-2001, 08:07 PM
We have the Neutron Bomb, we have the A-Bomb, we have Anthrax, we have Seryn Nerve Gas, we have the Suplex, we have the Powerbomb, we have The Rock on our side. We shall be victorious.

oskilian
10-21-2001, 09:00 PM
I use both, even sometimes in the same program!

like this

for(int a=0;i<100;i++) //You can only do this on C++
{
printf("%d",a); //This is C (well, I think)
}

or maybe

int b;
for(b=0;b<100;b=b+1) //I'm not really sure if you can use ++ in C
{
cout << b; //This is C++
}

but I definetly use classes, specially for windows programs

Oskilian

Troll_King
10-22-2001, 12:26 AM
Without C there would be no such thing as C++. Also C is undeniable because it is the native language of the operating system. It is the most powerful language. The great thing about C++ though is that it is a much better language for developing high level applications because of the OOP design, basically comes down to better program design, except not for low level programming!

EvenFlow
10-22-2001, 03:10 AM
Ditto that Troll_King. Couldn't have said it better myself.

SilentStrike
10-22-2001, 08:30 AM
"Also C is undeniable because it is the native language of the operating system"

I didn't know this. So then there were no operating systems before C came around? Nor are there any operating systems not written in C?

I was also under the impression that you could do all the low level stuff you wanted with C++.

mix0matt
10-22-2001, 09:27 AM
i just want to say to gamegod:



struct A {
int a;
int (*member_b) (); //pointer to function
};


functions as class members is hardly the main advantage of C++ over C. As you can see, the same effect is accoplished using a C compiler with the above code...

SilentStrike's right, you can do anything in C++ that can be done in C. Performance hits are insignificant, and depend largely on the programmer. i've sure seen some pathetically slow crap written in C. Plus the hits are basically insignificant when you weigh the advantages of OOP. This arguement is tired. Why do people resist inovation? C++ has been around for almost twenty years, and yet people still don't understand it's benefits.

Troll_King
10-22-2001, 10:09 AM
Name an operating system that isn't written in C?

Garfield
10-22-2001, 01:04 PM
> i've sure seen some pathetically slow crap written in C

This is not the language, it's the programmer. If the programmer write efficient code, then the program runs fast. If he doesn't, well then it won't run fast or how you want it to. This has nothing to do with the language.

Aran
10-22-2001, 01:52 PM
well.. it does depend somewhat on the language, i.e. DarkBasic, the slowest piece of programming babble every set for to the world. or think of assembly, that will run faster optimized than C optimized with the basic same amount of code.

i dunno, i'm not an expert on this. I'm sure some of you guys can prove me wrong.

Garfield
10-22-2001, 01:58 PM
> DarkBasic

Oh, I've never heard of that version of BASIC. How many versions are there? And why?

--Garfield

Aran
10-22-2001, 02:03 PM
> and why?

My thought exactly.

BASIC is dead! live with it!

Garfield
10-22-2001, 02:27 PM
> BASIC is dead!

After C was designed, BASIC never lived.

Aran
10-22-2001, 03:00 PM
hehe.. people should write stuff in the form of C, not in the form of basic.
I'm sick of working with sucky basic clones that promise lots but never work out.

mix0matt
10-22-2001, 04:18 PM
<This is not the language, it's the programmer. If the programmer write efficient code, then the program runs fast. If he doesn't, well then it won't run fast or how you want it to. This has nothing to do with the language.>

yeah, that' s pretty much what i was trying to say. Maybe i was unclear. Those who still hold on to C-style code often say that C++ is bloated and slow. That C holds the real "muscle". I was simply saying that this was not correct. As you correctly point out, the programmer impacts the speed and size of the code far more than the choice between C and C++. C++'s obvious benefits outweigh the insignificant performance issues.

ggs
10-22-2001, 04:22 PM
obvious benefits?

c can do most of the things c++ does just as well creating an executable that will at least match the speed of the c++ equivalent :)

a lot of the stuff you use in c++ you don't really need...

mix0matt
10-22-2001, 04:40 PM
<a lot of the stuff you use in c++ you don't really need...>

I need all the stuff I use in C++. Your response pretty much proves my point. Those who defend C by saying the added tools in C++ are pointless don't really understand Object Orientation. They simply see as a useless obsticle--something else to learn.
I don't know what they're doing in Canada, but in the US (form what i'm told in school anyway) a majority of Software Engineering utilizes OOD&P which is the "useless" stuff C++ adds to C.

ggs
10-22-2001, 04:50 PM
I've learned a bit about oop. Certainly useful for data containers. Inheritence of all types looks complex and useful when seen in source files.

Given that it can sometimes be nice to drop in, for example, an HTTP_PI object into your code to give instant http protocol interpretation, and it will look good, but really it's a choice of using functions as arguments to data and using data as functions of arguments, if you see what I'm saying...

http_pi inst;
inst.interpret(request);

vs.

http_pi inst;
http_pi_init(&inst);
http_interpret(&inst, request);

the top is shorter and the code sort of directly translates to how things would work in the ideal world (dropping objects into bins to make programs :/), I prefer the bottom in a lot of cases because then I see *everything* that happens, I know how every bit works and everything is coming together.

And how do you replicate the kind of neat stuff that dup2 and fork() have to offer with streams, eh? :)

zen
10-22-2001, 05:08 PM
a lot of the stuff you use in c++ you don't really need...

You don't have to use it, but with C++ you've got the option.


I prefer the bottom in a lot of cases because then I see *everything* that happens, I know how every bit works and everything is coming together.

If you wrote the http_pi class then you would, but if it was part of a third party library then you've no need to know exactly how it works. If you were using a third party c library you probably wouldn't know what was happening in the functions.

ggs
10-22-2001, 05:15 PM
I'm thinking more like in terms of specifying every action.. every allocation, every free. Sorta prefering to keep track of my own pointers rather than let the garbage collector do it, that's the sense I'm talking about.

zen
10-22-2001, 05:19 PM
You do specify every action, but within a class (if you want to use classes). C++ doesn't have an in-built garbage collector.

mix0matt
10-22-2001, 05:57 PM
ggs,

check out the following link on the encapsulation of fork and dup2:

http://www.csse.monash.edu.au/~damian/Idioms/Topics/08.2.Interproc/html/text.html

Aran
10-22-2001, 06:24 PM
you know what? i think in OO terms, so C++ is a better choice for me... it better suits my lines of logic and i work better with it. I'm not saying that you should all of a sudden denounce your previouse relations with C, all i'm saying is that it's better for me, and i prefer it and benefit from it. Just be smart.

Breach23
10-22-2001, 07:07 PM
Hmm...In my opinion, they're almost alike, except C++ has classes...No offense to C users...But I like C++ better. :)

Aran
10-22-2001, 07:10 PM
join the club, brother

Aran
10-22-2001, 07:20 PM
de-ja-vous... i remember seeing that exact same post before in this thread... i'm allitle too lazy to look back and post a big "a-hah, i havst found thee!" thing...

i guess that's just too bad for you.

mix0matt
10-22-2001, 09:56 PM
<I knew about pointers to functions, I think it is slopy, to point to your function.>

i agree, it's much nicer to let the technology (compiler) do the nasty work for you. I was simply saying that functions can be "grouped" within structures using C, and there's more to C++ than member functions...;)

Nick
10-22-2001, 11:01 PM
Whatever you do, do not ever choose assembly!

Troll_King
10-22-2001, 11:22 PM
Actually I voted for both, not one or the other. Also I've had enough with the nonesence attacks on me. My points still stand. All major operating systems in the world were written in C except for a few high level components. The system API is written in C (Win32). These are the facts of life.

As far as C++ goes, no it is not a managed language. This means that the programmer has the freedom and vulnerability of managing his own code. There is nothing built in to fix your mistakes. Also, I know OOP. I have used encapsulation, inheritance, and polymorphism. I am currently reading 'Effective C++ second edition'. I would rather work with objects than having to document the flow of data and processes through the whole program. It's easier to work with objects. The code is also less redundant. I intent to write high level applications. C++ or even perhaps a managed language like C# would be my choice, but I would hate to go without C because it is necessary to know your operating system and the sytem API.

Just like I voted for both, I intend to use both! Never have I stated anything different.

mfc2themax
10-23-2001, 05:23 AM
Screw C and C++ everyone knows that VB rules!

VB!

VB!

VB!

VB!

*Hey, who are you?*
*What? You say C++ rules?*
*VB is better!*
*What are you doing with that acid?*
*Hey get that away from me!!!*
*AHHHH!!!!!!*


I voted for both.... love them both.

oskilian
10-23-2001, 12:54 PM
Originally posted by Nick
Whatever you do, do not ever choose assembly!

why?

and by the way: I like all programming languages because each one is good for one thing, for example, VB has a very good Database capabilities, and Assembler is very good too, specially for writing fast programs. C is good for DOS programs (and maybe windows too), and C++ is very OOP.


Oskilian

Troll_King
10-23-2001, 12:58 PM
C is good for DOS programs (and maybe windows too


Is this a joke?

zahid
01-09-2002, 03:07 AM
C is my first language and still I'm confident about C.
But in future I will love to programme in C++ because of the OOP implementation. I'm learning C++.

I think C family (C & C++) is the super power in Programming Language and I guess will remain at least 10 years more.

ihsir
01-09-2002, 04:27 AM
since C++ is a modified/enhanced/extended version of C i'm sure there shouldn't be any doubts which is the better one.:)



The bottom line [imho] is
C++ RULES