C or C++ or C# or ???

Parky

Fledgling Freddie
Joined
Feb 28, 2004
Messages
7
Hi all,

At the momo i am learning c++ and have some bit of experience with making some programs in it.
But there is one question that comes to my mind,
why C programmes say c++ is bad, and reverse and what-where-... is C# ?
 

sibanac

Fledgling Freddie
Joined
Dec 19, 2003
Messages
824
Parky said:
Hi all,

At the momo i am learning c++ and have some bit of experience with making some programs in it.
But there is one question that comes to my mind,
why C programmes say c++ is bad, and reverse and what-where-... is C# ?
C# is basicly microsofts version of java
c and c++ programers will gladly tell you why their version is better then the other for hours.
Thruth is that they both have their pro's and con's.
For some applictions C is a better choise for others C++
 

fatbusinessman

Fledgling Freddie
Joined
Dec 22, 2003
Messages
810
The advantage of C/C++ is that you have the flexibility to control how the program operates at practically the machine instruction level.

The disadvantage of C/C++ is that you have the flexibility to control how the program operates at practically the machine instruction level.

Personally, I'd suggest using something higher-level like C# (or Java) for most programming tasks.
 

Danya

Fledgling Freddie
Joined
Dec 23, 2003
Messages
2,466
C programmers dislike C++ because they feel the object orientation obfuscates code and makes things needlessly complicated.

C++ programmers dislike C because they feel the lack of object orientation obfuscates code and makes things needlessly complicated.
 

Misleath

Fledgling Freddie
Joined
Feb 8, 2004
Messages
587
If you have the time and will best is, in my opinion, to learn both C and C++. The reason to learn both is to better find out which suits you best and see for yourself how problems are solving in procedural- (hope that is the correct english word) and object-oriented programming. That way you can build your own opinion about them, they are both useful.
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
Well, I'm now officially a full time C# programmer, and to be honest have no trouble recommending it.

To clarify, C# is Microsoft's "current" language. It's the main language for programming in .NET with and it is very Java-ish by design (the lower level similarities between Java and .NET have a part to play in this). You can do some wonderfully elegant things with it and the .NET object model makes for nice tidy code, but while still using a "C"-ish syntax (which is used in most places, c.f. C, C++, Java, PHP, Perl... basically not Delphi/Pascal or VB).

I'd certainly recommend it, but then I do it for a living...
 

Parky

Fledgling Freddie
Joined
Feb 28, 2004
Messages
7
another question about C#,

can you make programs with it for OS like linux and stuff because knowing microsoft they only make stuff compatible with windows only...
 

fatbusinessman

Fledgling Freddie
Joined
Dec 22, 2003
Messages
810
You can only (I believe) run C# programs on a system with the .NET framework - Microsoft has, of course, only produced this for the various forms of Windows.

However, there's a project around called Mono which implements the .NET platform under Linux. Couldn't comment on whether it's any good or not though...
 

Oidche

Fledgling Freddie
Joined
Jun 22, 2004
Messages
41
I must agree with Shovel. I come from a Java background (I also 'know' C(++), and it's just plain ugly IMHO), and started programming in C# about 2 years ago. Franky, C# is Java done right. It has all the good features of Java (easy of use, high level, big API, garbage collecting), none of the 'problems' (inconsistencies in the API, slow), and a lot more features (enums and delegates anyone?).
 

Danya

Fledgling Freddie
Joined
Dec 23, 2003
Messages
2,466
Really you should learn all of them - there's no one best language for all jobs, having knowledge of a broad range of languages and techniques means you can pick the best one for the job, rather than trying to shoehorn your problem into the framework of the language you are familiar with.
 

Linnet

Fledgling Freddie
Joined
Dec 23, 2003
Messages
412
Danya said:
C programmers dislike C++ because they feel the object orientation obfuscates code and makes things needlessly complicated.

C++ programmers dislike C because they feel the lack of object orientation obfuscates code and makes things needlessly complicated.

Speaking as a C coder (yeah, we exist, we mostly do low level stuff ime), I don't actually agree. C++ coders do tend to absolutely detest C because ... they don't understand it. Pointers, and stuff like having to write your own data structures confuse their tiny minds, etc :)

C coders who are any good need to keep a fairly strong structure to their work and are quite quick to spot where OO techniques can really help with that. The received wisdom I have had from consultants at work is that it is ten times easier to teach a C coder to work in C++ than the other way around.

(We're mostly moving to C++ anyway these days, even firmware tends to come with C++ compilers now.)


Having said all that, I am VERY VERY glad I no longer have to program production code in assembler. It was kind of fun in a sort of 'doing cryptic crosswords is fun' way, but higher level languages are great!


To answer the question, I'd say that C++ is a good thing to know. (You'll end up learning C anyway when you pick C++ or C# up, but don't spend too much time programming in pure C). I'd also really recommend learning your way around the standard template library for C++ and picking up the Design Patterns book. It'll take you awhile to really grok it, but it's very very very useful.
 

Danya

Fledgling Freddie
Joined
Dec 23, 2003
Messages
2,466
Linnet said:
Speaking as a C coder (yeah, we exist, we mostly do low level stuff ime), I don't actually agree. C++ coders do tend to absolutely detest C because ... they don't understand it. Pointers, and stuff like having to write your own data structures confuse their tiny minds, etc :)
Any C++ coder of any worth knows pointers inside out as they are essential for doing any OO in C++. Anyone who can't write their own data structures isn't really a coder tbh. ;p

FWIW I'm a C coder who knows C++. ;)
 

Wij

I am a FH squatter
Joined
Dec 23, 2003
Messages
18,404
C++ is often unreadable to anyone except the original coder. Such a pain to work out which class a function call resolves into. Inheritance and polymorphism and such. Nice idea but try reading somone else's garbage to find out where an error is and you will want to kill Bjarne Stoustrup (or whatever his name was). C 4tehwin. C++ 4tehsux. C# 4tehneedtogetatrainingcoursetodointerestingjobs \o/
 

Users who are viewing this thread

Top Bottom