Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

When would you consider incorporating another language into your project? Some domains are inherently multi-language ( Database interaction, interactive web client side development), but others could be done with 1 language and the idea of introducing another language could hinder understanding more than help it.

Currently I have high performance code in C++ that also needs to do a fair amount of routine file and i\o manipulation which would be easier and faster to write correctly in a higher order language like Python. To be honest I don't know C++ extremely well when it comes to 3rd party libraries including Boost.

share|improve this question

closed as primarily opinion-based by MichaelT, gnat, Bart van Ingen Schenau, Dan Pichelman, World Engineer Nov 19 '13 at 15:00

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

6 Answers 6

up vote 7 down vote accepted

Different programming languages have their strengths and weaknesses, and I find nothing wrong with wanting to take advantage of each. I would caution that you have a strong boundary, however. For example, blender has python on the user interface and scripting layers, but C and C++ further down. That arrangement works quite well, where one or two python classes thrown in here and there would probably not.

share|improve this answer
    
+1 for mentioning different programming languages have their strengths and weaknesses. –  Fanatic23 Feb 8 '11 at 11:59

Well the first thing that comes to mind is web programming. Other than that it is generally better to keep the number of languages to a minimum if at all possible. You may know C++, Python, PHP, and Visual Basic, but the people who inherit the project from you may not. Unless there is a massive benefit from adding (most of the time) an unnecessary complexity, I avoid it.

share|improve this answer

I know personally if I had to do heavy computations in a .Net program I would use F# and C# to write the program. I would try to do the calculations in an async workflow in F# while the rest of the code would be in C# as it is much easier to do that kind of thing in F# and the two languages would mesh well together because of the .Net framework.

share|improve this answer

Anytime those languages, given the programmer expertise and skills currently available, are best for the job.

And there are many platforms which glue together a compiled language an an interpretive language for development combinations requiring max performance plus other stuff, including iOS/iPhoneOS(+webview), Android(+NDK), and webOS(+PDK).

share|improve this answer

I'm always using multiple languages within a single project. It is always much more efficient than any single language, no matter what the problem domain is. It is called Language Oriented Programming. It really helps if there is a common platform that simplifies an interaction between different languages, but things like C++ and Python works well together without such a platform.

share|improve this answer

There are many projects that can benefit from a smattering of an embedded scripting language. Especially small, easily embeddable languages like Lua or Tkl can be integrated very easily.

However, most interpreted languages will never reach the speed of a natively compiled one. If performance is at a premium, this has to be considered. That said, even some low-performance embedded-device can probably run Lua code just fine if it is not used in the most performance critical part.

Most scripting languages offer great advantages in terms of programmer productivity (or non-programmer-interoperability!) over compiled low-level languages like C/C++.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.