by BhaaL on Tue Feb 17, 2009 1:24 pm
([msg=18109]see Re: C or C++[/msg])
Association of C# with M$ is most likely due to the bounds to the Microsoft .NET Framework.
But this does not mean M$ invented C# or owns it of some sort. The major implementations of C# are from Microsoft (based on the .NET Framework/CIL Infrastructure) and from the Mono Project (on Mono, an Open-Source implementation of the CIL Infrastructure/ECMA-335 with some backing of Novell). I do not know any other C# compilers other than those, but it does not necessarily always mean "it's M$!".
C# is a pure Object-oriented language, and could be compared to Java of some sort (Java is compiled to bytecode and interpreted in the JavaVM), with the minor difference that interpretation/compilation are slightly different (Just-in-time compilation to native code vs. VM). Both abstract the low-level things away and let you take care of what matters: the "what" of your code, and not the "how".
C is more or less purely procedural, and rather low-level. Pointers to memory, no nifty features like garbage collection, and all that stuff. C is nice-to-know anyways, since a large variety of other languages has its syntax based on or derived from C syntax. PHP looks like C in some way, Java does, also C#, and many others. Using it however is a bit more difficult, since you have to do everything yourself - no strings built-in, take care of memory allocation and deallocation afterwards, and forget a check to see your app blow.
C++ is more like a mix of the two worlds. It looks like C, as the creators aimed for/were driven to "be backwards compatible" to C. Use C-Code in C++, works all the way (with minor fixes, if any). Mix in some sort of object-oriented stuff, call structs "classes" and let the coder add methods to it. Look, its an object! C++ provides new features, and keeps the "problems" of C - no garbage collection, and you still have to take care of your memory.
Saying "C++ is better than C" always depends on what you want to achieve with it. If you want slightly easier development, since someone already took the work of creating a linked-list (stl vectors for you), you might take C++. No need for objects, attaching methods to them, or encapsulation of data that provides some sort of (fake) access control, you might go with C aswell. Theres nothing you can do in C++ but can't do in C (classes are just structs, member methods become "static" methods that take the struct explicitly, templates can be written as macros, etc etc).
It's all a matter of taste. Some say C++ is bloated, C is error-prone, C++ is superior, C is superior, C++ is bad, C is bad. They're all right in some way, and also wrong.
If you want to learn a language, and know zero-to-nothing, you might want to start off with C# at all. Friendly IDEs (SharpDevelop for Linux, Visual C# Express for Windows) that help you, fairly good documentation (even if its M$/MSDN, it does help!) and gets you started quickly - also gets you done quickly, as you don't have to focus on memory allocation, range checking, all that stuff (not quite correct, but this explanation suffices for now).
Knowing another language, but not being familiar with C/C++ Syntax, you might want to start with C; and get through procedural stuff first. It should teach you the basics about memory management, pointer arithmetics, and why something happens if you write a line of code.
Starting off with C++ is not the best way to get into coding, unless you really want to push your luck.
Feel free to pm me with your random rants about it, I'll silently ignore them. Questions, just ask.