Question:
What flavour of C is best?
robcheerio
2009-05-11 03:32:58 UTC
I can write programs in PERL and VB and I know a little PASCAL I would really like to learn C but there seem to be lots of different versions C++, C#, managed code, unmanaged code, .NET - which is the best path to go down when starting from scratch?
Seven answers:
2009-05-11 05:12:14 UTC
Ok, some clarifications from someone that has been developing C, C++, C# for many years (started with C in 1973). C/C++/C# are slightly different languages but they all start from C. C++ enhanced C by adding support for classes and objects native to the syntax of the language itself. You can take C code, put it into a CPP file and it will still compile. Some additional libraries were developed by third parties for C++ (e.g., standard template) but these are not part of the native language.



C# is a new iteration of the C language, from C++ developed by MS explicitly for the purpose of providing support of the .NET platform. It enhanced C/C++ by adding connection for CLR in .NET, adding data types, etc. It also got rid of the separate .h/CPP pairs.



C++ is more challenging over the languages you mentioned because of the OO flavour. C#, for people w/o C or C++ can more more challenging because of the OO but also primarily because of the extensive additions brought in by the .NET support. Note: C# is a .NET only environment.



Also, managed or unmanaged code is only meaningful when you talk about .NET languages as it talks about code that is not reliant on the CLR and loses some of the features like garbage collection.



Now, which should you start with? If you just want console applications and perhaps some Windows. I would strongly suggest starting with C++ what you learn there will help you go in either direction (C or C#) and it is very important to learn OO development. For windows development take a look at MFC as it will give you a stepping stone understanding for C#. What you learn in C++ would help you understand JAVA also.



If you are only going to do Windows, ASP.NET, etc. programming then go right to C#. The environment is much better and developing applications is a lot quicker. There is a great book from O'Reilly Press called Programming C# 3.0 which I find a good beginner's bible.



Hope that helps.
Bob M
2009-05-11 14:51:59 UTC
C# is not C++, I know I will make some cross saying this, but really C# is just Visual Basic with a different syntax. (ok, bring on the hot oil and feathers, but first have a look at the intermediate code of VB and C# and tell me where the difference is. There are both taken to the same pcode type language.



So really for flavours of C you have these,



C - Good if you intend to go for embedded, though many a modern hardware does have at least some OO qualities to the compilers. Particularly those that make use of g++.

C++ - Great for desktops and factory application work. There are times when you just need those pointers. But also high level graphics for gaming you really do want a clean base and will only get that with C++.



Java - It is to all intents and purposes C++, just with different libs thats all. It is truely cross platform, with little difference between writing client applications ran locally and web applications. Get yourself NetBeans get the various Java and desktop extensions.



Some really good tutorials on their site too, some of which actually work. Sorry, it is true that some of their tutorials will not only not work but also will not match the Netbeans IDE that you have loaded. Documentation tends to be 5 years behind in Netbeans world.



But the IDE is great and there are much better Java tutorial sites scattered around the internet.
koppe74
2009-05-11 11:01:27 UTC
C, C++ and C# are different languages - not just flavors - though C inspired C++, and C++ inspired C#. In addition, there is objective-c... and alternative to C++ for OO-programming with C.



If I could choose, I'd go for C++. You get (almost) all of the features of C, but also object-orienting and those nifty class-libraries. And you can still forgo object-orienting and just do structured programming.



That said, *starting* with C - or at least purely *structured* C++ - before moving onto the object-oriented side of things.
?
2009-05-11 10:55:07 UTC
C++ and C# are completely different languages than C. If you don't know OOP then start with C and perhaps later you can consider C++. Don't bother with C# - it's Microsoft-only.
2009-05-11 14:07:32 UTC
Learn the 3 of them, C, C++ and C#, they are different languages.

If you want to laern from easy to difficult then

C# -> C++ -> C
ibex
2009-05-11 16:13:52 UTC
...if you wanna to start from scratch,then start withc++.
Ashu
2009-05-11 10:46:19 UTC
i think you should go with c or c++


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...