Should I move from C++ to Python? … Or another language? [closed]

Tags: linux python c++
Question!

In the company I work for, we do a lot of file-based transaction processing. The processing centers around the conversion of files between numerous formats to suit numerous systems in numerous companies.

The processing almost always involves an XML stage and can include a lot of text parsing, database lookups, data conversion and data validation.

Currently the programs performing all these tasks are written in C++ and they perform quite quickly all on one average server. I'm investigating the possibilities of using a more "modern" language that newer graduate programmers are more likely to be familiar with. (Correct memory allocation in C++ seems to causes problems with a lot of newer programmers these days)

Based on the brief information provided, would a language such as python provide the required functionality and performance, as well as addressing the memory allocation (and various other C++ related) problems which arise?

I like the idea of not needing to compile the programs each time we make a change. I understand that the interpreted languages probably wont hit the same performance we currently get.

Our systems are Linux based which also restrict some options.

Any comments on the functionality and performance available with Python or suggestions of alternative languages would be much appreciated.



Answers

Another alternative is to embed Python in your C++ program. You could keep much of your application the same, and make calls out to Python for the pieces that change often, or need the flexibility that a scripting language provides.

From the Python docs

The previous chapters discussed how to extend Python, that is, how to extend the functionality of Python by attaching a library of C functions to it. It is also possible to do it the other way around: enrich your C/C++ application by embedding Python in it. Embedding provides your application with the ability to implement some of the functionality of your application in Python rather than C or C++. This can be used for many purposes; one example would be to allow users to tailor the application to their needs by writing some scripts in Python. You can also use it yourself if some of the functionality can be written in Python more easily.



I agree with others, you should stick with C++. Switching to a non-compiled language is a step backwards. While many programmers may have trouble dealing with some of the troublesome aspects of the language (such as pointers), at least most programers have been exposed to some C++. I recommend you spend your time and money improving your codebase and programmers rather then switching languages.

As for other languages, you may want to keep your eye on GO lang. A friend of mine used it fairly extensively. It's a modern compiled language. It tends to be clear, concise, and modern. GO applications typically run at speeds comparable to those written in C++ and it interfaces well with the web. It's not very mature at this point but it looks promising.

Good Luck!



if the nature of the project you are doing allows you to even contemplate such a move, then do move (assuming that you have some clue). In many C++ projects however, your only choice is moving down one or two abstraction levels (e.g., to C or Assembly).



This video can help you solving your question :)
By: admin