Should I Finish Learning Java Before Starting C or C++?
Asked by
MellowPine42
I'm a complete beginner and have been learning Java for about two weeks using an older edition of Liang's Introduction to Java. I'm currently working through the exercises in Chapter 7.
I'm planning to return to university for a computer science degree, and the program begins with Java, so learning it first seemed practical. Personally, though, I'm more interested in eventually learning C or C++. My goal is to work through most or all of the textbook before the spring semester so I'll be reasonably comfortable with Java when classes begin.
Would it be better to finish the textbook and focus on building a solid Java foundation, or should I start learning C or C++ at some point while continuing Java on the side? The university's third programming course uses C, but that is probably about a year and a half away because I'll need to complete two Java courses first.
Answers
You can switch whenever you want or whenever you have a practical reason to do so. Thereโs no universal deadline for starting another language, and experimenting with different languages can be useful. Just make sure youโre learning concepts and building programs rather than only collecting syntax.
Reply to this answer
Learning C and C++ at the same time can be confusing. They overlap, but they arenโt simply two versions of the same language, and some similar-looking features behave differently. When you eventually reach that stage, start with oneโprobably C, since your university teaches it firstโthen move to C++ after you have a solid foundation. For now, continuing Java and writing small programs is a good plan.
Reply to this answer
Your situation makes Java the sensible priority for now. Try to get through at least the core material, including object-oriented programming, rather than stopping after basic syntax. The later data structures and algorithms chapters could also be valuable practice before implementing similar ideas in C. You probably donโt need to spend much time on Java-specific GUI material if your main interest is eventually moving toward C.
Reply to this answer
There isnโt really a point where you โfinishโ a language, especially something as broad as Java. Since your immediate goal is to prepare for university, staying with Java until you have a comfortable grasp of the fundamentals is probably the least confusing approach. Once variables, control flow, methods, classes, and basic object-oriented programming feel natural, another language will be much easier to approach.
Reply to this answer
You could also begin comparing languages after several months by implementing a few small programs in both Java and C or C++. That gives you a feel for how the languages express the same ideas without forcing you to abandon your main study path. The right time is mostly determined by your goals, curiosity, and whether switching starts helping rather than distracting you.
Reply to this answer
Add your answer
Answers are reviewed before publication.
MellowPine42: By finishing, I meant completing the textbook rather than mastering the entire language. Iโm planning to keep working through the exercises, probably doing around two-thirds of them so I get enough practice.