views:

434

answers:

8

Alright, so I just took an introductory class into Computer Science and the school's language choice was Java (I have basic knowledge of concepts like polymorphism, encapsulation, etc..). I want to learn C++ then C (I hear that one should learn C++ first then go to C), and was wondering if C# is a nice transitional language because of the language similarities between Java and C#. So will learning C# first help me get a better understanding of C++ later?

I appreciate any help. Thank you.

+3  A: 

If you already know Java, C# won't teach you much more about C++ than you already know.

CMerat
I think the point was that he wanted to transition to C; C++ was only a step on the way.
McWafflestix
Right, but my comment was with regards to learning C# before C++. With his java knowledge, he can simply go to C++ directly before going to C and he should be fine.
CMerat
+5  A: 

Doubtful. C# is not significantly more C++-like than Java. It does support pointers in unsafe code, but beyond that I can't think of any reason it would make an especially good bridge from Java to C++. Also that is a feature I suspect more likely to be used by developers coming from the other direction. If you have other reasons for learning C# I say go for it, but for the purposes of transitioning more easily to C++, I'd say skip it.

Logan Capaldo
Alright I just ordered two books from from Amazon (Buy 1 get 1 half off), first one is Sams Teach Yourself C++ and C++ Primer Plus 5th Edition. Thanks for your information.
Karan Bhamra
+4  A: 

I feel that the easiest transition from Java to C and C++ is to first start with C.

Get a feel for pointers and not managed memory.

Then, once you get a feel for the hard stuff in C and C++, tack on objects and the STL with C++.

That is how I learned, and it was a very easy transition for me.

jjnguy
C is closer to whats really going on, without digging too deep into the machinery. Understand that, and it will help you to understand programming in genera.
KarlP
Then learn some scheme and then some prolog :-)
KarlP
A: 

Always learn in the order things were invented, not other way around.

EDIT: The advise to first learn C++ then C is pretty insane... I mean C++ is a superset of C, once you've learned C++ there's nothing to be learned in C except what it lacks comparing to C++. It's easier to make sense of why things were added as language evolved rather than guess why weren't C++ features implemented in C.

zvolkov
-1 Start learning to write with cuneiform?
Thomas L Holaday
Thomas, if you're planning to learn BOTH cuneiform and its successor, then yes damn it. Thanks for the minus one, smart pants :)
zvolkov
@Thomas: It was implied that of the languages that you eventually /do/ want to learn, you should go chronologically.
Nikhil Chelliah
A: 

Java is object-oriented, C++ can be object-oriented, and C# is mostly OOP, but that is the main similarity.

C# has changed a great deal from Java so unless you look at C# for .NET 1.1 you will be learning a language that is very different from Java, and if your goal is C then you will be moving away from that.

C is a structured language, so the mindset is different than the other three, as you no longer have objects, and you have to worry about the memory collection yourself, no garbage collection.

Pointers was the hardest part of C for me to learn, once I understand that C was easy.

Once you know C, and if you already know Java, then C++ will have less to learn.

James Black
+3  A: 

Learn C first and foremost to get a feeling of dealing with unmanaged memory. Then apply what you have learned about object oriented concept to that unmanaged world with C++. Introduce yourself into differences of C++ like virtual methods, multiple inheritance and so on.

Read books about best practices. Learning C++ alone doesnt make you a C++ developer instantly. It is a federation of languages, you better have to know how to use that language.

Burcu Dogan
+2  A: 

Just learn C. Don't bother with "transitions"; if your goal is to learn C, just jump directly to it. Java shares enough syntax with C to be close enough that you don't need to worry about C++; you'd just get sidetracked with C++ things. C is important enough to learn on its own, without trying to "soften the blow".

McWafflestix
+2  A: 

If you are primarily interested in learning C++ do not learn C# because while on the surface they look very similar, in practice they are quite, quite different.

I highly recommend learning a programming language that does not use a managed memory system. The reason is because when you deal with such a language you are forced to learn the intricacies of memory management yourself. You can't rely on a garbage collector for anything really because it is up to you when objects/structs live or die.

C is a very small language and probably faster to learn than C++ but you may pick up bad habits from C if you ultimately want to use and learn a modern object oriented language. Learning C first is not a requirement.

My ultimate recommendation is go straight to C++ and get a feel for it.

Ralph