tags:

views:

1758

answers:

15

I'd love to start writing Android apps. That's apparently all in Java. Programming jobs on Craigslist are at least 100 Java to 1 C++. I want to learn Java.

Unfortunately, the CS program I'm considering teaches C++ rather than Java, so C++ is what I'm learning. (I'm sure learning C++ will teach me to code well, but so would Java, and then I could get a job. It's frustrating that CS programs stick with languages they've used for 20 years instead of teaching languages that will help their students succeed.)

My question is whether it's a good idea to crack open the Java books on my shelf after I finish my C++ homework. Will I just end up confused, or will I end up better at both? Has anyone learned both C++ and Java simultaneously?

Edit: Thanks for all the quick answers! I've done some programming and I pick up languages easily, I think. Comparing side by side does appeal to me. But I also tend to bite off more than I can chew, and learning C++ and Java both seems like the kind of big meal that could get me in trouble.

+1  A: 

If you haven't programmed before just learn c++. It has most basic things that JAVA has plus a bit more. When you have got to grips with C++ JAVA will be easy.

John Nolan
+3  A: 

There aren't necessarily more Java jobs than C++ jobs, it varies greatly from region to region; where are you looking?

I think that C++ is a great foundation, and that learning Java would be easier once you know C++, and that it is generally an easier language to learn. If you have the aptitude for programming, you can learn both languages at the same time.

However (and that's a big however), if most of the actual programming you do at school is in C++ (homeworks, projects, etc.), and Java is something you'll do as a hobby and less frequently, you will end up being better at C++.

When you go to job interviews, it's better to be good in one language than to be mediocre in both.

Uri
A: 

Learning any number of different languages is always good practice. It can help you better absorb the concepts and theory behind what you are learning rather than focusing on the syntax and keywords. That being said, the ideas are similar enough but it may be frustrating to learn both simultaneously because you may be transposing syntax as you go.

The main difference is garbage collection, and I think once you learn C++ you learn to both understand and appreciate the benefits of a garbage-collected system. Trying to learn Java at the same time may confuse or frustrate you. Learn the key concepts, get a good solid footing with C++, then move on to Java when you're ready.

Mark Renouf
A: 

I recommend you to certainly look into both. If your C++ course is finished you will be a better Java programmer and get some work done with it. If you are still getting confused, you can still stop reading the Java books until the course is finished.

I'm always at learning C++ and other languages at the same time and having fun with it. I certainly would say I'm learning something rather than being confused by it.

Johannes Schaub - litb
+15  A: 

I don't see a real problem with this. As an added bonus you'll be able to read the books relevant sections side by side and see how they compare and contrast the differences in how the languages handle things.

For example as you read about pointers in C++ it might help you visualize how Java reference types work to a certain degree.

Don't be frustrated your school teaches C++, be grateful. Read, The Perils of Java Schools. You aren't at a tech school looking to learn the hottest language of the moment. You are there to learn computer science. My school teaches Java as an introductory language and I think it is a huge mistake. We should be learning C instead so by the time we are introduced to Java (in say, Object Oriented class) we will know what is actually going on and nothing "magical" is happening for us.

The knowledge you gain in your degree, and even from using C or C++, will transcend the latest "popular" language.

Simucal
A: 

Just ask yourself how easy it is to learn the concepts for you currently. How deep is the understanding you get?

If you understand well, it will be easy for you to distingish and seperate them. If it is somewhat hard for you though, you may probably get confused.

ypnos
+3  A: 

Learn C++ first. Learn C, too. Learn Lisp or Scheme. Java is going to be a piece of a cake after that.

bromfiets
+1  A: 

If you're smart you won't get confused.

In fact I would say - learn another language as well, Perl or Python.

Fortyrunner
A: 

Just learn C++ right now if you think you might get confused learning the two languages at the same time. You don't want to jeopardize your grades.

Later, toward the end of the semester or after it, take a few days to learn Java as well. It's no big deal. Once you know C++ it will be easy and quick to learn Java. And you have something to look forward to: Java has cleaner syntax and is easier to understand (no pointers etc).

+2  A: 

100 Java to 1 C++? I just searched at dice.com and it returned 9322 for Java and 4777 for C++. Granted, Java is more in demand but the ratio is close to 2:1. Besides, there is also the "supply" side of the equation - there are more Java programmers competing for the positions.

Nemanja Trifunovic
+2  A: 

Here's a paper I found inspiring.

Even if it's a bit lengthy and not really spot-on to your question, I hope you will see an answer in it. Make sure you read it to the end. It's worth reading.

AlexDrenea
I've always had the understanding that TCP transports IP packets. Good article though.
BBetances
A: 

How come I don't see any recommendations to learn C#? If anything I would learn C++ and C# concurrently. I think you shouldn't bank on just one or two languages, though. Learn a new one every year or so. Once you have a grip on OOP and design patterns, languages become trivial (mostly). Then you can have more than one resume. You should also think about what you want to do exactly...web development? low-level stuff? Making device drivers? Broaden your horizons a bit, and drill down into what makes YOU, as a programmer, tick.

BBetances
+2  A: 

As a student and a programmer, I have to say that it's too easy to get distracted by different technologies.

If you are doing c++ you should study hard for that, otherwise you are pretty much procrastinating by learning Java.

c++ has a whole bunch of things that Java doesn't have, and if you are studying - you aren't going to get marks if you start writing Java in your c++ tests!

My advice is to find a project that you can use c++ for (perhaps some opengl?) - maybe there are some better suggestions ( I don't code in c++ ). This way you will be enjoying yourself while learning what you should be learning :)

Louis Sayers
A: 

I have spent years each working in C -> C++ -> Java and now C#.

IMO, C++ is an excellent first language because you learn so much more about what is going on under the hood (things like pointers and heaps which are hidden in Java and C#) while still using an object oriented language. I recommend immersing yourself in C++ as long as you are in C++ classes.

I am also an advocate of learning some assembly language as well. Even in Java or C# there are occasions when it is helpful to dive down to the assembly level in the debugger.

Once you know C++ well, Java and C# and other static languages will come easy to you. The harder part will be learning how to effectively take advantage of the libraries which come with these languages.

I'll leave the subject of dynamic languages to others since I have no experience to speak from.

Joe Erickson
+3  A: 

C++ is a language that takes weeks to learn and years to master. So the sooner you get in the earlier you will master it.

Don`t get confused by the number-of-jobs metrics. The ratio of boring to interesting jobs is probably also 100 to 1 as you stated. Also in these days of high-level things knowing low level pays.

IMHO most interesting (programming) jobs out there are C++ jobs. Although there can be some interesting projects in Java or c#, most of them deal with moving data around (from DB to html or gui, back to DB...). It depends on what do you want to program for living ;-).

If you are interested in robotics, computer vision, computer graphics... you definitely should go C++.

davidnr
Awesome icon, i love moss.
Simucal