views:

165

answers:

5

As far as my programming career went, I started out with Python, then went into Javascript, now I'm into PHP. I really want to learn a compiled language like c++ and Java. I don't exactly know how to start, especially since I'm currently looking into going into CS or CE in University, and my school don't offer anything that will let me learn any programming language at all, beside actionscript.

I want to find a book, though I can't find one where it explains new concepts in C++ and Java that's not present in python, and skips the basics. I could either find books that's really advanced, or very basic.

Lastly, I know the best way to learn a language is to build something with it, or enroll in an open source project. I also know that trying to join a project is very difficult, as you need to familiarize the code that other people have written, which may or may not be in your style. What are some of your recommendations?

+6  A: 

I want to find a book, though I can't find one where it explains new concepts in C++ and Java that's not present in python

I wouldn't recommend trying to learn a new language in terms of an old language, especially when the two in question are so different. What's different between C++ and python? A hell of a lot.

I could either find books that's really advanced, or very basic.

Sounds like 'very basic' is where you should start. You can't assume that you can just skip the basics because you already know another programming language or two. Start from the ground up, you're not going from python to ruby here, this is a bigger leap.

I want to find a book, though I can't find one where it explains new concepts in C++ and Java that's not present in python, and skips the basics

Bad, bad, bad idea. You don't know the basics of C++, you need to learn them. You will undoubtedly touch upon some things that you already know, like how to write a simple for loop, but there will also be things that an experienced C++ programmer would consider 'basic' that you certainly will not know. Like anything, starting from the beginning is the way to go.

Ed Swangren
Good point. Any particular books that you have in mind? Also I feel like Java is like a middle ground between C++ and python. Is it a good idea to learn that first?
ultimatebuster
It is a middle ground in some ways, but not in others. C++ and Python have one thing in common: both are very much multi-paradigm languages that give you a lots of different tools, instead of trying to force you to write your code *one* way. Java is (or wants to be) a 100% OOP language, where nothing else is allowed. So in that sense, C++ is the middle ground between Java and Python. In terms of safety though, C++ is the odd one out, as both Python and Java go to great lengths to prevent the programmer from entering undefined behavior or corrupting memory or such errors.
jalf
As for which one to learn, I tend to feel that C++ is a more interesting and intellectually rewarding language (it may not be rewarding in terms of actual productivity). But it also has a steeper learning curve. To be honest, either language will do. I wouldn't recommend C++ as your *first* language, but since you already know Python, you should be ok. You already know programming, and can focus on learning the idiosyncrasies and quirks of C++. Don't worry that it'd be a mistake to learn either language.
jalf
What he said for the most part :). Effective C++ by Scott Myer's is a good book, but I learned C++ mostly through the internet and by using it.
Ed Swangren
+1: "I wouldn't recommend learning a new language in terms of an old language" Actually, you **cannot** learn a new language that way. You don't learn the new language. You only learn the old language's differences from the new language. But not the **new** parts of the new language. You must go to the well with an empty bucket.
S.Lott
From the question: "and skips the basics". This is a really bad idea. You might want to emphasize this in the answer, also.
S.Lott
A: 

You're going to hate me for saying this, but you should be looking at Delphi or C# instead. Both of those languages are closer to Python than either Java or C++.

Ignacio Vazquez-Abrams
Who says he wants something closer to Python?
jalf
Yeah i want to move on from python to a more, lower, language. Also C# is basically Microsoft Java. I won't hate you though.
ultimatebuster
Delphi is as low as C++, and lower than Java. C# is as low as Java.
Ignacio Vazquez-Abrams
+2  A: 

Andrew Koenig and Barbara Moo's "Accelerated C++" may be the book you're looking for.

I don't have it (I knew C++ before it was written :-)) but it's been highly recommended by many people.

But note that Python and C++ are not just different languages, they belong at the extremes of two different ways of thinking about software development. As a Python programmer you strive to provide access to most everything so that users of your code can adjust it to their purposes. A certain wooliness is not just acceptable but an ideal: if the code passes all tests and does what it's intended to do, then All Right! As a C++ programmer you strive to prevent access to things so that the compiler can detect as many errors as possible, including Incorrect Usage errors (there's not really any analog in Python: the Python compiler can only detect basic syntax errors, at best). If the code passes all tests for what it's intended to do, but there are still ways to inadvertently use it incorrectly, uh oh, it's something that gnaws at the C++ programmer's mind...

So, most C++ language features, which are about restricting access, don't make sense at all within a Python mindset. And most Python language features don't make sense at all in C++. So you're not just about to learn a new language, but a completely different mindset!

Uh, you've been warned... :-)

Cheers & hth.

Alf P. Steinbach
+1 - Good answer. Agreed about it being a completely different mindset, but it's also worth noting that this is a very good thing for a programmer. Being exposed to languages, paradigms, mindsets different than you're used to is a great learning experience.
jalf
+2  A: 

You must check out: The Definitive C++ Book Guide and List at stackoverflow

Apart from that, I would suggest to think about a python or Java project you have done in recent past. Now, write it in C++.

ArunSaha
A: 

I would recommend getting Data Structures and Abstractions with Java its a great book that focuses on data structures such as linked lists, stacks, maps, ect which are really essential to know when programming in C++ or Java.

Tom