- Back to Home »
- Why All Economists Should Learn C++
Posted by : Unknown
Monday, March 18, 2013
In my opinion, the C++ computer programming language gives economists and other business professionals the greatest degree of flexibility and sophistication to quickly analyse data and infer conclusions from it. But, wait a minute... Don't we have Excel for that? We do indeed, I use it myself.
Nonetheless, using a spreadsheet program to analyse economic data does have its limitations. In most instances, a spreadsheet is not very efficient at analysing new data that is updating instantaneously. Let's take a simple example; suppose that we are running a regression equation that analyses the relationship between GDP and consumption. Essentially, we wish to see if higher GDP is correlated with higher consumption:
Y Variable (Consumption) = Intercept + X Variable (GDP)
Technically, it is possible to plot the data for GDP and consumption in Excel, or any other spreadsheet program and regress the two. However, suppose that we have new data coming in by the hour, minute or second? Now is when the conundrum occurs - the spreadsheet will not calculate the new values unless we have specifically set up a macro through VBA to do so. In addition, this will have limitations as:
1) a spreadsheet program only has so many rows and columns;
2) one has to continuously open and refresh the spreadsheet to analyse the results - this could have potentially long waiting times;
3) spreadsheets become very sluggish when it comes to analysing vast amounts of data and can potentially crash as a result.
C++ is much more efficient at handling such a task, as the user has the ability to both allocate memory in a more efficient way to ensure faster processing times, and the flexibility of specifying a specific location for the retrieving of data does not make the user dependent on one particular spreadsheet to complete the task. Suppose we have two separate files with very low data storage requirements (e.g. typically a txt. or csv. file); one contains GDP figures, the other contains consumption data. In addition, suppose that these files were continuously being updated through a server, e.g. Reuters, Bloomberg Terminal, etc. Once we have the raw data, we can program C++ to do anything with the data in those two files - we can run regressions on the data, we can analyse how the data has changed over a short time frame, perform several calculations at once, etc. This is why many statisticians use programs such as Stata over Excel to analyse vast amounts of data at once (incidentally enough, both of these programs were written using the C++ language). However, an added advantage of knowing the programming language is the user has the ability to tell the computer what to do, not the other way around.
To conclude, spreadsheet programs may be useful up to a certain point. However, they are limited in what they can achieve on their own. They are not an application as such, and a C++ programmer is in a much better position to manipulate data in ways most of us never dreamed possible.

Post a Comment