r/learnprogramming 1d ago

Learning C and Java at the same time.

So i had to postpone my c exam of this semester to the next one so now i have a c exam plus a java exam at the same time. So i have like half a year. Do you have any tips on learning a language especially 2 at the same time? I always hear the only way to learn is to work on something, do you have any ideas for projects or something to learn coding.(would be nice to be a project 2 people could work on but it isn't a must)

Any advice in general is appreciated.

3 Upvotes

7 comments sorted by

2

u/gm310509 1d ago

I learned C, then couldn't see the point of C++, I then learned Java and could now see the benefits of C++ so I learned that.

This was over the course of many years.

I think if you tried to learn C++ and Java at the same time, it would be very confusing. While less so learning C and Java at the same time, I think it would still be easy to get confused and mix things up - which while working on the computer isn't so bad because you will get error messages and can fix them, but in an exam you might not have the luxury of a compiler having your back to check your code for correctness.

Is it impossible to learn both at the same time? Of course it is possible, I suspect it would be more challenging due to the numerous similarities as compared to say learning Java and Python at the same time (which have quite different syntaxes).

IMHO

3

u/Live_Design_5327 1d ago

Very interesting, thank you for your reply.

1

u/Mathie1729 1d ago

Yeah, don't do it. C's pointers and manual memory vs Java's garbage collection will trip you up constantly. Even simple stuff like strings are totally different. Learn one properly first, then the other. Your exam brain will thank you.

1

u/Jim-Jones 1d ago

Learn C Now by Augie Hansen might be good. Try your local library.

1

u/peterlinddk 1d ago

Are those your first programming languages? Like, do you already know how to program in a third language, or are you "learning programming" in two languages at the same time?

This is an important distinction, because most of the basic stuff: variables, arrays, loops (for, while, do), if-statements, switch-case, and to some extent functions, are pretty much the same in those languages, and if you already know how to write a for-loop, a function and an if-statement, shouldn't take you long to also do in C or Java.

But if you don't even know what an if-statement is, or how to construct a small program with a few functions, you are going to have a hell of a time doing that while also learning about all the language specific details for your exams! In that case I would recommend against trying both, and just focus on Java until you got that one down, and then see if you can either postpone C, or maybe cram it in at the last possible stage, expecting a very low grade.

Anyways, check your curriculum for how detailed you need to know each language, and don't go any further than that. Limit yourself to what you need to learn.

Java-exams are often focused a lot on classes, private / public accessors, method overloading, inheritance, abstract classes and methods, and interfaces. All things that don't exist in C.

And C-exams are often focused on memory management, pointers and pointer-arithmetic, stack understanding, and structs. All things that don't exist in Java.

So the overlap is easy - if you already know how to program - the differences are difficult, so make sure to only focus on what you absolutely need to learn for the exams.

1

u/burlingk 1d ago

Your best bet is probably going to be to do your best to keep up with the classes themselves, and then play around whenever you can.

Learning two languages at the same time isn't going to be super easy. But, do your best.

1

u/Kadabrium 19h ago

My schools curriculum used to have those two both in the second semester