Jump to content
Sign in to follow this  
dibs

I want to learn C++, anyone got a good book, book, book recomendation?

Recommended Posts

Ahoy,

I'm looking to move my data analysis skills into quantitative analysis (finance), but since i'm a child of Matlab I need to teach myself some C++ and brush up on my OOP. That or java. It seems quite a few of you are programmers and the like and I was wondering if anyone had a good recomendation of a book I could use. I currently work at a uni, so hopefully the library shall provide.

dibs

Share this post


Link to post
Share on other sites

My suggestion is you find out whether C++ or Java is the right choice. They're quite different, both in how you write and work with them, and what you will be able to do with them.

Also, I thought Matlab was the ultimate best thing for everything maths. What is you're going to be doing?

Share this post


Link to post
Share on other sites

I've been going through job specs for quants and they mostly list Matlab as a secondary language with C++ and Java as the main development language. I was looking at C++ first since I come from an engineering background and have interacted with it a little, but I'll definatly check out Java too to see if it more to my taste.

As for what exactly i'm going to be doing...this is all pie in the sky at the moment! I need to get my CV in order before applying to the pertinant agencies, and my known languages seems to be the biggest void. The HR woman at my current job last week cheerily informed me that out contracts were now extended until june (I have a contract of indeterminate length untill they don't need me anymore><). Whoop de fucking doo i said.

Share this post


Link to post
Share on other sites

Thinking in Java or Thinking in C++ by Bruce Eckel are supposed to be good. I borrowed the Thinking in Java book from my Uni library and found it quite useful to get started, I assume the C++ book(s) are equally good.

http://www.amazon.com/Bruce-Eckel/e/B000AQ1SS2/ref=sr_ntt_srch_lnk_3?qid=1334762325&sr=1-3 Steal some ISBNs from here and check them out at your library.

Share this post


Link to post
Share on other sites

Great, thanks. I've just looked them up in the library and the C++ and java editions are from 1995 and 2000. Should be still ok for what I need I hope.

Share this post


Link to post
Share on other sites

I usually find the O'Reilly books to be pretty good - it depends on what you like though. BEst thing about them is you can get full digital copies now, which are all searchable, and more importantly, don't take up shelf/desk space.

Share this post


Link to post
Share on other sites

I like Accelerated C++ quite a bit, though it assumes you have some basic knowledge of programming.

If you just need to learn OOP, and you're stuck between C++ and Java, learn Java. Yes, it can be a chore to write code in it (everything has to be in classes), but at least you avoid some of the messier stuff C++ will set on your table; for example, there is no memory leaking in Java, and garbage collection is automatic. Want to learn Java? Read the tutorials on Oracle's website.

//C++
#include <iostream>
using std::cout;
using std::endl;

int main() {
     cout << "Good luck, though!" << endl;
     return 0;
}

//look at me I'm Java
public class dibs {
    public static void main(String[] godibs) {
        System.out.println("Coding can be loads of fun, so enjoy it!");
    }
}

Share this post


Link to post
Share on other sites
I like Accelerated C++ quite a bit, though it assumes you have some basic knowledge of programming.

I got that a few years ago! Some day I'll open it.

Share this post


Link to post
Share on other sites

I used both in school (although I use neither now) and I preferred Java. Though I may just have been scarred by some makefile whitespace experience.

Share this post


Link to post
Share on other sites

Thanks for the info guys and the wonderfully coded encouragement Kroms. I should have been more clear, I did my phd in numerical work and my bioinfomatics/data analysis job of the last two years through Matlab so I'm not exactly a newcomer to this (never actually took a programming class though). I'm also not too phased by new paradigms having been trained up in Labview and the magic of data flow. I'm in a better position than a lot of people realising they need to learn this stuff:)

I had my hands on c++ primer plus for a few days but I had to given it back. I'll see what my library can provide from your recommendations tomorrow and take a browse. Also, I'll see can my uni can provide a copy of java. I'm sure some comp sys people use it.

Share this post


Link to post
Share on other sites

Most programming books teach just how various aspects of a languages work, and are less good at practical applications or best practices. Beyond just learning the basics, you should also look into a book that explains the stupid shit you shouldn't do. I can't speak for C++, but for Java you could checkout Effective Java and Clean Code (Actually, it's been a while since I looked at this book. It might be in Ruby. Regardless, the lessons are still applicable.).

Additionally, programming books are dull. Don't be afraid to just dive into a project and learn as you go. Reading other's source is also an invaluable resource, just don't assume that it's all worthy of imitating.

Share this post


Link to post
Share on other sites
Most programming books teach just how various aspects of a languages work, and are less good at practical applications or best practices. Beyond just learning the basics, you should also look into a book that explains the stupid shit you shouldn't do. I can't speak for C++, but for Java you could checkout Effective Java and Clean Code (Actually, it's been a while since I looked at this book. It might be in Ruby. Regardless, the lessons are still applicable.)

for C++ you should own Effective C++ parts 1 and 2 and Code Complete, as well as having access to a copy of Stroustrup's TC++PL even if you don't own a copy. you should probably also own at least a book or two about the platform you're developing on, since C and C++ are goddamn terrible at isolating you from platformisms.

also, if you're writing something that people external to your company will actually use (as opposed to a line-of-business app for which you're the only user) you should probably buy Writing Secure Code, or a similar "computer security for software engineers" book.

but really, I can't recommend enough that you try to learn Java as your primary language if at all possible. it is a significantly more pleasant experience than writing C++.

Share this post


Link to post
Share on other sites

I have had courses in Java, C and C++ but I have read any books on programming. The lecture material and code examples on the internet have always been enough for me.

Interestingly, I still ended up programming the analysis software for my Master's thesis in Python. The actual Monte Carlo analysis is in Cython (and therefore fast) but the GUI, multiprocessing, array handling and plotting are in hassle free Python, NumPy, Matplotlib.

Share this post


Link to post
Share on other sites

Bah, i've actually been busy for the last two days at work (unprecedented in the last three months i've been there) so i didn't get to look this stuff up yet:/

Share this post


Link to post
Share on other sites

I've started the Java tutorials that Kroms linked. Very handy on my tablet as i do the tutorials.

My Hello World! went without a hitch. I'm pretty much an expert now.

Thanks for all the recomendations.

Share this post


Link to post
Share on other sites
Shame you're not learning C, because this book utterly rocks:

http://www.amazon.com/C-Programming-Language-2nd-Edition/dp/0131103628

I have that book.

Never read it though, because it was part of course work.

The only book I've actually read is Clean Code by Robert C Martin. Still on my wish list to read are Code Complete and Clean Coder.

I don't believe you can learn to program by reading a book about how to program in language X. You would learn a bit about the syntax, and probably a lot of programming mistakes by reading those books. I'd stick to reference manuals/books and generic programming/software development books. (Note: K&Rs C book is more a reference manual than a book on how to program in C).

Edited by elmuerte

Share this post


Link to post
Share on other sites

I used Herbert Schildt's Complete C++ Reference a good while ago. It didn't think it was amazing or anything, but the guy who wrote it is cool.

I mean look at him:

84f16e89fa7d03dc383ffc6f2f3ed0ef.jpg

You can tell this guy means business.

Share this post


Link to post
Share on other sites

well.. he does have a mustache, and facial hair is of significance in programming languages

Share this post


Link to post
Share on other sites

What a dreamboat.

Anyhow, I'm reading the books to make sure I have my terminology. The great thing about java is that it is taught quite a bit in uni's and i have previously come across quite a few projects and assignments i can try out myself. After that I'm going to reimplement some of my GUIs from work in Java/C++ to compare with Matlab (none of which are done in OOP).

Thanks for the links Thunderpeel and Elmuerte. I'll deffo check out your one Elmuerte since I want to work on my tech speak.

Share this post


Link to post
Share on other sites

My farther doesn't look anything like that. He hasn't had hair that long since the 70s.

Share this post


Link to post
Share on other sites

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  

×