Performance differences between Python and C

后端 未结 14 1308
闹比i
闹比i 2020-12-31 08:02

Working on different projects I have the choice of selecting different programming languages, as long as the task is done.

I was wondering what the real difference is

14条回答
  •  无人及你
    2020-12-31 08:19

    Is there really a noticeable difference between sorting a textfile using the same algorithm in C versus Python, for example?

    Yes.

    The noticeable differences are these

    1. There's much less Python code.

    2. The Python code is much easier to read.

    3. Python supports really nice unit testing, so the Python code tends to be higher quality.

    4. You can write the Python code more quickly, since there are fewer quirky language features. No preprocessor, for example, really saves a lot of hacking around. Super-experience C programmers hardly notice it. But all that #include sandwich stuff and making the .h files correct is remarkably time-consuming.

    5. Python can be easier to package and deploy, since you don't need a big fancy make script to do a build.

提交回复
热议问题