Sign in to follow this  

How to learn a new programming Language

This topic is 3591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am an experienced Java developer for 3 years and I want to learn C++, however, I want to really understand the inner working of the C++ Language. Now there are 2 ways to learn a programming language: 1. Get a good book and ready it cover to cover and work all the practice examples programs in there. 2. Work on a reasonable size project that requires you to code. When I learned Java, I was in university and was required to read and do labs. However, as a professional developer, finding the time to read through the C++ Primer isn't exactly a feasible option. Can you give your opinion between option 1 & 2 above as to which is better? Thanks.

Share this post


Link to post
Share on other sites
With Java being very similar to C++ generally speaking picking up a good book which covers some lower level C and C++ programming should have you ramped up in no time. A good exercise would then be to convert a smaller Java based application over to C++ as you gain additional knowledge to confirm you are understanding the material as you go.

This is of course just my opinion as I took C while in high-school and self-taught myself C++ before I got to college. There I took a good number of courses on C++ and basically built on top of what I already knew so I had somewhat of a head start. As our first semester covered a course in Java I found it incredibly easy to make the transition between the two particularly with respect to OOP.

Share this post


Link to post
Share on other sites
#1 would be the better approach. With #2 you could jump in produce functional code without ever leaving your comfort zone and really digging into the bread and butter of C++. However I have to caution you that there are relatively few books that teach C++, and a great many books that teach C with classes. The mindsets of the two are completely different and code produced by each method will vary greatly. Though since you have Java experience I would think a C with classes book plus a good c++ reference would point you in the right direction.

Share this post


Link to post
Share on other sites
Quote:
I want to really understand the inner working of the C++ Language.
As opposed to simply knowing the language very well? That's quite a change of direction.

Quote:

Now there are 2 ways to learn a programming language:
Not mutually exclusive. Simply going through a book will not teach you the language. Neither will jumping into code without reading about the language.

Quote:
However, as a professional developer, finding the time to read through the C++ Primer isn't exactly a feasible option.
That's too bad. I hope you find the time sometime. You aren't going to get very far in learning if you can't find the time to read the manuals, documentation, and necessary tutorials.

Share this post


Link to post
Share on other sites
I would recommend #1.

If we were talking about a safer language, then I'd say the best approach would be to dive right in and start coding. But C++ is a very unsafe language. There are many, many ways you can go wrong.

In C++ you can have bugs that:

- affect a completely different part of the code
- or, don't manifest until long after the buggy code has run
- or, are based on the existing state of your memory, so they might only occur when running the app the 1st time and not the 2nd time
- or, things that work great in one compiler but not in another compiler
- or are affected by the current phase of the Moon, etc etc

Then when errors *do* occur, the actual error messages can be completely inscrutable (until you have experience in understanding them).

So, best to spend time with a book now rather than tearing out your hair later.

Share this post


Link to post
Share on other sites
nah, just dive straight in. Be a man.

You can have books open next to you and web browse as well to solve errors. Sheesh you're not going elephant hunting with a knitting needle so there's nothing to worry about. The computer won't jump up and beat you about the head if you stuff up a few hundred times.

Just fire that baby up and dive straight into writing code. You'll soon learn from your mistakes. All the best programmers I've ever met were self taught by experience and all the worst were academics.

m0ng00se

Share this post


Link to post
Share on other sites
Dive in. I learned C, and OpenGL both using the famous gears demo. It took years of struggle to understand what I learned, of course. the fact is, there is no easy answer to the question "How do I learn a programming language" other than to use it.

Share this post


Link to post
Share on other sites
You can dive straight in and you'll likely learn quite a bit... and miss quite a few critical aspects as well. A combination of both reading good books and writing code is probably the best way to go.

However, if you're low on time, then maybe you should ask yourself: is C++ worth learning for me, or is there another language that's far more usefull for what I'm doing?

Share this post


Link to post
Share on other sites

This topic is 3591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this