How many hours to learn C++ if I know very basic java?

How many hours to learn C++ if I know very basic java?

I just want to be adept enough to start doing some basic things using ROS and gazebo

Other urls found in this thread:

ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-096-introduction-to-c-january-iap-2011/
learncpp.com/
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/
twitter.com/SFWRedditImages

24

>basic things
One week of study should be enough to get you in shape to crank out some shitty but functioning code. Learn concepts as they come up from that point on.

Is there some sort of route or path I should follow? What extent is enough? I know if statements, while and for loops etc, i don't know much of what else there is

lol..
>very basic java
that's basically nothing. You're essentially starting C++ from scratch so give it a year

I do a fair bit of coding/logic with MATLAB, though. I'm a mechanical engineer

start with this:
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-096-introduction-to-c-january-iap-2011/
Oh, and there is a LOT more to learn, as C++ is the most complex language ever devised (by quite a large margin). When Googling for learning material, try to focus on content that covers C++11 and C++14; these revisions to the language introduce programming constructs that greatly simplify writing code to the point of making other language constructs obsolete.

Would following a book (C++ Primer) be wise? How can I identify what shit will actually be used and what shit is useless

5 mins.

ok, i'm assuming you're not a retard.

you can take some basic java code and it would translate fairly easily to c++.

so, if it were me, i'd just start writing the code you want whilst looking up what the equivalent is in c++. and then also read, read lots of c++ books, articles etc.

the thing which is going to trip you up is that c++ is a massive language with lots of spiny and hairy corners and edge cases, its a nasty big language, its extremely powerfull. its like you know how to drive a car (java) and now you're in the cockpit of a formula one, some things will be familiar most will get you killed.

do you really really need c++ or would c do? cos if you dont have very good reasons for c++ dont go there.

yeah, the 5th edition of C++ Primer looks pretty good
>How can I identify what shit will actually be used and what shit is useless
It's literally impossible to do this beforehand - the language is just too damn big. I recommend focusing on the essential core (covered in that MIT course's syllabus) and get cracking on some code. You _will_ come across more advanced concepts after you begin working with libraries but you can just Google them (or look 'em up in C++ Primer) as you encounter them.

I don't know. I have a course coming up where C is required, though I want to start using ROS asap which supports C++ and python.

its a good book, but just the start. c++ 50 effective ways by scott meyers is also excellent and its also not enough. you're also going to need to understand exceptions (they're not like javas), templates (stl), oo (true multiple inheritance, which java doesnt have), destructors (not even vaguely like javas) and much else.

1-2 months for basic C++
2-3 years to mastery

>I don't know. I have a course coming up where C is required,

fine, learn c, lovely elegant language, its also (for all intents and purposes) a sub set of c++ so learning it will be a very worth while step to c++

>though I want to start using ROS asap which supports C++ and python.

if it supprts c too, yoou're golden and dont need c++

>2-3 years for mastery

Doable if you apply yourself

It doesnt support C

>How can I identify what shit will actually be used and what shit is useless

its all useful given the right context, its just that that "right context" is very small these days. and we give thanks for that every day.

Different user here.
Would that help if I know jack shit about coding?

Or do I need some beginner guide first?

in that case learn python. no need for C++

>jack shit about coding

Learn c first then.

learncpp.com/ might be a better choice. Although C++ Primer is a good book, it's a bit on the dry side and sometimes spends pages talking about some basic shit that could be easily explained in 2 lines. It's very in-depth though.

It's a quick intro to a very difficult language so you'll definitely have some trouble. Start with this instead:
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/

Honestly for a seasoned programmer, learning a new language shouldn't take more than a day max. But for a beginner, about a week if you dedicate yourself to it. Just Google c++ tutorials and learn

>Honestly for a seasoned programmer, learning a new language shouldn't take more than a day max.

except when the language is c++
i did it for 15years and i was still learning the day i got out.

I wasn't referring to mastering a language. Obviously there is so much to learn in not only c++ but every language, that you can never claim you know everything.

I was merely referring to getting a basic understanding of the fundamentals and being able to understand others code.