If you can read this, either the style sheet didn't load or you have an older browser that doesn't support style sheets. Try clearing your browser cache and refreshing the page.

(IT World)   Here's why economists should learn C++, aside from the obvious social benefits   (itworld.com) divider line 77
    More: Interesting  
•       •       •

2186 clicks; posted to Geek » on 08 Jul 2014 at 3:34 PM (10 weeks ago)   |  Favorite    |   share:  Share on Twitter share via Email Share on Facebook   more»



77 Comments   (+0 »)
   
View Voting Results: Smartest and Funniest

First | « | 1 | 2 | » | Last | Show all
 
2014-07-08 02:24:29 PM
Interesting.  Too bad they didn't post the code...but at least they have a paper detailing what they did.
 
2014-07-08 02:39:06 PM

UberDave: Interesting.  Too bad they didn't post the code...but at least they have a paper detailing what they did.


Code is right here:  https://github.com/jesusfv/Comparison-Programming-Languages-Economics

I may try to optimize the R stuff. R ain't fast, but it ain't that slow either.
 
2014-07-08 03:38:53 PM
I don't know of any economists who don't know C++ (or who don't at least list C++ on their LinkedIn accounts).
 
2014-07-08 03:42:12 PM
I am not sure these comparisons are useful at all.  If your only metric is speed then no need to include the script languages at all, because they will ALWAYS be significantly slower than a true compiled executable.  Also, Java is not technically a compiled language.  It is rendered down to what is called byte code and this byte code is read by the JRE (java runtime environment) on the OS and that is what is turned into the machine instructions.  Thus it will be slower as well.

I have not used Fortran since college back in the late 80's but list all of those and I could have told you before you started that C++ walks away with the speed award.  However, speed is only one factor and many times not even in the top 5 most important factors.  Otherwise why would those other languages be so popular?

 C and more so C++, require a steep learning curve before you can proficiently develop in these languages. Also, a compiled windows program can't be used on anything other than a windows OS. You are limited by what you have a the compiler for, and which machines you compile it on -- and if you need web based.. yeah.. Also, they said they did not optimize any of the code... compiling is IMHO a very KEY optimization. It is specific for that machine but  it is efficient as hell on it.

Java because it uses the JRE and you can get a Windows, and Linux, and Mac OS, etc. JRE -- allows a java program developed on windows to run on any OS and it is part of nearly all key web tech. stacks. Now, why use a Python script since it is so slow. Well, chase Python down to it's bottom and you will find... tada.. C. However, you can quickly and easily learn the Python syntax and it will also be useable an any OS that has python.

All of these will have a far superior portability across multiple OS, be much easier for a non-programer to understand and modify, and be easier to port to a web interface.

Ultimately, this article is saying that a horse is faster than a man. Well duh..   However, that doesn't put him at the top O' the food chain does it.
 
ZAZ [TotalFark]
2014-07-08 03:45:56 PM
People did real world analysis using interpreted APL on IBM systems before today's grad students were born. It was probably compiled internally, but the user interface was interactive rather than batch.
 
2014-07-08 03:46:09 PM
img.fark.net

/ just to get the thread headed in the right direction
 
2014-07-08 03:48:11 PM
That's just stupid.

Compiled programs run faster than interpreted programs.  Yeah, I think we knew that.

Well written C is faster than Fortran.  I'll give you that too.

Who the fark cares?  The language to use is the one that lets you express the concept you're trying to model, not the one that runs fastest once compiled.
 
2014-07-08 03:48:31 PM

NetOwl: I don't know of any economists who don't know C++ (or who don't at least list C++ on their LinkedIn accounts).


Of course, any Rational Actor wouldn't list that on their LinkedIn account.


The problem with any language isn't run-time, it's the time it takes to write and debug the software.  If an economist can write quick and bug-free code in COBOL, then let them have it.
 
2014-07-08 03:50:47 PM
Economists should learn C++ so they would have one useful skill.

"Economic Experts" have the dubious advantage of being able to be consistently wrong -- every damn time -- and still be considered experts.  How often have you heard this phrase on the news, "economic indicators took a sharp upswing/downswing, surprising economic experts who had predicted [something else]"?
 
2014-07-08 03:54:28 PM
Gee.  something designed to be 'Lean and mean' is faster than general purpose modeling language.

And compiled programs are faster than scripts.
 What startling revelations.   When did  Ric Romero start writing for IT World?


/And no discussion of ease of development vs run speed?
 
2014-07-08 03:56:48 PM
For Server-Side languages, economists should learn ASP.net. They'll spend so much time registering viewstates, that they won't realize how much time and money they're wasting by registering viewstates...
 
2014-07-08 03:58:34 PM

Marine1: [img.fark.net image 850x478]

/ just to get the thread headed in the right direction


I will say this.... I had no desire to ever use any MS language or it's proprietary IDE.  However, C# got me to break with tradition because they finally got something right! I have a C# compiler (free version) now.  I am surprised it hasn't gained more notoriety than it has... It is actually a usable, elegant language and something I never thought I would see coming from MS.
 
2014-07-08 04:21:04 PM
So, C++ was faster than FORTRAN, but I can't imagine the difference cited in the article would make the cut as "statistically significant". Java was about half as fast.

But let's be realistic here. Any of the languages listed are more than fast enough to outpace the economist's gold standard, which apparently (based on historical performance) consists of throwing darts while drunk, stoned, and blindfolded.
 
2014-07-08 04:22:28 PM
But, if you're a young economist trying to decide what language to invest some time in learning, these results suggest that C++ is the way to go.

No. No. No. No. No. No.

And any economist that arrives at that conclusion because a simulation took 0.81 seconds instead of 2 seconds should be fired, because that's bad economics.

C++ is faster to run, sure. But C# means no farking around with pointers or worrying that you didn't destroy an object. I've seen a memory leak bring a server to its knees and a team spend a week trying to find it while forcing a reboot every few hours to stop the server running out of memory and you will not have that problem with C# because the CLR takes care of it.
 
2014-07-08 04:23:10 PM

OgreMagi: Economists should learn C++ so they would have one useful skill.

"Economic Experts" have the dubious advantage of being able to be consistently wrong -- every damn time -- and still be considered experts.  How often have you heard this phrase on the news, "economic indicators took a sharp upswing/downswing, surprising economic experts who had predicted [something else]"?


You're assuming two - very wrong - things.

1)  Economists are a singular block, and when something changes in the market, they are all surprised because they all expected something different.  This is incorrect.  Media just tags any change in the market as a surprise, and notes that it contradicts a report that came out previously.  That report came from "an" economist, not "all" or even "most" economists.

2)  There is an expectation that any field that works to model the future is aiming for a perfectly predictive model.  This is also incorrect.  All models are wrong, some models are useful.  The idea is to understand a complex system as best as possible, and learn more about it and its behavior and mechanisms for change.  Necessarily, unless you have figured out a complex behavior to a perfect degree (an impossibility), you will never be able to predict its day to day behavior with any level of perfection.  Again, that's not the goal.

You don't want an economist, you want a crystal ball.
 
rpm
2014-07-08 04:39:05 PM

farkeruk: But C# means no farking around with pointers or worrying that you didn't destroy an object.


Did you remember to call Dispose?
 
2014-07-08 04:46:23 PM

gunslinger_RG: Marine1: [img.fark.net image 850x478]

/ just to get the thread headed in the right direction

I will say this.... I had no desire to ever use any MS language or it's proprietary IDE.  However, C# got me to break with tradition because they finally got something right! I have a C# compiler (free version) now.  I am surprised it hasn't gained more notoriety than it has... It is actually a usable, elegant language and something I never thought I would see coming from MS.


I'm no Windows fanboy, but I think MS has been stepping up their game lately. PowerShell, SCCM, Hyper-V are are all pretty legit. Making server-core the defualt install path on Server 2012 is telling as well IMO.

Now, if it weren't for all those pesky licensing issues, I would be all for them... It really is a dealbreaker though, so I'm looking forward to putting CentOS 7 to use.
 
2014-07-08 04:46:59 PM

rpm: Did you remember to call Dispose?


only on unmanaged objects.
 
rpm
2014-07-08 04:49:55 PM

farkeruk: rpm: Did you remember to call Dispose?

only on unmanaged objects.


Which says you probably have leaky code. Run the code analysis tool lately?
 
2014-07-08 05:09:17 PM
People who don't understand software development study software development, come to hilariously incorrect conclusion.

/c++ programmer
 
2014-07-08 05:17:35 PM

schnee: UberDave: Interesting.  Too bad they didn't post the code...but at least they have a paper detailing what they did.

Code is right here:  https://github.com/jesusfv/Comparison-Programming-Languages-Economics

I may try to optimize the R stuff. R ain't fast, but it ain't that slow either.


Cool thanks!  I don't know why I didn't try github - or was there a link and I just missed in in skimming through the paper?
 
2014-07-08 05:26:10 PM
For a non-programmer economist writing a C++ program:

- Time needed to create a version which successfully compiles to an executable: 7.3 days
- Time needed to run the compiled program: 0.73 seconds
- Time needed to debug and fix the memory leaks, crashes, and logic so it produces the correct results: 7.3 weeks
 
2014-07-08 05:31:43 PM
meh... I was programming my Commodore 64 in Assembly when I was 12, C++ is for lazy people
// get off my lawn

LDA #$FF
STA $D000
BRK
 
2014-07-08 05:38:04 PM

UberDave: schnee: UberDave: Interesting.  Too bad they didn't post the code...but at least they have a paper detailing what they did.

Code is right here:  https://github.com/jesusfv/Comparison-Programming-Languages-Economics

I may try to optimize the R stuff. R ain't fast, but it ain't that slow either.

Cool thanks!  I don't know why I didn't try github - or was there a link and I just missed in in skimming through the paper?


You skimmed over the link.
 
2014-07-08 05:41:48 PM

Marine1: [img.fark.net image 850x478]

/ just to get the thread headed in the right direction


C# is a great general purpose language, but its slow and limited if you want "close to the metal" access and performance.

I wish Microsoft would embrace D.
 
2014-07-08 05:59:42 PM
What about the likely hood that they will make more mistakes using C++ ?
 
2014-07-08 06:07:43 PM
IDK...but Julia seems the way to go. RTC and can call C libraries natively.
 
2014-07-08 06:08:48 PM
www.macinchem.org
 
2014-07-08 06:11:06 PM

rpm: Which says you probably have leaky code.


I don't.
 
2014-07-08 06:20:14 PM
I've done my share of both, but well written java can be quite fast. In fact the built in optimizations built into new jres often detect bad things that inexperienced programmers do and the net effect is code that actually runs faster than code written in a bare metal language..

There's also realtime versions of the JRE for use in hard realtime systems that.. They're biggest customers are the defense, and surprise, the finacial industry..
 
2014-07-08 06:23:54 PM

warrenn: For a non-programmer economist writing a C++ program:

- Time needed to create a version which successfully compiles to an executable: 7.3 days
- Time needed to run the compiled program: 0.73 seconds
- Time needed to debug and fix the memory leaks, crashes, and logic so it produces the correct results: 7.3 weeks


Cool! When did they start doing this?
 
2014-07-08 06:27:20 PM

mr lawson: [www.macinchem.org image 701x197]


What that table fails to consider is development time.  For example, yesterday I needed to run some benchmark tests on a database server (postgresql).  It took me all of five minutes to write a bash script that ran the tests using a dozen different database sizes.  It took about 15 minutes for the script to run (create the database, load up the tables, run a butt-load of select statements, drop the database, rinse, repeat).  Creating the same test in a compiled language would have saved me a bit of run time, at the expense of a much longer development time.  The bottle neck to this kind of code is the database server, not the code speed.  The script was really nothing more than a filter to clean up the output so it could be shoved into gnuplot.
 
2014-07-08 06:28:07 PM

dforkus: well written java


Ha ha.  You expect me to believe that?
 
2014-07-08 06:36:46 PM
A fluent C/C++ programmer is going to write correct code just as quickly as a fluent Java, C#, Python, etc. programmer. There is more of a learning curve though, which poses a problem when you're talking about people who write a few programs a year, as opposed to someone who spends most of their time coding or thinking about coding.

C/C++ are very useful skills to have, but only if you can leverage them into an arena where those skills are necessary. Systems programmers, for example, continue to be paid wages above generic software programmers, but those skills aren't likely to be useful for someone who writes single-purpose programs.
 
2014-07-08 06:44:52 PM

Obscene_CNN: What about the likely hood that they will make more mistakes using C++ ?


That's the goal. They're doing economics. The hope is that errors in the program will cancel errors in the theory and the final answer will be right.
 
2014-07-08 06:46:54 PM
I would say their experimental methodology is made mostly of flaws.
 
2014-07-08 06:53:05 PM
Laugh if you want to, but LabVIEW rocks for quick and easy iterative calculations.  Just draw a picture of what you want to do and hit RUN...

Environment is expensive, though...
 
2014-07-08 06:54:49 PM

reincarnation_mutation: LDA #$FF
STA $D000
BRK


Set sprite 0's X position to decimal 255..?
 
2014-07-08 07:00:23 PM

OgreMagi: What that table fails to consider is development time.


no argument there.
 
2014-07-08 07:01:41 PM

schnee: UberDave: Interesting.  Too bad they didn't post the code...but at least they have a paper detailing what they did.

Code is right here:  https://github.com/jesusfv/Comparison-Programming-Languages-Economics

I may try to optimize the R stuff. R ain't fast, but it ain't that slow either.


I was going to say MATLAB, which is excellent for almost anything that doesn't need to go on the HPC.
 
2014-07-08 07:04:50 PM

emonk: Laugh if you want to, but LabVIEW rocks for quick and easy iterative calculations.  Just draw a picture of what you want to do and hit RUN...

Environment is expensive, though...


*scratches head*
Why would your run econ sims in labview?
 
2014-07-08 07:42:11 PM
I make my living off of C++. It's my strongest skill. I have, just in the past week, finally admitted that it's an obsolete language. The amount of defensive programming needed to make reliable programs with C++ is simply too big of a productivity hit. It will survive for another fifty years, but it simply isn't a good language in comparison to others.
 
2014-07-08 07:44:56 PM
This thread restores my faith in the Geek tab.

Reading that article was a serious WTF experience.
 
rpm
2014-07-08 08:02:50 PM

farkeruk: rpm: Which says you probably have leaky code.

I don't.


Yeah, you do. I have a rule of thumb that anyone who says the garbage collector handles most leaks has leaky code. I've never seen an exception yet. It's held across multiple languages and platforms.
 
2014-07-08 08:35:21 PM

Fubini: A fluent C/C++ programmer is going to write correct code just as quickly as a fluent Java, C#, Python, etc. programmer.


Well, yes and no.  The raw number of errors is likely to be fairly similar, but the different languages and runtime environments can provide different levels of error detection and analysis tools.  There are plenty of types of errors that would compile and (maybe) work in C++ that the C# compiler would just refuse to compile.  Then there are other types that would produce an obvious runtime error in C# instead of insidiously appearing to work.

For example, Heartbleed would not have been possible if OpenSSL were written in (managed) C#, which mandates bounds checking on arrays; a buffer overread would just trigger an exception, rather than return data from elsewhere in process memory.
 
2014-07-08 08:59:32 PM
Okay, in the Fortran code, they declared the variables as double precision, but left the numerical constants as single precision. They also did a lot of integer/single precision/double precision mixed-mode arithmetic. So I can't tell how much is the compiler's fault, and how much is due to sloppy programming.

Also, Intel contributed a fair amount of development to the gcc compilers while they were developing 64-biatchip architectures. I probably would have gone with the Pathscale or Portland Group compilers for comparison purposes.
 
2014-07-08 09:03:11 PM

schnee: Code is right here: https://github.com/jesusfv/Comparison-Programming-Languages-Economics


My. Dear. Lord.  Whose farking idea was it to post Mathematica notebook files in text form?  Rowbox[Rowbox[Rowbox....

Next to torture ourselves, we'll read a book in postscript, and then read over some g-code and try to imagine what the machine will make with it.

mr lawson: emonk: Laugh if you want to, but LabVIEW rocks for quick and easy iterative calculations.  Just draw a picture of what you want to do and hit RUN...

Environment is expensive, though...

*scratches head*
Why would your run econ sims in labview?


It's not as weird as it sounds.  Labview can be pretty damn fast.  Big projects with multiple coders are where it sux hard though.  For banging out a quick simulation it's not bad at all.
 
2014-07-08 09:07:46 PM

Sum Dum Gai: Fubini: A fluent C/C++ programmer is going to write correct code just as quickly as a fluent Java, C#, Python, etc. programmer.

Well, yes and no.  The raw number of errors is likely to be fairly similar, but the different languages and runtime environments can provide different levels of error detection and analysis tools.  There are plenty of types of errors that would compile and (maybe) work in C++ that the C# compiler would just refuse to compile.  Then there are other types that would produce an obvious runtime error in C# instead of insidiously appearing to work.

For example, Heartbleed would not have been possible if OpenSSL were written in (managed) C#, which mandates bounds checking on arrays; a buffer overread would just trigger an exception, rather than return data from elsewhere in process memory.


What good would OpenSSL if it only ran on windows?
 
2014-07-08 09:23:04 PM

but whole: What good would OpenSSL if it only ran on windows?


C# can be used on Linux as well; I've done some projects in Mono before.
 
2014-07-08 09:57:27 PM

rpm: Yeah, you do. I have a rule of thumb that anyone who says the garbage collector handles most leaks has leaky code. I've never seen an exception yet. It's held across multiple languages and platforms.


I double checked. Microsoft and everyone on Stackoverflow disagrees with you.
 
Displayed 50 of 77 comments

First | « | 1 | 2 | » | Last | Show all

View Voting Results: Smartest and Funniest


This thread is closed to new comments.

Continue Farking
Submit a Link »






Report