C++14 vs Python

Hi friends,

I have a small query, am a Python programmer, also done some programming in C/C++ previously.
Now am getting attracted by the latest c++14 features, like variable templates / binary literals etc which makes me think that I must lean towards c++ back.
It's the only language which can be implemented for both low level projects / high level projects.

Looking at c++14 features... Am getting confused, are they copying python features?

Which one is more rich ? c++14 or Python in terms of features, flexibility ?
Expert answers plz :)

Many Thanks,
Santee
Last edited on
You don't have to wait until C++14, they're available now in C++11.
It's the only language which can be implemented for both low level projects / high level projects.
i don't know where you saw that, but its most incorrect thing you said in this thread. there are many languages which can be used high and or low level, python included

Looking at c++14 features... Am getting confused, are they copying python features?

how could they do that? they are very different

Which one is more rich ? c++14 or Python in terms of features, flexibility ?

both are very flexible and are feature rich. it depends on what you want to do
When it comes to deciding which language to use, you can't be asking yourself which is more feature rich because come back in 2-3 years and any programming language now will be more feature rich than it was previously. The question to ask is which is most helpful and easy to use? And python will always answer "yes" to those questions.
however c++ can answer yes too. once again, it depends on what you want to do.
Both languages are meant for rather different purposes, and consequently have very different feature sets. It's hard to say that one is "richer" than the other without a set of criteria by which one can judge what constitutes "richer".

C++ is (IMO) better for more performance-sensitive and generally larger-scale applications, though it can do small-scale applications very well too. As a compiled language with excellent optimizing compilers, C++ is one of the fastest languages in existence (inb4 Java fanboys yakking on about JIT).

Python is a good language for rapid development of code that isn't highly performance sensitive. It's equally good for small-scale applications and throw-away scripts. Assuming no platform-specific code is used, Python is also inherently easier to run on other systems than C++ due to being interpreted vs compiled.

C++ is definitely the more complex language in terms of syntactical features offered, but that's not inherently a good thing when the interactions between language features cause unintuitive behavior (and that DOES happen).

C++ doesn't have a built-in equivalent to eval, mostly because it would be really freaking tedious to implement. It's not impossible to do in C++, though for C++'s intended applications I'm not entirely sure why you'd need to.

Python's standard library offers more facilities for day-to-day tasks (directory traversal, file compression, networking, XML parsing, etc). C++ leaves these to the user to either implement themselves or find a library to do for them (although C++1Z/C++17 will probably include networking). Ironically, this isn't inherently a bad thing, as a lack of a much-desired feature in a popular language will spawn various libraries for that feature, each doing something a bit differently, giving you choices.

EDIT:
LBT wrote:
there are many languages which can be used high and or low level, python included

Python should NOT be used for low-level programming, even if there are ways to compile it.

-Albatross
Last edited on
o.O and why is that?
Python was designed as a high-level language with zero intent to be used as a low-level language, as reflected in its origins as a dynamically-typed interpreted language. Many Python features would call for large amounts of assembly to implement in any common modern architecture, resulting in huge abstraction penalty. Outside of standard library routines, the core language exposes little to nothing of the underlying system. The list goes on and on.

EDIT: Actually, is there a compiler for Python?

-Albatross
Last edited on
Awesome answer, thanks Albatross for walking me thru the performance section, and yes c++ performance is the best...
Topic archived. No new replies allowed.