C++ or VBA first?

I’ve searched the forums and the broader net, but still haven’t come up with a good answer. I’m somewhat familar with VBA as I use the macro recorder a lot in excel. I wanted to learn more of VBA and was considering picking up the book by Walkenbach and Sengupta as many have suggested on prior posts. However, I have seen several statements on the boards and elsewhere that learning C++ first is preferable in the long run as you can learn almost any computer language after C++. I also read that C++ is better because VBA teaches “bad habits.” If this really is the case, then I could set aside the time to learn this well and move onto others. I am kinda stuck as I don’t know what to pursue just yet and I’d hate to waste my time on something. Thanks for your input.

if you are going to run a 5k, train for 5k, if you think you will/may do a marathon, start with marathon training and the 5k will be cakewalk. if you are only going to write VBA code then do VBA…however if you think you will do other programming then do C++.

I would suggest reading about object-oriented programming first and then start learning a language. If you know the big picture, learning syntax won’t be a problem.

If you see Excel everyday, then VBA. If you are a super quant and/or work at a sophisticated hedge fund, then maybe C++.

I’d recommend an OOP (like Java or C++) only if you plan on doing lots of programming or using multiple different languages. Echoing what those say above, it really depends on what you need it for. My progression went Matlab, VBA, C++ but I really don’t use C++ much at all. Matlab is sufficient for most of my needs. I might be a better programmer in Matlab/VBA if I had learned C++ first.

Without a doubt C++. As you have heard, C++ requires discipline that you don’t necessarily need in other languages. Specifically w/r/t memory management and variable/object definitions. Also, because you are dealing with things at a much lower level, there are virtually no limitations to what you can do in C++. You cannot say that about VBA, Perl, Python or even Java. And yes, once you learn C++ anything else is a breeze. If you have some technical background, you can be VERY proficient in about 4-6 months.

bos_IT_guy Wrote: ------------------------------------------------------- > Without a doubt C++. As you have heard, C++ > requires discipline that you don’t necessarily > need in other languages. Specifically w/r/t > memory management and variable/object definitions. > Also, because you are dealing with things at a > much lower level, there are virtually no > limitations to what you can do in C++. You cannot > say that about VBA, Perl, Python or even Java. > > And yes, once you learn C++ anything else is a > breeze. > > If you have some technical background, you can be > VERY proficient in about 4-6 months. You’re probably more qualified than me to answer this question, but from my personal experience it will take more than 4-6 months to become proficient in C++. I have been using it on and off for years and still can’t pass a BrainBench basic C++ test after an interview. In your opinion, how can I become proficient enough to pass one of those tests?

There’s nothing like practice. You have to have a *real* problem to solve and immerse yourself in the language. I’ve seen a lot of people try to learn it by going through some contrived examples in a programming book (C++ Primer, Effective C++, C++ in a Nutshell, etc.) I have read them all but it doesn’t really help with anything but developing a very basic understanding that will be quickly forgotten. Also, programming is not a spectator’s sport, you don’t pick it up by reading, you pick it up by doing. Once you struggle (and it will be a struggle) through your first major program with C++, a basic test will seem much easier. Good Luck!

The reason I’ve haven’t been posting much is because I’ve been busting my arse learning C++. I found that Thinking In C++ Vol. 1 and Vol. 2 are awesome. For a bigger picture view of software, I’m also working my way through Code Complete, Ed. 2. I highly recommend it for whatever language you use, it’s addicting to read - just an excellent book overall for intellectual reasons and for applied reasons.

bos_IT_guy Wrote: ------------------------------------------------------- > There’s nothing like practice. You have to have > a *real* problem to solve and immerse yourself in > the language. > > I’ve seen a lot of people try to learn it by going > through some contrived examples in a programming > book (C++ Primer, Effective C++, C++ in a > Nutshell, etc.) I have read them all but it > doesn’t really help with anything but developing a > very basic understanding that will be quickly > forgotten. Also, programming is not a spectator’s > sport, you don’t pick it up by reading, you pick > it up by doing. > > Once you struggle (and it will be a struggle) > through your first major program with C++, a basic > test will seem much easier. > > Good Luck! My problem with C++ is that I find no need to re-invent the wheel. Pretty much all textbook numeric methods have been programmed and available for download. Combining the different pieces into models is pretty easy and does not require in-depth knowledge of the syntax. To make a long story short, I use Matlab on daily basis and I can do anything I want using Matlab in a fraction of the time it would take me to program in any other language. For instance, another thread was asking about MPT Efficient Frontier, in Matlab with one line of code you can create the efficient frontier. Why would I want to write an optimization program in C++ to do that?

matlab is sweet

mo34 Wrote: ------------------------------------------------------- > bos_IT_guy Wrote: > -------------------------------------------------- > ----- > > There’s nothing like practice. You have to > have > > a *real* problem to solve and immerse yourself > in > > the language. > > > > I’ve seen a lot of people try to learn it by > going > > through some contrived examples in a > programming > > book (C++ Primer, Effective C++, C++ in a > > Nutshell, etc.) I have read them all but it > > doesn’t really help with anything but developing > a > > very basic understanding that will be quickly > > forgotten. Also, programming is not a > spectator’s > > sport, you don’t pick it up by reading, you > pick > > it up by doing. > > > > Once you struggle (and it will be a struggle) > > through your first major program with C++, a > basic > > test will seem much easier. > > > > Good Luck! > > My problem with C++ is that I find no need to > re-invent the wheel. Pretty much all textbook > numeric methods have been programmed and available > for download. Combining the different pieces into > models is pretty easy and does not require > in-depth knowledge of the syntax. > > To make a long story short, I use Matlab on daily > basis and I can do anything I want using Matlab in > a fraction of the time it would take me to program > in any other language. For instance, another > thread was asking about MPT Efficient Frontier, in > Matlab with one line of code you can create the > efficient frontier. Why would I want to write an > optimization program in C++ to do that? I agree with both of these posts, but only to a certain extent. I have found that most things can be done in Matlab which I prefer, but Matlab was written in C !!! In fact, most programs we talk about here were written in C (SAS, R, STATA, etc…) This past semester while finishing my MFE I was given a project of coding a mortgage valuation model in C, and I can attest to the struggles that bos_IT_guy talks about above. It was a huge pain in the ass, but I learned more from struggling to get it to work than I ever would have reading a book. By the way…Practical C Programming is the best instructional book I have found (any O’Reilly programming book for that matter). While most charterholders would not have the need to create something like this from scratch, it is extremely helpful to be able to understand/modify some code like this. I probably could have implemented the model in Matlab, but would have lost some memory allocation capability in the process. This was important since I needed a 1440x1440 array. Make no mistake about it, programming in C (or C++) is NOTHING like programming in VBA. Hell, VBA will capitalize letters for you, C doesn’t do sh*t that you don’t explicitly tell it to.

CFABLACKBELT Wrote: ------------------------------------------------------- > I am kinda stuck as I don’t know what to pursue > just yet and I’d hate to waste my time on > something. I do not think that learning C++well will be a waste of time in any scenario, except maybe if you just want to do hardcore sales or relationship management.

Is there a certification for either? Something that legitimzes the words “Fluent in VBA & C++” on a resume?

buyicide Wrote: ------------------------------------------------------- > Is there a certification for either? Something > that legitimzes the words “Fluent in VBA & C++” on > a resume? From my experience, if the job is asking for “Strong C++/C Programming Skills”, they pretty much mean guru level knowledge, and they will test it. If they just ask for “Comfortable with C++ or any other Object Oriented programming language” Then reading a couple of books and doing a couple of small projects like the one mentioned above can be enough. The only certification I found that could be of value is Associate Java Programmer Certtification ( by SUN), but it’s expensive and I am not sure if my company would pay for it since I am not required to do any hardcore programming.

phBOOM Wrote: ------------------------------------------------------- > If you see Excel everyday, then VBA. If you are a > super quant and/or work at a sophisticated hedge > fund, then maybe C++. This. The only additional advice I can give is to ask yourself how much of your programming will probably be shared with others. If your “bad habits” will generally be self-contained, then stick with VBA. If someone else may need to look at your work in the future, however, good design will go a long way to make things easier. No large project should ever be done in Excel/VBA.

what do you use c++ to create? monte carlo var models? how complex do your models get? for those who use matlab, how extensive is your modeling, what does it entail? all this quant stuff is all new to me but i’m thinking i’m going to head that route. i’ve taken classes in vba before but nothing was finance related…

If you are under 25 with plenty of free time then c++, else vba.

Thanks all. I’m going to take some time and learn C++ since I will probably go that way anyway longer term. Realize it will probably not take 4-6months, but longer. Thanks again.

I’d opt for Matlab. Really easy tool to use. If you get to building really complex and large models there it might be worthwhile to move into C++ since those models will run better. But the extra time it takes to properly master C++ is only worthwhile for those cases but Matlab will be suitable for most models you need. I create a lot of models in Matlab (Local Vol and basic Monte Carlo) and so far it hasn’t let me down. In the future these models might have to be translated to C++ for a better performance but for now it’s more than ok. I also can’t stress the following enough: Matlab is really, really easy and flexible. VBA shouldn’t be abused for complex model. You will get really upset with the horrible performance.