Page 1 of 2
Good C++ for finance for newbie
Posted: March 5th, 2011, 5:08 am
by DigitalRain
I was wondering wats a good book for someone who has no experience in C++ and has application involving finance, which is used commonly today in the quant world?Any suggestions is much appreciated. Thanks!!
Good C++ for finance for newbie
Posted: March 5th, 2011, 1:25 pm
by demha
Daniel Duffy has a book called "Financial Instrument Pricing Using C++". Not a bad book.
Good C++ for finance for newbie
Posted: March 5th, 2011, 1:27 pm
by Hansi
Wouldn't recommend Duffy as a beginning book. I started with this one and liked it a lot:
Good C++ for finance for newbie
Posted: March 5th, 2011, 2:34 pm
by Cuchulainn
For novice C++ programmer I always found a good 'mix' in Bruce Eckel'sHe was around from the very start (mid 80s).
Good C++ for finance for newbie
Posted: March 5th, 2011, 2:55 pm
by demha
I mentioned Duffy because the OP asked for something that had application to finance. I don't know any elementary C++ books targeted towards finance. There are a number of C++ books with Science and Engineering focus and they may perhaps be a good start if the OP wants something more application oriented. One I really liked is this one:
Description:"This book's three parts take readers with no prior C++ knowledge all the way from basic concepts, through object-oriented programming and design techniques, to advanced C++ features and techniques. Coverage of object-oriented programming emphasizes various methods of expressing commonality and abstraction, and the advanced coverage illustrates coordination of advanced C++ by developing several interesting examples. "From two very well known authors, Barton and Nackman who are immortalised in the "Barton-Nackman" trick (
http://en.wikipedia.org/wiki/Barton%E2% ... kman_trick).
Good C++ for finance for newbie
Posted: March 5th, 2011, 3:32 pm
by renorm
Lippman (Primer) --> Josuttis (STL) --> Stroustup (TCPL) --> Meyers (Effective C++ & STL) --> Sutter (4 books).Mix Lippman (Primer) with Stroustrup (PPPUC). Stroustrup (TCPL) is very good, but don't expect to do it in one pass.After Josuttis (STL) start using boost. Boost and STL are your best friends.Optional:Vandevoorde and Josuttis (Templates) --> Alexsandrescu (Modern C++) --> Abrahams (MPL).More optional:Boost is huge. Start learning (incrementally) libs which are relevant to your domain.Learn parallel programming. TBB and MPI are defacto standards.Unless you stuck with Windows (makes sense only for .Net), learn Linux programming environment.Participate in QuantLib project.
Good C++ for finance for newbie
Posted: March 5th, 2011, 3:38 pm
by demha
QuoteOriginally posted by: renormLippman (Primer) --> Josuttis (STL) --> Stroustoup (TCPL) --> Meyers (Effective C++ & STL) --> Sutter (4 books).That's a good few years of hard work, especially if you have a full time job
Good C++ for finance for newbie
Posted: March 5th, 2011, 7:28 pm
by demha
I hadn't realised, but Daniel Duffy does have another C++ book which is at a beginner level and finance motivated:
OP may like to consider that too. When I learned C++, I also found it more motivating to use something from a domain that I was comfortable with rather than the usual dry examples you find in the mainstream C++ books. I tried wading through tomes written by Lippman etc, but would fall asleep after a few pages, since the examples are not very motivating.The following is also a short, but very good book at an elementary level:
http://www.acceleratedcpp.com/Sometimes, famous authors tend to write dense, scholarly material. But Koenig and Moo's book is very clear and friendly.After learning the basics from more "friendly" books, I found it much easier to work with the likes of Lippman, Stroustrup etc.
Good C++ for finance for newbie
Posted: March 6th, 2011, 12:01 pm
by renorm
Learning C++ takes time. Lippman + Josuttis is a minimum (but OK to skip locales). The rest should be treated according to 20/80 rule.
Good C++ for finance for newbie
Posted: March 6th, 2011, 1:00 pm
by kimosabe
It is probably best to learn some C++ independent of the finance. The best way to get up to speed with that is Accelerated C++: Practical Programming by Example by Andrew Koenig and Barbara E. Moo. It will teach you the subset of C++ I've found to be most useful in solving mathematical finance problems.
Good C++ for finance for newbie
Posted: March 6th, 2011, 3:41 pm
by Cuchulainn
QuoteOriginally posted by: kimosabeIt is probably best to learn some C++ independent of the finance. The best way to get up to speed with that is Accelerated C++: Practical Programming by Example by Andrew Koenig and Barbara E. Moo. It will teach you the subset of C++ I've found to be most useful in solving mathematical finance problems.A good way to learn C++ imo is to set up a Shape (CAD) class hierarchy: lines, circles, polylines etc. This is ideal, it has structure, algos, UI and you can use all the GOF patterns with them. We still use them in an app, but now in C#. It was a while ago, here is an example.
http://www.datasim.nl/Education/Article ... aper5.html A good data hierarchy and non-trivial algos (so, no cats and dogs classes with woof_woof() and mieuw() methods )In QF, you could set up a Bond hierarchy using day counts, cash flow and schedules, for example.
Good C++ for finance for newbie
Posted: March 6th, 2011, 5:03 pm
by Polter
Agree with suggestions regarding Accelerated C++, also think it's the best way to start for anyone who has programmed before.As for the what's-next -- I think I might provide a different suggestion here; instead of going through design patterns, GOF, further OOP reading, whatever -- go through Stepanov's notes --
http://www.stepanovpapers.com/ -- in particular (I think those are fantastic intro to generic programming in C++ in general):
http://www.stepanovpapers.com/notes.pdf ... tes.pdfHis book with Paul McJones is also pretty good, though it's much more theoretical than the above notes (which have a healthy focus on the practical implementation).Then, optionally, resume the OOP/GOF/DP reading only if you still find it useful
Good C++ for finance for newbie
Posted: March 6th, 2011, 5:14 pm
by Cuchulainn
QuoteThen, optionally, resume the OOP/GOF/DP reading only if you still find it useful ;-)In my experience (2000 students in GOF till now) the people whoe use DP with success tend to be engineers (domain knowledge, they have operating standards etc.) IT and CS people do not use GOF so much.That's just the general truth. I am just a messenger
Good C++ for finance for newbie
Posted: March 6th, 2011, 5:32 pm
by Polter
Cuch, I just hope you won't get me wrong -- by all means, learn the basics, learning the common lingo (and someone noticed DP are in part that) and OOP-idioms (which I think characterizes DP -- as opposed to more general or language-specific idioms, like, for instance, RAII (to understand which one naturally needs the basics of the OOP, by the way)) is a must.My point is: just don't spend too much time digging too deeply on this. Especially if you're in the early stage.Focusing on the OOP too much might give you (in my opinion) a wrong impression on how to approach abstraction in C++.That's why I suggest focus on generic programming, and an early one, too -- C++ is in fact and in practice (how it's used) a very, very different language from, say, C# or Java.Learning generic programming in C++ is a very good way to learn the practical answer to "how different?"Going too deep into OOP/GOF/DP might give one an impression that there's only one way to achieve abstraction (a way that, for better or for worse, was strongly hyped around 1990s, but we know better now -- you have noticed yourself that some of the patterns from that era, e.g. Observer, tend to be abused and are better to un-learn nowadays).The distinct advantage of C++ is that it's a language that gives you "high-performance abstractions" -- I don't think any other mainstream programming languages gives you that.And focusing too much on the OOP/GOF/DP way might lead one to miss that distinction...
Good C++ for finance for newbie
Posted: March 6th, 2011, 6:07 pm
by Cuchulainn
It seems some folk have had bad experiences. That's a shame.