WEBVTT

1
00:00:00.040 --> 00:00:03.240
<v Speaker 1>Okay, so let's unpack this. What if programming isn't just

2
00:00:03.359 --> 00:00:06.240
<v Speaker 1>you know, typing weird symbols. What if it's actually a

3
00:00:06.320 --> 00:00:09.839
<v Speaker 1>key to understanding almost everything digital. I mean, think about

4
00:00:09.839 --> 00:00:13.039
<v Speaker 1>how your computer works, the hardware talking to the software,

5
00:00:13.480 --> 00:00:16.039
<v Speaker 1>or even those huge open world games right how they

6
00:00:16.120 --> 00:00:18.280
<v Speaker 1>just sprung up from ones and zeros. It's kind of amazing.

7
00:00:18.640 --> 00:00:21.120
<v Speaker 1>So today we're doing a deep dive into the complete

8
00:00:21.160 --> 00:00:25.160
<v Speaker 1>Python and C plus plus Manual, second edition. Our mission

9
00:00:25.239 --> 00:00:27.920
<v Speaker 1>really is to pull out the absolute core stuff for you.

10
00:00:28.120 --> 00:00:30.559
<v Speaker 1>The key idea is from this big manual give you

11
00:00:30.600 --> 00:00:33.359
<v Speaker 1>a shortcut to understanding Python and C plus plus day.

12
00:00:33.399 --> 00:00:35.920
<v Speaker 1>See what they can do without getting totally bogged down.

13
00:00:36.759 --> 00:00:38.880
<v Speaker 1>Because this guide it's really set up to make these

14
00:00:38.960 --> 00:00:42.200
<v Speaker 1>powerful languages well less intimidating for beginners.

15
00:00:42.399 --> 00:00:44.920
<v Speaker 2>Yeah, and it's so important because, as a manual points out,

16
00:00:44.920 --> 00:00:47.359
<v Speaker 2>technology is everywhere and it's all connected through programming. It's

17
00:00:47.399 --> 00:00:50.240
<v Speaker 2>not just niche anymore. Getting even a basic handle on

18
00:00:50.320 --> 00:00:52.759
<v Speaker 2>coding it really changes how you see things. You start

19
00:00:52.759 --> 00:00:55.520
<v Speaker 2>to glimpse the logic behind you know, how you phone

20
00:00:55.560 --> 00:00:58.039
<v Speaker 2>apps work, how websites function, all that stuff.

21
00:00:58.600 --> 00:01:01.560
<v Speaker 1>It's genuinely fascinating to me. That the guide picks these

22
00:01:01.600 --> 00:01:05.120
<v Speaker 1>two specifically Python and C plus plus A, calls them

23
00:01:05.359 --> 00:01:08.400
<v Speaker 1>two of the most powerful and versatile programming languages available.

24
00:01:08.640 --> 00:01:11.760
<v Speaker 1>It seems so different but foundational.

25
00:01:11.239 --> 00:01:13.799
<v Speaker 2>Right, absolutely, and that pairing makes a lot of sense.

26
00:01:14.000 --> 00:01:18.560
<v Speaker 2>Python it's brilliant for getting started quickly, super readable, great

27
00:01:18.640 --> 00:01:22.799
<v Speaker 2>for data, web stuff, scripting, fast development. C plus plus A,

28
00:01:23.000 --> 00:01:25.439
<v Speaker 2>on the other hand, that's your heavyweight. It gives you

29
00:01:25.519 --> 00:01:29.799
<v Speaker 2>incredible performance, really fine grain control over the computer's resources,

30
00:01:29.959 --> 00:01:34.120
<v Speaker 2>I think operating systems, game engines, high frequency trading.

31
00:01:33.879 --> 00:01:36.000
<v Speaker 1>So they cover this huge spectrum.

32
00:01:35.560 --> 00:01:39.120
<v Speaker 2>Exactly ease of use versus raw power in a nutshell.

33
00:01:39.159 --> 00:01:42.239
<v Speaker 1>Okay, so let's start with Python. Then. The Friendly Path

34
00:01:42.319 --> 00:01:45.680
<v Speaker 1>to Code, as it's often called. The manual highlights how

35
00:01:45.680 --> 00:01:49.400
<v Speaker 1>it's everywhere Windows, Mac, Linux, even on tiny computers like

36
00:01:49.400 --> 00:01:51.879
<v Speaker 1>the Raspberry Pie. Yeah, and a big part of why

37
00:01:51.879 --> 00:01:54.840
<v Speaker 1>it's friendly is at its high level, which means you

38
00:01:54.840 --> 00:01:57.799
<v Speaker 1>don't have to worry so much about the machine's internal details.

39
00:01:57.840 --> 00:02:00.200
<v Speaker 1>You write code that's more like human language.

40
00:02:00.359 --> 00:02:04.000
<v Speaker 2>Precisely, it abstracts away a lot of the complexity, and

41
00:02:04.079 --> 00:02:07.200
<v Speaker 2>that approach comes from its history stretching back to the eighties,

42
00:02:07.400 --> 00:02:10.759
<v Speaker 2>and this philosophy called the zen of Python. Things like

43
00:02:10.960 --> 00:02:14.240
<v Speaker 2>beautiful is better than ugly, explicit is better than implicit.

44
00:02:14.800 --> 00:02:18.479
<v Speaker 2>Sounds a bit philosophical, but it really translates into code

45
00:02:18.520 --> 00:02:22.319
<v Speaker 2>that's cleaner, easier to read, and less prone to silent errors.

46
00:02:22.520 --> 00:02:25.080
<v Speaker 2>Error should never pass silently. That's another key one.

47
00:02:25.159 --> 00:02:27.719
<v Speaker 1>Right makes sense. And if you're thinking, okay, what do

48
00:02:27.759 --> 00:02:30.199
<v Speaker 1>I actually need to start, the manual is pretty clear

49
00:02:30.280 --> 00:02:35.560
<v Speaker 1>you don't need some monster gaming rig just a regular computer, Windows, Mac, Linux, whatever,

50
00:02:35.879 --> 00:02:39.319
<v Speaker 1>an ide that's an integrated development environment, basically of smart

51
00:02:39.360 --> 00:02:42.800
<v Speaker 1>code editor or even just a basic text editor. Internet

52
00:02:42.840 --> 00:02:47.159
<v Speaker 1>access helps for downloading extras, and crucially it mentions time

53
00:02:47.280 --> 00:02:49.919
<v Speaker 1>and patience, which is probably the most important bit.

54
00:02:49.800 --> 00:02:52.719
<v Speaker 2>Definitely, And maybe the first question people ask is which Python.

55
00:02:52.800 --> 00:02:56.080
<v Speaker 2>There's Python two and Python three. The guide rightly focuses

56
00:02:56.080 --> 00:02:58.639
<v Speaker 2>on Python three point x. That's the present in future.

57
00:02:58.759 --> 00:03:02.120
<v Speaker 2>Python two is legacy and getting it installed, honestly, it's

58
00:03:02.199 --> 00:03:05.639
<v Speaker 2>usually very straightforward. On Windows Macrolnux, they've made that pretty painless.

59
00:03:05.840 --> 00:03:08.360
<v Speaker 1>So once it's installed, you often start with something called

60
00:03:08.360 --> 00:03:11.240
<v Speaker 1>the IDL shell. It's like a little sandbox. Right chop

61
00:03:11.280 --> 00:03:15.639
<v Speaker 1>a command like print hello everyone, hit enter and boom

62
00:03:15.639 --> 00:03:16.520
<v Speaker 1>it happens right there.

63
00:03:16.639 --> 00:03:20.400
<v Speaker 2>Instant feedback exactly. That immediate response is great for learning.

64
00:03:20.520 --> 00:03:23.360
<v Speaker 2>You can play with numbers, do math like two plus

65
00:03:23.400 --> 00:03:26.800
<v Speaker 2>two or three two plus four, see results instantly, and

66
00:03:26.840 --> 00:03:27.360
<v Speaker 2>you start.

67
00:03:27.240 --> 00:03:30.520
<v Speaker 1>Using variables almost immediately. These are just names you give

68
00:03:30.599 --> 00:03:33.400
<v Speaker 1>to pieces of information, like storing your name in a

69
00:03:33.479 --> 00:03:36.360
<v Speaker 1>variable called name, or your age in age.

70
00:03:36.560 --> 00:03:40.400
<v Speaker 2>Yeah. Containers for data, strings of text, numbers, whatever you need,

71
00:03:40.599 --> 00:03:43.120
<v Speaker 2>and you quickly learn you might need to convert between types,

72
00:03:43.240 --> 00:03:45.639
<v Speaker 2>like turning a number into text to print it nicely.

73
00:03:45.919 --> 00:03:48.919
<v Speaker 1>And you can make your programs interactive too, using input

74
00:03:49.360 --> 00:03:51.439
<v Speaker 1>to ask the user a question like what is your

75
00:03:51.479 --> 00:03:53.599
<v Speaker 1>first name and then use their answer.

76
00:03:54.080 --> 00:03:56.800
<v Speaker 2>And as your code gets even a little bit complex,

77
00:03:57.000 --> 00:04:00.439
<v Speaker 2>comments become essential. Using that hash symbol hashtag to leave

78
00:04:00.479 --> 00:04:03.159
<v Speaker 2>notes in your code. They don't affect how the program runs.

79
00:04:03.159 --> 00:04:06.639
<v Speaker 2>They're just explanations for humans, mostly your future self.

80
00:04:06.960 --> 00:04:10.280
<v Speaker 1>Huh yeah, definitely from my future self. And then you

81
00:04:10.360 --> 00:04:13.280
<v Speaker 1>save this code in a file usually ending and to apply,

82
00:04:13.919 --> 00:04:16.680
<v Speaker 1>and you can run that file either from IDL or

83
00:04:16.720 --> 00:04:19.480
<v Speaker 1>directly from the command line. That's the basic workflow.

84
00:04:20.519 --> 00:04:22.839
<v Speaker 2>And as you build bigger things, you don't want all

85
00:04:22.879 --> 00:04:25.680
<v Speaker 2>your code jumble together. That's where functions come in. You

86
00:04:25.759 --> 00:04:28.079
<v Speaker 2>define a block of code with def, give it a name,

87
00:04:28.199 --> 00:04:30.480
<v Speaker 2>say hello, and then you can just call that name

88
00:04:30.519 --> 00:04:32.720
<v Speaker 2>whenever you need that block code to run. They can

89
00:04:32.720 --> 00:04:35.839
<v Speaker 2>even calculate something and return a result. Super useful for

90
00:04:35.959 --> 00:04:37.319
<v Speaker 2>organizing and reasonable.

91
00:04:37.360 --> 00:04:41.839
<v Speaker 1>Code doesn't stop there. Python has this massive ecosystem of modules.

92
00:04:42.240 --> 00:04:43.279
<v Speaker 1>What are those exactly?

93
00:04:43.519 --> 00:04:46.639
<v Speaker 2>Think of them as toolboxes full of pre written code.

94
00:04:46.720 --> 00:04:50.279
<v Speaker 2>You just import the toolbox. You need need advanced math functions,

95
00:04:50.560 --> 00:04:54.279
<v Speaker 2>import math, need random numbers, import random working with dates,

96
00:04:54.519 --> 00:04:57.560
<v Speaker 2>import calendar. It saves you from writing everything.

97
00:04:57.199 --> 00:04:59.720
<v Speaker 1>From scratch, and you can install external ones too, right

98
00:05:00.160 --> 00:05:02.759
<v Speaker 1>like pig game for games exactly.

99
00:05:02.319 --> 00:05:05.439
<v Speaker 2>You use a tool called pip installed pie game to

100
00:05:05.879 --> 00:05:10.600
<v Speaker 2>download and install modules other people have written. It's incredibly powerful.

101
00:05:10.639 --> 00:05:13.480
<v Speaker 2>There are modules for almost everything, like the aus module

102
00:05:13.560 --> 00:05:17.959
<v Speaker 2>lets your Python script interact with the operating system, managing files,

103
00:05:18.040 --> 00:05:21.000
<v Speaker 2>running commands. And if you want to build programs with

104
00:05:21.040 --> 00:05:24.879
<v Speaker 2>buttons and menus a graphical interface, there's te kintern. Okay,

105
00:05:25.199 --> 00:05:27.839
<v Speaker 2>and as you mentioned, p game is fantastic for creating

106
00:05:27.920 --> 00:05:30.920
<v Speaker 2>two D games, both graphical and text based. And the

107
00:05:30.959 --> 00:05:33.600
<v Speaker 2>really cool part is you can create your own modules,

108
00:05:34.120 --> 00:05:37.439
<v Speaker 2>break your large program into logical pieces, save each as

109
00:05:37.439 --> 00:05:39.839
<v Speaker 2>a dot pi file and then import them into your

110
00:05:39.839 --> 00:05:42.279
<v Speaker 2>main script. Makes big projects manageable.

111
00:05:42.360 --> 00:05:45.560
<v Speaker 1>That sounds crucial for bigger stuff. What about handling data

112
00:05:46.040 --> 00:05:47.360
<v Speaker 1>beyond single variables?

113
00:05:47.639 --> 00:05:50.439
<v Speaker 2>Python gives you great tools. You have lists, which are

114
00:05:50.560 --> 00:05:53.160
<v Speaker 2>ordered collections of items, and you can change them, add things,

115
00:05:53.199 --> 00:05:56.160
<v Speaker 2>remove things, reorder them, think like a shopping list. Then

116
00:05:56.160 --> 00:05:59.000
<v Speaker 2>you have twopoles. They're also ordered collections, but once you

117
00:05:59.040 --> 00:06:02.160
<v Speaker 2>create them, you can't change them. They're immutable, good for

118
00:06:02.240 --> 00:06:04.439
<v Speaker 2>things that shouldn't change, like the months of the year.

119
00:06:04.639 --> 00:06:08.279
<v Speaker 1>So lists are flexible. Tuples are fixed, got it. And

120
00:06:08.319 --> 00:06:12.680
<v Speaker 1>then dictionaries. These are brilliant. They store data as key

121
00:06:12.759 --> 00:06:15.959
<v Speaker 1>value pairs, like a real dictionary has a word the

122
00:06:16.079 --> 00:06:19.759
<v Speaker 1>key in its definition the value or a phonebook dot

123
00:06:19.839 --> 00:06:24.000
<v Speaker 1>name key phone number value. Super useful for related info. Right,

124
00:06:24.079 --> 00:06:26.600
<v Speaker 1>I can see that Python's also great with text, what

125
00:06:26.639 --> 00:06:29.279
<v Speaker 1>we call strings. You can easily split a sentence into

126
00:06:29.279 --> 00:06:32.160
<v Speaker 1>words using split, or join a list of words back

127
00:06:32.199 --> 00:06:34.160
<v Speaker 1>into a sentence with dot join.

128
00:06:34.120 --> 00:06:36.279
<v Speaker 2>And formatting the output making it look neat.

129
00:06:36.480 --> 00:06:40.000
<v Speaker 1>Yep, there are powerful ways to format strings, embedding variables

130
00:06:40.040 --> 00:06:44.160
<v Speaker 1>smoothly into text for clear, readable output. Working with dates

131
00:06:44.160 --> 00:06:46.839
<v Speaker 1>and times is also built in getting the current time,

132
00:06:46.959 --> 00:06:49.519
<v Speaker 1>formatting it how you want, even doing calculations.

133
00:06:49.680 --> 00:06:52.399
<v Speaker 2>What about saving data permanently, like, not just in memory

134
00:06:52.439 --> 00:06:53.399
<v Speaker 2>while the program runs.

135
00:06:53.480 --> 00:06:55.920
<v Speaker 1>That's where file handling comes in. Python makes it pretty

136
00:06:55.920 --> 00:06:58.959
<v Speaker 1>easy to open files, read data from them, write new

137
00:06:59.040 --> 00:07:02.000
<v Speaker 1>data to them, and then close them. Essential for storing

138
00:07:02.000 --> 00:07:03.879
<v Speaker 1>information between program runs.

139
00:07:04.040 --> 00:07:07.199
<v Speaker 2>Yeah, essential stuff. Now, programs don't always run perfectly. What

140
00:07:07.279 --> 00:07:12.160
<v Speaker 2>about errors? Ah? Yes, error handling or exception handling. Things

141
00:07:12.199 --> 00:07:15.040
<v Speaker 2>go wrong you try to divide by zero or a

142
00:07:15.040 --> 00:07:19.680
<v Speaker 2>file doesn't exist. Python uses try and accept blocks. You

143
00:07:19.720 --> 00:07:22.240
<v Speaker 2>put the code that might cause an error in the triblock.

144
00:07:22.480 --> 00:07:25.279
<v Speaker 2>If an error occurs, instead of crashing the code in

145
00:07:25.319 --> 00:07:28.959
<v Speaker 2>the corresponding accept block runs. It lets your program handle

146
00:07:29.000 --> 00:07:30.120
<v Speaker 2>problems gracefully.

147
00:07:30.399 --> 00:07:34.759
<v Speaker 1>That's super important for making robust applications. And visually, can

148
00:07:34.800 --> 00:07:35.879
<v Speaker 1>Python draw things?

149
00:07:36.439 --> 00:07:39.399
<v Speaker 2>It can for simple graphics. There's a fun module called

150
00:07:39.399 --> 00:07:42.639
<v Speaker 2>Turtle where you command a little virtual turtle to draw lines.

151
00:07:42.680 --> 00:07:45.920
<v Speaker 2>It's great for learning programming concepts visually and for more

152
00:07:45.920 --> 00:07:48.279
<v Speaker 2>serious graphics and games. As we said, PI game is

153
00:07:48.319 --> 00:07:48.879
<v Speaker 2>the way to go.

154
00:07:49.279 --> 00:07:52.120
<v Speaker 1>So the real logic, the decision making, that comes down

155
00:07:52.160 --> 00:07:53.680
<v Speaker 1>to conditions and loops.

156
00:07:53.439 --> 00:07:56.519
<v Speaker 2>Right, absolutely. The if statement is fundamental. If some condition

157
00:07:56.639 --> 00:07:58.600
<v Speaker 2>is true, do this block of code. You can add

158
00:07:58.639 --> 00:08:01.079
<v Speaker 2>alf elsa for more condition and else for what to do.

159
00:08:01.120 --> 00:08:03.399
<v Speaker 2>If none of the conditions are true, that's your basic

160
00:08:03.439 --> 00:08:04.160
<v Speaker 2>decision making.

161
00:08:04.240 --> 00:08:05.920
<v Speaker 1>And loops for repetition.

162
00:08:05.720 --> 00:08:08.600
<v Speaker 2>Two main types. The wild loob keeps repeating a block

163
00:08:08.600 --> 00:08:11.240
<v Speaker 2>of code as long as its condition stays true. Good

164
00:08:11.319 --> 00:08:13.079
<v Speaker 2>when you don't know exactly how many times you need

165
00:08:13.120 --> 00:08:15.879
<v Speaker 2>to repeat. The four loob is designed to iterate over

166
00:08:15.920 --> 00:08:18.920
<v Speaker 2>a sequence, like each item in a list, or through

167
00:08:18.959 --> 00:08:22.319
<v Speaker 2>a range of numbers. You know upfront how many iterations

168
00:08:22.319 --> 00:08:23.319
<v Speaker 2>you'll have, more or less.

169
00:08:23.399 --> 00:08:25.439
<v Speaker 1>And there's a do wile loop too.

170
00:08:25.759 --> 00:08:28.079
<v Speaker 2>Python doesn't have a direct do wile loop like some

171
00:08:28.120 --> 00:08:30.720
<v Speaker 2>other languages, but you can structure a wile loop to

172
00:08:30.759 --> 00:08:33.320
<v Speaker 2>achieve the same effect, ensuring the code block runs at

173
00:08:33.399 --> 00:08:36.159
<v Speaker 2>least once before the condition is checked. It's a common pattern.

174
00:08:36.240 --> 00:08:39.600
<v Speaker 1>Okay, so that's a whirlwind tour of Python. Now shifting

175
00:08:39.600 --> 00:08:43.399
<v Speaker 1>gears to the other giant C plus plus acle. Why

176
00:08:43.440 --> 00:08:45.399
<v Speaker 1>go down this path? It seems more complex.

177
00:08:45.879 --> 00:08:48.919
<v Speaker 2>It is more complex, but incredibly powerful. The manual calls

178
00:08:48.960 --> 00:08:51.279
<v Speaker 2>it a high level language used in a multitude of

179
00:08:51.279 --> 00:08:55.600
<v Speaker 2>technologies and that's no exaggeration. It's behind so much stuff

180
00:08:55.639 --> 00:08:59.080
<v Speaker 2>you use daily, mobile apps, big console, in PC games,

181
00:08:59.320 --> 00:09:02.320
<v Speaker 2>even entire our operating systems often rely heavily on C

182
00:09:02.440 --> 00:09:06.559
<v Speaker 2>plus plus. So it's complex and extraordinarily powerful, as the

183
00:09:06.600 --> 00:09:09.279
<v Speaker 2>guide says, And it grew out of C right exactly.

184
00:09:09.519 --> 00:09:12.679
<v Speaker 2>It started as an extension of C adding object oriented features.

185
00:09:13.159 --> 00:09:16.759
<v Speaker 2>That object wented programming or OOP is a key part

186
00:09:16.799 --> 00:09:19.799
<v Speaker 2>of C plus plus one. It helps manage complexity in

187
00:09:19.919 --> 00:09:23.679
<v Speaker 2>huge projects by organizing code around objects, things that bundle

188
00:09:23.840 --> 00:09:26.799
<v Speaker 2>data and the operations you can perform on that data.

189
00:09:26.559 --> 00:09:30.320
<v Speaker 1>And that complexity buys you, Yeah, performance control.

190
00:09:30.480 --> 00:09:33.879
<v Speaker 2>Both. C plus plus gives you much lower level access

191
00:09:33.879 --> 00:09:37.039
<v Speaker 2>to the computer's memory and hardware than Python does. This

192
00:09:37.159 --> 00:09:40.399
<v Speaker 2>means you can optimize code for maximum speed and efficiency.

193
00:09:40.919 --> 00:09:43.840
<v Speaker 2>That's why it's indispensable for performance critical applications.

194
00:09:43.919 --> 00:09:46.320
<v Speaker 1>So setting up for C plus plus plus similar to

195
00:09:46.360 --> 00:09:48.919
<v Speaker 1>Python computer ide pretty much?

196
00:09:48.960 --> 00:09:52.679
<v Speaker 2>Yeah, computer ide, text editor, Internet access. But the big

197
00:09:52.720 --> 00:09:53.840
<v Speaker 2>difference is the compiler.

198
00:09:54.159 --> 00:09:56.240
<v Speaker 1>Ah, right, you mentioned that. What does it do again?

199
00:09:56.399 --> 00:09:58.960
<v Speaker 2>The compiler takes your human readable C plus plus code

200
00:09:58.960 --> 00:10:02.159
<v Speaker 2>and translates it directly into machine code. The raw instructions

201
00:10:02.159 --> 00:10:05.399
<v Speaker 2>the computer's processor understands. This happens before you can run

202
00:10:05.399 --> 00:10:09.000
<v Speaker 2>the program. Python being interpreted often does this translation on

203
00:10:09.039 --> 00:10:09.519
<v Speaker 2>the fly.

204
00:10:09.639 --> 00:10:12.799
<v Speaker 1>So C plus plus needs that extra compilation step.

205
00:10:12.960 --> 00:10:17.320
<v Speaker 2>Correct and IDEs like code dot blocks which works on Windows, Linux,

206
00:10:17.320 --> 00:10:21.840
<v Speaker 2>and Mac, or Microsoft's visual Studio for Windows or Apple's

207
00:10:21.960 --> 00:10:25.919
<v Speaker 2>xcode for Mac. They integrate the editor, compiler, and debugger

208
00:10:26.039 --> 00:10:27.320
<v Speaker 2>to make this process smoother.

209
00:10:27.600 --> 00:10:30.679
<v Speaker 1>Got it. So your first C plus plus program still

210
00:10:31.159 --> 00:10:33.519
<v Speaker 1>Hello world almost always.

211
00:10:33.600 --> 00:10:37.000
<v Speaker 2>It introduces the basics hashtag include iostream to bring in

212
00:10:37.080 --> 00:10:41.759
<v Speaker 2>impute output capabilities, using namespace std to simplify naming, and

213
00:10:41.840 --> 00:10:44.759
<v Speaker 2>count to print to the console. But then critically, you

214
00:10:44.799 --> 00:10:47.399
<v Speaker 2>have to compile that code into an executable file, and

215
00:10:47.440 --> 00:10:49.679
<v Speaker 2>then you run the executable. It's a two step process,

216
00:10:49.759 --> 00:10:51.480
<v Speaker 2>unlike Python's usually single step.

217
00:10:51.559 --> 00:10:55.519
<v Speaker 1>That distinction feels important. Compile then execute it really is.

218
00:10:55.559 --> 00:10:57.799
<v Speaker 2>It's fundamental to how C plus plus works and why

219
00:10:57.879 --> 00:10:58.399
<v Speaker 2>it's fast.

220
00:10:58.480 --> 00:11:03.240
<v Speaker 1>Okay, diving into C plus plus specifics. Comments still important.

221
00:11:02.840 --> 00:11:06.000
<v Speaker 2>I assume absolutely. Syntax is a bit different for single

222
00:11:06.000 --> 00:11:09.200
<v Speaker 2>line comments and for multi line blocks, same purpose, though,

223
00:11:09.240 --> 00:11:10.759
<v Speaker 2>explain your code and variables.

224
00:11:10.799 --> 00:11:12.440
<v Speaker 1>You said this was a big difference from Python.

225
00:11:12.879 --> 00:11:16.200
<v Speaker 2>Huge difference in C plus plus A you must declare

226
00:11:16.240 --> 00:11:18.600
<v Speaker 2>the type of a variable before you use it. You

227
00:11:18.639 --> 00:11:21.240
<v Speaker 2>can't just say my var equals ten. You have to

228
00:11:21.279 --> 00:11:25.120
<v Speaker 2>say into my var first, or into my var equals ten.

229
00:11:25.399 --> 00:11:27.720
<v Speaker 1>So you have to explicitly state if it's an integer

230
00:11:27.879 --> 00:11:29.519
<v Speaker 1>or decimal or what exactly.

231
00:11:29.720 --> 00:11:32.279
<v Speaker 2>C plus plus needs to know upfront, how much memory

232
00:11:32.320 --> 00:11:34.919
<v Speaker 2>to set aside, and what kind of data it will hold.

233
00:11:35.080 --> 00:11:38.840
<v Speaker 2>This is called static typing versus Python's dynamic typing.

234
00:11:38.960 --> 00:11:39.720
<v Speaker 1>We're the main text.

235
00:11:39.759 --> 00:11:42.759
<v Speaker 2>Then you've got in for integers, float and double for

236
00:11:42.840 --> 00:11:47.000
<v Speaker 2>floating point numbers, decimals. Double has more precision char for

237
00:11:47.080 --> 00:11:50.960
<v Speaker 2>single characters, boule for true false values, and variations like

238
00:11:51.039 --> 00:11:55.320
<v Speaker 2>rechart for wider characters. Each uses a specific amount of memory.

239
00:11:55.039 --> 00:11:57.279
<v Speaker 1>Okay, and strings like text.

240
00:11:57.519 --> 00:11:59.960
<v Speaker 2>C plus plus has a standard string type, usually for

241
00:12:00.120 --> 00:12:02.919
<v Speaker 2>including the string library, which makes working with texts much

242
00:12:02.960 --> 00:12:07.039
<v Speaker 2>easier than an original C. Basic math operations plus upscotcher

243
00:12:07.080 --> 00:12:09.679
<v Speaker 2>are straightforward, similar to Python and their libraries for a

244
00:12:09.679 --> 00:12:12.240
<v Speaker 2>more complex math like powers, pow and square roots.

245
00:12:12.279 --> 00:12:14.320
<v Speaker 1>How about getting input from the user that's.

246
00:12:14.159 --> 00:12:17.440
<v Speaker 2>Typically done using sin pronounced scene the counterpart to count

247
00:12:17.480 --> 00:12:21.559
<v Speaker 2>see out. Sin reads data from the keyboard into variables, And.

248
00:12:21.519 --> 00:12:24.360
<v Speaker 1>You mentioned formatting output earlier. C plus plus has ways.

249
00:12:24.159 --> 00:12:26.480
<v Speaker 2>To do that too, yes, using what are called Eskik

250
00:12:26.559 --> 00:12:30.080
<v Speaker 2>sequences within strings like n forces a new line at

251
00:12:30.240 --> 00:12:33.360
<v Speaker 2>inserts a tab, useful for making console output readable.

252
00:12:33.519 --> 00:12:36.360
<v Speaker 1>What if you have a value that should never change.

253
00:12:36.039 --> 00:12:38.840
<v Speaker 2>Like the value of pi constants, C plus plus gives

254
00:12:38.840 --> 00:12:41.679
<v Speaker 2>you two main ways. You can use a preprocessor directive

255
00:12:41.720 --> 00:12:45.039
<v Speaker 2>hashtag define pi three point one four one five nine,

256
00:12:45.039 --> 00:12:49.480
<v Speaker 2>which basically does a text replacement before compilation, or the

257
00:12:49.519 --> 00:12:52.080
<v Speaker 2>more modern C plus plus way is using the const

258
00:12:52.240 --> 00:12:55.759
<v Speaker 2>keyword like const float pi equals three point one four

259
00:12:55.840 --> 00:12:58.840
<v Speaker 2>one five nine. This creates a typed constant, which is

260
00:12:58.919 --> 00:12:59.639
<v Speaker 2>generally preferred.

261
00:12:59.679 --> 00:13:02.519
<v Speaker 1>Okay. And file handling saving data YEP.

262
00:13:02.639 --> 00:13:04.960
<v Speaker 2>C plus plus has powerful tools for that too, usually

263
00:13:05.039 --> 00:13:08.720
<v Speaker 2>involving AFT streams file streams. You use if stream input

264
00:13:08.720 --> 00:13:11.120
<v Speaker 2>filestream to read from files and off put filestream to

265
00:13:11.200 --> 00:13:14.559
<v Speaker 2>write to files. It's similar conceptually to Python's file handling,

266
00:13:14.639 --> 00:13:16.559
<v Speaker 2>but with C plus plus syntax.

267
00:13:16.200 --> 00:13:20.159
<v Speaker 1>Makes sense and the logic control loops and decisions. Similar

268
00:13:20.159 --> 00:13:20.639
<v Speaker 1>ideas to.

269
00:13:20.600 --> 00:13:24.320
<v Speaker 2>Python, similar ideas, different syntax. C plus plus has a

270
00:13:24.320 --> 00:13:27.080
<v Speaker 2>wile loop that works just like Python's repeats. While a

271
00:13:27.120 --> 00:13:30.120
<v Speaker 2>condition is true, The four loop in C plus plus

272
00:13:30.159 --> 00:13:33.919
<v Speaker 2>is very common and quite powerful. It typically combines initializing

273
00:13:33.960 --> 00:13:37.480
<v Speaker 2>a counter, checking a condition, and incrementing the counter all

274
00:13:37.519 --> 00:13:41.639
<v Speaker 2>in one line like four int i zero i ten

275
00:13:41.919 --> 00:13:44.720
<v Speaker 2>i plus plus. Very concise for iteration.

276
00:13:45.080 --> 00:13:45.840
<v Speaker 1>Right, that's different.

277
00:13:45.960 --> 00:13:48.840
<v Speaker 2>There's also a do wile loop in C plus plus head.

278
00:13:49.360 --> 00:13:52.240
<v Speaker 2>This one is guaranteed to execute the code block at

279
00:13:52.320 --> 00:13:54.639
<v Speaker 2>least once before it checks the condition at the end.

280
00:13:55.000 --> 00:13:59.279
<v Speaker 2>Useful in certain situations, okay, guaranteed first run. And for decisions,

281
00:13:59.399 --> 00:14:02.120
<v Speaker 2>you have if statement. Just like Python, you can chain

282
00:14:02.200 --> 00:14:05.039
<v Speaker 2>conditions with els and provide a default case with else.

283
00:14:05.519 --> 00:14:08.840
<v Speaker 2>The structure is very similar, just the syntax details differ slightly,

284
00:14:09.159 --> 00:14:12.440
<v Speaker 2>like using curly braces to define code blocks instead of indentation.

285
00:14:12.679 --> 00:14:14.200
<v Speaker 1>That indentation difference is huge.

286
00:14:14.679 --> 00:14:18.159
<v Speaker 2>It's one of the most visible distinctions. Yeah, Python relies

287
00:14:18.200 --> 00:14:21.679
<v Speaker 2>on white space. C plus plus uses braces and semicolons.

288
00:14:21.799 --> 00:14:23.639
<v Speaker 1>Okay, so we've seen the nuts and bolts of both.

289
00:14:23.919 --> 00:14:26.879
<v Speaker 1>Let's talk about avoiding problems. What are some common mistakes

290
00:14:26.879 --> 00:14:28.759
<v Speaker 1>people make when coding? Generally?

291
00:14:29.039 --> 00:14:32.759
<v Speaker 2>Oh, plenty typos are classic X a mistake, then trying

292
00:14:32.759 --> 00:14:35.200
<v Speaker 2>to use y happens to everyone. Another big one the

293
00:14:35.240 --> 00:14:37.559
<v Speaker 2>manual mentions is trying to write the whole program at

294
00:14:37.559 --> 00:14:40.440
<v Speaker 2>once instead of breaking it into small, testable chunks.

295
00:14:40.519 --> 00:14:42.120
<v Speaker 1>Yeah, I could see that getting messy fast.

296
00:14:42.320 --> 00:14:46.559
<v Speaker 2>Using unclear variable names is another killer. XYZ might seem quick,

297
00:14:46.600 --> 00:14:48.600
<v Speaker 2>but a month later you have no idea what they mean.

298
00:14:48.759 --> 00:14:54.440
<v Speaker 2>Use descriptive names and neglecting comments seriously comment your.

299
00:14:54.320 --> 00:14:57.200
<v Speaker 1>Code plan ahead too, right. Don't just start typing.

300
00:14:57.320 --> 00:15:01.679
<v Speaker 2>Absolutely think about the logic before coding, and anticipate user errors.

301
00:15:01.960 --> 00:15:04.440
<v Speaker 2>What happens if the user types text when you expect

302
00:15:04.440 --> 00:15:07.600
<v Speaker 2>a number? Your program needs to handle that gracefully.

303
00:15:07.759 --> 00:15:11.159
<v Speaker 1>Good point? What about general best practices? Backups?

304
00:15:11.720 --> 00:15:14.879
<v Speaker 2>Always have backups of your code. Use version control like

305
00:15:14.960 --> 00:15:17.519
<v Speaker 2>get if you can. Don't reinvent the wheel. If there's

306
00:15:17.559 --> 00:15:20.559
<v Speaker 2>a standard library or well tested solution for something, use it.

307
00:15:20.919 --> 00:15:24.480
<v Speaker 2>Think about data security, especially if you're handling passwords or

308
00:15:24.519 --> 00:15:29.799
<v Speaker 2>personal info. Nowhere to find help documentation forms like stack overflow, communities,

309
00:15:30.000 --> 00:15:33.679
<v Speaker 2>and don't underestimate basic math skills. They pop up surprisingly off.

310
00:15:34.039 --> 00:15:38.360
<v Speaker 1>Okay, specifically for Python beginners. Any common traps. The manual points.

311
00:15:38.080 --> 00:15:41.159
<v Speaker 2>Out the Python two versus Python three confusion still trips

312
00:15:41.200 --> 00:15:44.159
<v Speaker 2>people up. Sometimes just stick with Python three and the

313
00:15:44.159 --> 00:15:50.200
<v Speaker 2>big one indentation tabs versus spaces getting it wrong. Python

314
00:15:50.279 --> 00:15:53.799
<v Speaker 2>needs consistent indentation to understand your code structure. It's not

315
00:15:53.919 --> 00:15:54.279
<v Speaker 2>just for.

316
00:15:54.200 --> 00:15:56.799
<v Speaker 1>Looks right, the braces versus white space.

317
00:15:56.480 --> 00:16:00.799
<v Speaker 2>Thing again exactly. Also, avoid just blindly copy and code

318
00:16:00.840 --> 00:16:04.000
<v Speaker 2>from the internet without understanding how it works. It's tempting,

319
00:16:04.080 --> 00:16:07.480
<v Speaker 2>but you won't learn effectively. And again, commenting is vital

320
00:16:07.480 --> 00:16:11.000
<v Speaker 2>in Python two, especially because its dynamic nature can sometimes

321
00:16:11.000 --> 00:16:13.320
<v Speaker 2>make code flow less obvious later on.

322
00:16:13.519 --> 00:16:18.080
<v Speaker 1>Got it, So comment, understand, indent correctly. Use Python three.

323
00:16:18.039 --> 00:16:20.440
<v Speaker 2>Pretty much sums up the key Python pitfalls. So to

324
00:16:20.480 --> 00:16:22.159
<v Speaker 2>sort of wrap up, we've covered a lot of ground

325
00:16:22.399 --> 00:16:25.840
<v Speaker 2>from Python's you know, user friendliness, it's readability, it's huge

326
00:16:25.840 --> 00:16:28.519
<v Speaker 2>set of tools for getting things done quickly to tease.

327
00:16:28.600 --> 00:16:31.720
<v Speaker 2>Plus plus is raw power, it's control, its role in

328
00:16:31.759 --> 00:16:34.600
<v Speaker 2>building the really high performance foundations of software we use

329
00:16:34.639 --> 00:16:38.279
<v Speaker 2>every day. They're different beasts, but both incredibly valuable.

330
00:16:38.440 --> 00:16:40.639
<v Speaker 1>It's been quite the journey through both. So the next

331
00:16:40.639 --> 00:16:42.480
<v Speaker 1>step for you, the listener, Well, the best way to

332
00:16:42.559 --> 00:16:44.720
<v Speaker 1>learn is to do grab a guide like this one,

333
00:16:45.240 --> 00:16:48.519
<v Speaker 1>fire up an ID and just start playing. Try making

334
00:16:48.600 --> 00:16:51.720
<v Speaker 1>a simple calculator in Python, or maybe use t kinter

335
00:16:51.840 --> 00:16:54.480
<v Speaker 1>to build a little window with a button, or explore

336
00:16:54.519 --> 00:16:57.519
<v Speaker 1>pig game. Or if C plus plus's performance intrigues you,

337
00:16:57.559 --> 00:17:01.000
<v Speaker 1>try writing some basic programs that manipulate data. See how

338
00:17:01.039 --> 00:17:02.200
<v Speaker 1>the compile step works.

339
00:17:02.399 --> 00:17:05.359
<v Speaker 2>Just experiment, definitely, and that leads to a final thought,

340
00:17:05.440 --> 00:17:08.519
<v Speaker 2>maybe something to chew on. We've seen how Python excels

341
00:17:08.519 --> 00:17:11.400
<v Speaker 2>in ease and rapid development, and C plus plus excels

342
00:17:11.400 --> 00:17:15.759
<v Speaker 2>and performance and control. So thinking about that contrast, what

343
00:17:15.839 --> 00:17:19.039
<v Speaker 2>kind of really complex, challenging problem out there do you

344
00:17:19.039 --> 00:17:22.440
<v Speaker 2>think could only be properly tackled by cleverly combining ideas

345
00:17:22.480 --> 00:17:25.359
<v Speaker 2>or approaches inspired by both the Python and the C

346
00:17:25.440 --> 00:17:26.599
<v Speaker 2>plus plus philosophies.
