¿Cuándo es apropiado usar C++ en lugar de un lenguaje de nivel superior? [cerrado]

When is the use of C/C++ more appropriate than the use of very high level programming languages like python?

preguntado el 28 de agosto de 12 a las 12:08

Why use Python? If you have a reason, use it. I personally only use C, C++, JavaScript, Bash and occasionally Perl (when Bash isn't good enough). -

Ever try writing a driver in python? Or almost anything that interacts with hardware at a low level -

If you are developing a compute intensive & multi threaded application, use C/C++ since Python suffers from GIL (Global Interpreter Lock). Since most userspace applications have IO mixed with compute, Python is good enough and you will gain through increased productivity. For anything in kernel space, you have no choice but to use C/C++. -

I post a line here which explains why not to use Python. But I don't think so it will answer your cause. stackoverflow.com/questions/371966/… not sure if you checked upon the below discussion. programadores.stackexchange.com/questions/113295/… y programadores.stackexchange.com/questions/29109/… -

I'm thinking for most applications python is fast enough. Partially agree with this. When it comes to performance, nothing can beat C. -

1 Respuestas

Countless reasons...

  1. You need to use an essential library that works best in C or C++
  2. You are not interested in learning a new language
  3. You need to access system APIs or resources not available in Python
  4. Your project structure is better suited for the syntax of C or C++
  5. You want to use features of C or C++ that you cannot get in Python, most notably compile-time checks. Or you know, switch Declaraciones.
  6. External tool support, for example static analysis is much harder for Python.
  7. Rendimiento
  8. The project is already written in C++ and you don't want to port it
  9. You want to ensure that it can be run on a minimal installation without an interpreter
  10. You need debugging info from the client machine in the form of a debuggable minidump
  11. simplemente no como Python


Respondido 28 ago 12, 12:08

While i agree with the points listed, in cases where python has the modules that allow you to do OS specific low level tasks (eg packet capture), the use of C++ can be challanged - yohannista

@user1470033 -- Sure. Ultimately we have a whole bunch of programming languages because they're all good at one thing or another. Just choose a language that is suited for the task at hand. - mgilson

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.