标签云

微信群

扫码加入我们

WeChat QR Code

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.


poor programmers tend to be poor with all languages, so changing everything just to suit the numpties won't be a solution. I'd recommend teaching them how to be better instead, it'll pay off significantly. (and use STL and a nice XML lib - tinyXML is good)

2018年08月16日16分28秒

gbjbaanb On the flip side, I'd rather poor programmers use Python than C++. Example, a Python developer can't make inter-module globals. He can't get in trouble with initialization order of globals He's kind of forced to design things in a somewhat modular way and it's a little harder to get those disastrously bad designs in Python that can wreak havoc throughout the system. That said, I'm mainly a C++ enthusiast (check my profile), but I've seen the disastrous kind of C++ coding first hand and think a language like Python would actually be better in the hands of less experienced programmers.

2018年08月16日16分28秒

There are less ways for such a developer to crash a program in Python. Accessing a variable with 'None' would cause an exception rather than undefined behavior (ex: access violation or segfault). There's no C-ish type casting/bitwise sort of logic (x-raying/bypassing types) that C++ developers sometimes do out of bad habit. There's also no way for them to slow down the build system by ignoring important idioms like pimpls for central headers. So, assuming such code monkeys are going to have a hard time getting their code or design correct [...]

2018年08月16日16分28秒

[...] I'd rather trust them with Python than C++ as the result of poor coding is not quite as disastrous. Of course, I'd much rather they just understood what they were doing, and if there are any unemployed developers on this forum, some of these top users really have great expertise when it comes to general engineering concepts and C++ usage.

2018年08月16日16分28秒

-1 for Java (doesn't really help the OP much at all), but +1 for "people who are bad with memory management tend to be bad with all languages".

2018年08月16日16分28秒

Oh, just now realized, this question is 2 y old. Never mind.

2018年08月16日16分28秒

Episodex: Please tell, Why python generate results "so lately" & Why c++ generate results "so early??."

2018年08月16日16分28秒

Mostly because python is a script language, which I think is slower by definition than compiled one. In my particular case I had to compute millions of operations on the lists of integers. Python's advanced lists are much slower than using just simple array with fixed length in C++ (I didn't need any of advanced features of these lists). And last but not least, as far as I know C++ (or C) is the next top speed language after Assembler ;).

2018年08月16日16分28秒

thanks, but I read at Stackoverflow in one of user comment that if Python is slow, dont worry, Because CPU time is much more cheaper than the Developer time.

2018年08月16日16分28秒

im sure your advice is great, but i dont think its relevant anymore, why are you posting on a question asked 4 years ago?

2018年08月16日16分28秒