Either you fuck the life or the life fucks you.
转载自 quora
大致翻译一下,不喜勿喷,谢谢支持!以下是内容:
I have used each of them for 15-20+ years. There is no best. They have different strengths and weaknesses.
这些我都用了15到20多年,没有最好的,只是各自有各自的优缺点。
- C and C++ require a lot of discipline because you have to do memory management yourself.
C和C++需要编程人员有很好的自制力,因为它们需要我们自己进行内存管理。 - C++ is extremely powerful but also very complex.
C++非常的强大,但是很复杂。 - C and C++ are "dangerous" because, if you are not careful, your program can access and modify data that it is not supposed to touch.
C和C++很“危险”,因为一不小心,你的程序就会修改你不希望被修改的数据。 - Python is elegant and designed to be easy to use and read. It has the least distractions when it comes to syntax.
Python很优雅,并且易用易读,不用为语法的事情烦心。 - The syntax of C, C++ and Java look somewhat similar. Python looks different, it uses indentation instead of {} to group code.
C C++和Java看起来类似,但是python却不同,因为python使用缩进而不是{} - Python comes with "batteries includes", that means it has a lot of functionality build-in in the standard library.
python内置电池,也就是说在python的标准库中有很多的内置函数。 - In Python there is 'one way to solve a problem'. On the other end, in C++ there are way more ways to solve the same problem. This added choice can distract you form solving the problem.
解决问题,python只有一种方法,但是C++会有多种方法,多的方法只会干扰你解决问题 - Java has the best IDE support (e.g. eclipse or IntelliJ)
Java有最好的IDE支持(例如:eclipse或者IntelliJ) - C and C++ are also statically typed, but the preprocessor can add a level of complexity that can make it difficult to be sure what actually happens.
C与C++是静态类语言,预处理器会增加程序的复杂程度。 - In terms of speed C/C++ are fastest, but for most problems Java is very close in speed. Python can be slow, but if needed critical parts can be written in C. On modern execution speed is rarely the limit - cache behaviour, memory and disc access are the limits.
总的来说,C与C++是最快的,但对大多数问题来说,Java也差不离。python相对就慢些,但如果需要有些重要的部分可以用C进行编写。现在执行速度不是什么限制,-缓存,内存 硬盘才是限制。
If you want to learn programming, I would learn python first, then Java, then C and finally C++.
如果你想学习编程,我会首先学习python,然后Java,C,最后是C++。I personally would not recommend C++ because of its complexity. However, if your are disciplined and have a strict set of rules for a project, C++ can be fantastic.
就我个人而言,因为C++的复杂性,我不会推荐它,如果你非常有纪律性,并且很严格,那么C++可以带你飞。I would use C only for low level stuff, like writing device drivers.
我会用C来写底层的东西,比如设备的驱动。Java is good for large projects, provided you write good APIs and you are carefully modularizing your software.
Java对于大项目来说的是极好的,有很好的APIs,你要很小心的模块化你的软件。(将就着看看,如果有不同意见可以留言。)Python is good for small projects. If the team and the software gets bigger, it can become hard to maintain unless you have a very good test coverage.
小项目使用python很棒,如果团队与软件变得庞大,那就会很难维护了,除非有很好的测试覆盖率。