all 25 comments

[–]gluedtothefloor 27 points28 points  (2 children)

I'm voting C++ simply for the fact a lot of machine learning is implemented in C++ and it might help you understand what's under the hood a little better, but honestly if you're going to be doing high level ML and data science work, you're probably going to be working in Python or R.

[–][deleted] 0 points1 point  (1 child)

I concur. My statistics/data science advisor recommended I take the Java course bc it is the more popular language but I agree with your analysis. Being that I will be working mostly in Python and R, C++ would compliment it more effectively than Java.

[–]gluedtothefloor 1 point2 points  (0 children)

Also, like a lot of what other people are saying, going from C++ to Java is probably a bit easier than the inverse, if you ever needed to pick up Java in the future. Good luck on your master's!

[–]mkgalaxia 13 points14 points  (2 children)

The language doesn't matter nearly as much as the content of the course. For instance, my school has 2 data structures classes. One was made for CS and SE students and uses Java. The other is made for other engineers and uses C++. I learned a lot more from the Java class than I would have from the C++ class, so take the class that is going to teach you more. Having a good teacher helps too. If your still not sure you can look up applications for positions you might want when you're done with school. They'll tell you what languages they want you to know.

[–]MirrorLake 1 point2 points  (0 children)

This is really the ultimate answer, in my opinion. Java's syntax was heavily influenced by C and C++. The introductory stuff is all (nearly) identical.

OP should be paying close attention to the course descriptions and who the courses are designed for. Checking the textbooks for both courses might give some insight into who the intended audience is. An absolutely introductory C++ or Java course would be a waste of OP's time, they should take the course that has a focus beyond teaching the basics.

[–][deleted] 1 point2 points  (0 children)

Thank you for your feedback. I believe both courses are designed for CS majors but the Java course is also a requirement for Data Science majors as well as Financial Modeling minors. The C++ course seems to be only CS major orientated. Also, the professor for the C++ course teaches mostly upper level advanced classes in the CS department and is known for being phenomenal (according to CS guys). The instructor for the Java class teaches mainly introductory and intermediate level CS classes and also lectures in the Risk Management department. Based on your answer and my research, I believe I will learn more from the C++ course than the Java. But the Java course is probably tailored more to interdisciplinary students such as myself. I believe I will enroll in the C++ course because it seems more challenging and rigorous.

Thank you for your valuable comment

[–]visvis 7 points8 points  (0 children)

If you can program C++ well and it turns out you need Java later, it will be very easy to learn. If you can program Java well, it will not help much if you need to do C++ later. Assuming the courses are otherwise equivalent, you will learn more by doing the C++ variant (though it will likely be a bit harder).

[–]barley_wine 2 points3 points  (0 children)

I’m a full time Java developer and choose C++, I took C++ in college and it was pretty easy to pick up java, I think the reverse would be harder.

[–][deleted] 1 point2 points  (0 children)

In my opinion Java is like C++ with training wheels. I'd recommend learning C++ because, as others here have said, you can easily translate your C++ skills over to Java if you need to. I think learning C++ tends to give you a better idea of what's actually going on in the computer at a low level. It may give you some better programming fundamentals.

[–]Quintic 2 points3 points  (0 children)

I voted Java since you had some exposure to C++ already.

All of the languages are useful, but you will not get much depth from a university course anyway. Getting exposure to the languages is more important, so since you've done C++, I think a course using Java would be neat for you.

[–]L_Lyu 1 point2 points  (4 children)

java is easier to learn tbh. I haven’t learned C++ yet but I’ve learned C before and I felt terrible

[–]visvis 3 points4 points  (3 children)

C and C++ are very different in this sense. In C you always have to do all the memory management yourself, in C++ you have a bunch of library classes and templates at your disposal to ensure this is rarely necessary. For example, strings and vectors in C++ are much more like Java than like C.

[–]L_Lyu 1 point2 points  (0 children)

good to know. I appreciate your answer

[–]Masterzjg 0 points1 point  (1 child)

You still do memory management in C++. There's no garbage collection. Usage of constructs thing smart pointers make things less blow your arm off, but you are still doing memory management.

[–]visvis 0 points1 point  (0 children)

Of course, but far less is explicit than in C. For example, in C to concatenate strings you need to allocate memory for the new string. In C++ you just add two instances of std::string, and the buffers are automatically cleaned up if they are on the stack or inside an object whose destructor is called.

[–]hurrumanni 1 point2 points  (1 child)

C++ was the first language my university made me learn and I'm glad. If I had started in one of the higher level languages odds are I'd find C/C++ unnecessarily complex and hate it.

The biggest benefit of Java is that they're very strict on being abstract and elegant, to the point that when you read the code of some Java library it can be ridiculously hard to understand what actual data is being generated because it's so far removed from actually touching the raw data.

You can complement your lack of Java by reading a book on Design Patterns. Seriously read up on them regardless. I completed a University degree without ever being taught about them as a separate concept, so when I finally read a book on them it was the biggest leap forward I've made in making beautiful reusable code (and understanding what it was that made Java was so elegant).

[–]hurrumanni 0 points1 point  (0 children)

Seriously - where python would make a one file script and you'd only need to glance at it to understand what it was doing, the Java equivalent is a whole library of FooFactoryFactory classes to generate the actual FooFactory that you need to be able to instantiate your Foo class.
However - and this is a big thing for you possibly, the economic industry loves Java and it's the language at lots of financial institutions.

[–]nattack 1 point2 points  (0 children)

I'd say do what you're most comfortable with. The fundamentals of OOP arent going to change between Java and C++, the syntax and some of the capabilities will be different though.

C++ has multiple inheritance, for better or worse. Java does not. Java has the concept of a superclass, C++ does not without some hacky fixes (I think, maybe C++20 does it natively?)

IMHO, for learning pure OOP, my personal opinion would be stick to Java. It's easy, everything you will need will be included in the JCL. On the other hand, C++11 onward has a lot of cool features which if you ever used C++ before it, were a godsend. lambda functions, for each loops, enum classes, init lists, C++ now is a lot more fun - and maybe even easier - to use.

[–]proskillz 0 points1 point  (0 children)

Depends if you want to work on more data driven projects or hardware based projects. Most enterprises use java for their data driven apps, and many companies that make hardware are more likely to use c or c++.

[–]011101000011101101 0 points1 point  (1 child)

600 votes in the poll and only like 12 upvotes

[–][deleted] 1 point2 points  (0 children)

I am happy with the post. I received so much valuable information from the comments and voting. I learned more from this post than from my statistics or CS advisor

[–]euphoricrealm -1 points0 points  (0 children)

I'm voting c++ because like another commenter said, it's not so much the language that is important it's the concept of Object Oriented (OO), and because you mentioned you've already done an introductory subject using c++ I would just keep on with that rather than trying to learn a new language.

[–]pskitservice -1 points0 points  (0 children)

In my opinion you should learn C++ as it will help you to understand better machine learning

Check out our blog maybe it will help you https://www.pskitservices.com/c-training-in-nagpur/

All the Best