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