The Power of Multi-Language Applications
wbav queries: "I've been programming for a number of years, and someone always asks, 'What language do you use, Java or C++?'. Now personally, I find that question a little biased, mainly because, of how I program. Rather than making one massive program, adding in all the support I need to make up for weaknesses in languages, I prefer to make several different apps that call each other, each using the strengths of that particular language. I tend to use C++ as my controlling program, and then execute Perl, PHP, or Java depending on what will give me the best performance for and cause me the least amount of pain to accomplish the task at hand. Do you guys use this kind of method, or do you try to do everything in one program? What advantages or disadvantages do you see in creating one program compared to many programs?"
Absolutely. You should always use the best tool for the job.
Case in point, at where I work now, I inherited a Perl script which handles software sales on our website. It's an ugly bastard of a thing -- 1300 lines, like 60K long, no naming scheme on the variables, etc.
So, rather than try to figure out all this code, I instead wrote a nice little Perl module that I use to call PHP code. Even went so far as to design a little communications protocol so that the PHP code can pass back values and the Perl can parse them and pass those variables to other PHP scripts.
Is it a bit resource intensive? Yep. But the tradeoff is that I did this in a fraction of the time that it would have taken me to hack on the existing Perl code, and since there's a big crunch to get this done on time, the boss is happy and I look good.