What is better to learn, C# or C++?

One thing to consider here, while I know its a debate between all these .net languages and C++ and such is :

Java can run on any platform (ie : linux, mac, windows) if you consider what youre trying to do it might be you want to learn towards the java side JUST because of this.

(Note : when I say consider what youre trying to do, if these are programs you want to create to be able to use on a server or something (likely running linux) or a user that would be on a mac (visual app designers) or average joe(windows) java will be able to reach each of those platforms without issue.)

Aside from that I would say learn C# over VB just because it is generally more extensible in the long run, if youre ever going to break out of "garage programming" than it will be worth while. VB was one of the first language I looked at, and I have done back and forth programming for years I do respect VB for its simplicity in that (some people need it!). If you want to constantly find better, faster code an design you want to learn C++ because its FAR more extensible in that manner than VB of C#.
 
html > css > java > php > python(maybe?) > vb(or just c#) > c#(or just vb) > c++

would have been my road here except when I started css, java, php, C#... none of those existed (oh god Ive dated myself havent I).


and btw when he says java he is referring to javascript (which is not the java language itself) I would imagine, as java would be up there with C#/vb
 
would have been my road here except when I started css, java, php, C#... none of those existed (oh god Ive dated myself havent I).


and btw when he says java he is referring to javascript (which is not the java language itself) I would imagine, as java would be up there with C#/vb
yes, I should clarify. html > css > javascript > php > java > vb > c# > c++ would probably be the most logical path to follow if you want to do it right.
 
Don't bother with VB if you wanna go with C based language.

Now, between C# and C++? C#

It's the best of C++ & Java rolled into one. Probably the most in-demand language right now (among employers).
 
One thing to consider here, while I know its a debate between all these .net languages and C++ and such is :

Java can run on any platform (ie : linux, mac, windows) if you consider what youre trying to do it might be you want to learn towards the java side JUST because of this.

(Note : when I say consider what youre trying to do, if these are programs you want to create to be able to use on a server or something (likely running linux) or a user that would be on a mac (visual app designers) or average joe(windows) java will be able to reach each of those platforms without issue.)

Aside from that I would say learn C# over VB just because it is generally more extensible in the long run, if youre ever going to break out of "garage programming" than it will be worth while. VB was one of the first language I looked at, and I have done back and forth programming for years I do respect VB for its simplicity in that (some people need it!). If you want to constantly find better, faster code an design you want to learn C++ because its FAR more extensible in that manner than VB of C#.

I agree with a lot of the things you said, but I'd like to share some perspective of my own (and possibly some unique insight on top of these comments).

Interpreted languages by their very nature run over an interpreter and thus are cross platform. The interpreters are the architecture specific machines.

Also, Java is just a language. Java compiles into JVM byte code -- there are many languages that do this (Clojure, scala groovy, jython, jruby, rhino). Yes, the JVM is awesome. No, Java isn't a very good language. It lacks sufficient lambda calculus, higher order functions, it's overly verbose, it forces exception catching, it offers no native TCO (tail call optimization), it has no macro system, inflexible object orientation, the list goes on.

That said, I wouldn't touch a . net language with a 10 foot pole, even though there exists open compiler alternative.

C and C++ are extremely powerful and versatile, especially when you need precise memory management or a binary interface.

The question should really be about the differences between Java and C#, or C and C++, not C versus C# which are ENTIRELY different languages. C# is more comparable to Java than C.

Overall, C and C++ have fairly similar syntax, though there are some nice features C++ offers with respect to memory management, resource allocation, and garbage collection.

Since no one is willing to answer this question in detail...

1. C offers performance transparency over C++

2. C requires very little runtime support

3. C stack traces are easier to parse

4. C has a stable ABI

5. C pointers are more predictable

6. C offers complexity reduction over C++, more minimalist standard lib

Why would you use C++ over C?

1. C++ has objects (note: C++ it is not strictly object oriented as it does not force object oriented design! it simply -has- an object system)

2. C++ offers convenient abstractions for memory management (over malloc)

3. C++ has parameterized types via Templates

4. C++ has a richer standard library (example, no native strings in C)

5. C++ offers potential increased type safety

To name a few...

6. C++ offers virtual function calls and exceptions


Ok, since the OP did ask about C#, why would someone choose C#? Personally, I am not a fan of using C# for anything, however, I'll discuss the advantages of C# over C.

1. C# handles memory management

2. C# has a rich API

3. C# allows abstractions to avoid pointers, but still allows pointers

4. It's more platform versatile as it compiles to a CIL (intermediate language)

5. C# offers subclasses (and the option for object oriented design)

6. The order of function declarations doesn't matter

7. Increased safety with respect to lack of unscoped globals

8. Types have initial values (to avoid bogus default initializations from uncleared memory)

9. C# sandboxes for restricted development
(available in c++ too, more difficult in C)
 
Last edited:
I don't get this!

Why in the world would you use a programing language like C/C++/asm or similar to IM? sure you can protect them with systems like themida and similar but you will not have any use of memorymangement in that scale it makes it useful over RD languages like .net. You can do pretty creepy stuff with .net aswell that many C++ developers don't think is possible. head over to pinvoke.net and you find a lot of funny stuff to do.

Since this is a IM forum you seem to forget one important thing. Time is money. If you ain't gonna do some very special stuff that requires a lot from a computer go on and use a .net language and stop woundering if you should reinvent the wheel. Sure c++ and similar are better to know and are usualy more stable if the coder knows his stuff but don't even think of it as a newbie if you ain't gonna work with it for many many years.

I have been coding basic languages since my first comodore c64 that i got at christmas eve 22 years ago. I also know a bit of c/c++ and asm but uses it mostly for pic programing and similar.:croc:
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock