Python for Decision Makers and Business Leaders Transcripts
Chapter: Python vs.
Lecture: Python vs. C++
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Next up in the ring is Python and C++ though C++ is one of the more established mainstream programming languages
0:09
it's one of the core computer science capabilities. This is like, I want to build Windows or I want to build Linux maybe I'm going to use C++.
0:17
So, or I'm going to build, you know, 3D video games, right? This is probably the best of the low-level programming languages out there
0:25
as I'm sure you know. And, I'm going to throw C and C++ they kind of play in the same realm. So let's just put them together.
0:31
Now, we have it as a versus but you'll see that it's also plus. It could be Python and C++, as we'll see. But let's start out by looking
0:39
at the direct comparison of choosing one or the other. Are they both open source? Yes. They're both open source. Compiled?
0:47
C++ is definitely one of the compiled languages. You've got a big project it's not unreasonable for it to take 3 or 4 minutes
0:53
before you can run the thing to see if what you just did worked. Whereas with Python, it's almost instant. It it owned by a company? Nope.
1:01
Base class library? No. C++ does not really have a base library. There are libraries that you can find like STL, Standard Template Library.
1:10
But C++ kind of came before this idea of you get the programming language and thousands of little helper things classes, functions, whatever
1:20
that can help you do stuff. Like, I've got a whole list of a bunch of stuff duplicated create me a counter and give me the top 25 of them.
1:26
Right, like that in C++ is not super easy. So, no, it doesn't have a base class library. You can go get other libraries, but it's not the same.
1:35
Web capabilities? No. C++ not really used in the web. You can integrate it into web apps but people don't build mainstream web applications
1:43
like you saw with Flask, they don't do that with C++. Database capabilities? I'm going to say moderate, not that you can't
1:50
talk to databases with C++, you definitely can. It's just not as simple, it's not as easy as it is in Python.
1:56
So, in true capabilities, maybe they're equal. But in, I'm sitting down to do this thing how long will it take me to get done?
2:03
It's going to take you a lot longer to actually get that database stuff working in C++ because it's just not as simple. They don't have cool libraries
2:11
or even any of the framework from when we talked about before. Mobile capabilities? C++ is strong here. You can build iOS and Android apps.
2:19
Definitely iOS and I think Android as well. You can definitely build iOS apps in C++. So, not the main way to do it
2:26
but you can integrate C into those languages and make that a core part of what you're doing. Again, Python, not good at this. Desktop apps?
2:34
Yeah, a lot of desktop apps are written in C++. Most of the games you interact with are C++. Things like Word, those are written in C++.
2:43
Even Notepad on Windows is written in C++. Again, it's not super easy. There are frameworks and libraries like MFC. There are better choices.
2:51
I would definitely not start to build desktop applications with C++, but compared to Python I think it's in a better place.
2:57
There are like visual designers and whatnot that are, okay. Stack overflow rank for C++, 6. That's pretty far down the list, isn't it?
3:05
Again, you're putting it up against the number one contender over there, so, yeah, that's not great. Even on TIOBE, I would kind of think C++
3:13
would show a little stronger, but it is behind Python in TIOBE as well. So it's 4, Python's 3. Price?
3:20
These are both free. Of course you can buy tooling that can do stuff for these languages that cost money for either side
3:24
but they're free. General purpose? Yes, again this is very important. Scientific computing level? Strong and very strong.
3:32
C++ is very strong at doing computation stuff many many computational things are done with it but there are fewer libraries.
3:40
You can't go and say, oh give me the 800 libraries to do biology with C++. There's just a smaller set of these external libraries to work with.
3:49
So I'm going to put it as strong but it depends what you're doing. If you've got to do really fast computation maybe it's the right choice?
3:55
I don't know. Python has fast things like Numpy too. These are always very subjective but my feeling is these are both good options
4:01
but they're very, kind of they play in different worlds almost and what you're trying to accomplish there.