1
00:00:02,440 --> 00:00:05,240
Now of course, now that we know that,

2
00:00:05,240 --> 00:00:07,319
we can write server side code.

3
00:00:07,319 --> 00:00:11,210
So does code that executes on the remote machine?

4
00:00:11,210 --> 00:00:14,707
The obvious next question is how that works?

5
00:00:14,707 --> 00:00:17,423
How do you write server side code?

6
00:00:18,460 --> 00:00:19,560
Well, for that,

7
00:00:19,560 --> 00:00:23,750
you need a programming language that can be executed on such

8
00:00:23,750 --> 00:00:25,040
a server.

9
00:00:25,040 --> 00:00:26,200
And that's important.

10
00:00:26,200 --> 00:00:29,502
Now we are not talking about some programming language

11
00:00:29,502 --> 00:00:31,970
that's executed by a browser,

12
00:00:31,970 --> 00:00:36,354
but really by the server that is targeted when you enter a

13
00:00:36,354 --> 00:00:38,290
certain URL.

14
00:00:38,290 --> 00:00:42,220
So the server that contains the HTML CSS

15
00:00:42,220 --> 00:00:43,820
and JavaScript code.

16
00:00:43,820 --> 00:00:46,924
Now it does not just need to contain that code.

17
00:00:46,924 --> 00:00:49,302
It also might have extra code,

18
00:00:49,302 --> 00:00:51,668
which is not sent back to the browser,

19
00:00:51,668 --> 00:00:54,982
but which instead should be executed on the server for the

20
00:00:54,982 --> 00:00:58,083
reasons mentioned over the last lectures.

21
00:00:59,030 --> 00:01:02,020
So we need a specific programming language that can execute

22
00:01:02,020 --> 00:01:05,535
there and not in the browser and to understand which options

23
00:01:05,535 --> 00:01:07,200
we have here.

24
00:01:07,200 --> 00:01:10,758
It's important to understand that a server

25
00:01:10,758 --> 00:01:14,250
in the end, is just a regular computer.

26
00:01:14,250 --> 00:01:17,780
We call it a server because it serves a website.

27
00:01:17,780 --> 00:01:21,829
It sends back responses to browsers sending requests.

28
00:01:21,829 --> 00:01:25,400
But in the end, it's just a regular computer,

29
00:01:25,400 --> 00:01:28,583
a computer configured to serve a website.

30
00:01:29,580 --> 00:01:32,190
Now, since it is a regular computer, though,

31
00:01:32,190 --> 00:01:36,330
that means that we can execute any programming language on

32
00:01:36,330 --> 00:01:39,189
that server because all programming languages can be

33
00:01:39,189 --> 00:01:41,583
executed on computers.

34
00:01:42,590 --> 00:01:46,510
And now the only limiting factor when we have to choose a

35
00:01:46,510 --> 00:01:51,498
programming language is how well it's suited for web

36
00:01:51,498 --> 00:01:56,498
development and for working with databases and generating

37
00:01:57,160 --> 00:02:00,800
HTML code on the mind. And so on.

38
00:02:00,800 --> 00:02:03,850
And here we have some programming languages that are very

39
00:02:03,850 --> 00:02:06,270
popular for web development,

40
00:02:06,270 --> 00:02:10,250
and we have other languages that are less commonly used

41
00:02:10,250 --> 00:02:13,690
because they are not optimized for this task.

42
00:02:13,690 --> 00:02:17,054
Very popular choices. For example, are Python,

43
00:02:17,054 --> 00:02:20,910
it's easy to learn and can be used for web development.

44
00:02:20,910 --> 00:02:25,330
It's a very common choice, also PHP,

45
00:02:25,330 --> 00:02:30,330
which was super popular in the early 2000s and 2010s

46
00:02:30,643 --> 00:02:35,279
and it's still extremely popular and helpful,

47
00:02:35,279 --> 00:02:40,279
but also languages like C Sharp or Java script though,

48
00:02:40,780 --> 00:02:44,880
here, we typically call it node JS.

49
00:02:44,880 --> 00:02:47,520
Now I'll come back to that JavaScript node JS.

50
00:02:47,520 --> 00:02:48,580
Pardon a second.

51
00:02:48,580 --> 00:02:52,200
Let me quickly talk about these other languages and all the

52
00:02:52,200 --> 00:02:56,990
languages that are not listed here because that's important.

53
00:02:56,990 --> 00:03:01,990
You could also use Java or C + + or any other language,

54
00:03:02,470 --> 00:03:05,700
but some of them are not really optimized for that,

55
00:03:05,700 --> 00:03:07,959
or might be too complex. For example,

56
00:03:07,959 --> 00:03:12,523
C + + is not really used for web development

57
00:03:12,523 --> 00:03:16,730
and some languages simply didn't fit on this page.

58
00:03:16,730 --> 00:03:18,655
Java is very popular.

59
00:03:18,655 --> 00:03:23,151
I just wanted to only show some languages here.

60
00:03:23,151 --> 00:03:27,060
Now all of the languages listed on this slide,

61
00:03:27,060 --> 00:03:31,910
there is one language that has a great advantage and that's

62
00:03:31,910 --> 00:03:35,223
node JS slash Java script.

63
00:03:36,240 --> 00:03:39,660
All these languages are great and are commonly used for web

64
00:03:39,660 --> 00:03:40,520
development.

65
00:03:40,520 --> 00:03:45,520
But node JS is JavaScript outside of the browser.

66
00:03:45,920 --> 00:03:49,573
In the previous course sections you'll learn that JavaScript

67
00:03:49,573 --> 00:03:53,163
is the third language that can be executed by a browser.

68
00:03:53,163 --> 00:03:58,163
And that it's often used to add interactivity to a website.

69
00:03:59,130 --> 00:04:02,080
And that's true. That is what we use JavaScript for.

70
00:04:02,080 --> 00:04:05,810
And that is what it was originally invented for.

71
00:04:05,810 --> 00:04:06,940
But over the years,

72
00:04:06,940 --> 00:04:10,914
people determined that it could be interesting to take the

73
00:04:10,914 --> 00:04:14,051
engine that's built into browsers,

74
00:04:14,051 --> 00:04:19,010
that is responsible for executing JavaScript code there out

75
00:04:19,010 --> 00:04:22,149
of the browsers and execute JavaScript outside of a browser

76
00:04:22,149 --> 00:04:24,820
to be specifically no JS.

77
00:04:24,820 --> 00:04:28,150
And the end is the JavaScript engine.

78
00:04:28,150 --> 00:04:31,530
So the tool inside the tool that is responsible for

79
00:04:31,530 --> 00:04:34,456
executing JavaScript code that was built into Chrome,

80
00:04:34,456 --> 00:04:38,060
or that is still built into Chrome.

81
00:04:38,060 --> 00:04:41,260
Now it was all taken out of Chrome as a standalone tool.

82
00:04:41,260 --> 00:04:44,087
So to say and therefore, with help of node JS,

83
00:04:44,087 --> 00:04:47,750
which is an extra piece of software that you can install on

84
00:04:47,750 --> 00:04:48,712
your system.

85
00:04:48,712 --> 00:04:52,963
You can execute JavaScript code outset of a browser.

86
00:04:53,890 --> 00:04:58,520
Now on node js.org, you can download and install that tool.

87
00:04:58,520 --> 00:05:01,260
And we will do that in the next course section.

88
00:05:01,260 --> 00:05:02,870
You don't need to do it right now,

89
00:05:02,870 --> 00:05:06,380
and it will be available for all operating systems.

90
00:05:06,380 --> 00:05:09,730
I'm on Mac OS that's why it's showing this here,

91
00:05:09,730 --> 00:05:12,610
but you'll also find it for windows and you can also install

92
00:05:12,610 --> 00:05:14,821
it on Linux. And so on.

93
00:05:14,821 --> 00:05:19,170
The great thing about node JS is that you can run JavaScript

94
00:05:19,170 --> 00:05:23,057
code with it and that it enriches this JavaScript code that

95
00:05:23,057 --> 00:05:27,672
you can execute with more features that are not available

96
00:05:27,672 --> 00:05:32,274
inside of a browser, for example, inside of a browser,

97
00:05:32,274 --> 00:05:35,030
if you execute JavaScript code there.

98
00:05:35,030 --> 00:05:36,920
So if you write JavaScript code,

99
00:05:36,920 --> 00:05:39,192
as we did it in the previous course sections,

100
00:05:39,192 --> 00:05:43,070
there are certain operations which you can't perform there,

101
00:05:43,070 --> 00:05:44,960
interacting with the file system,

102
00:05:44,960 --> 00:05:48,180
just like that. Reaching out to databases.

103
00:05:48,180 --> 00:05:52,310
All that is not really possible in the browser for security

104
00:05:52,310 --> 00:05:54,590
reasons. Because as a web developer,

105
00:05:54,590 --> 00:05:56,651
you shouldn't be able to just start interacting

106
00:05:56,651 --> 00:06:01,173
with your visitor's file systems and reaching out to a

107
00:06:01,173 --> 00:06:04,721
database. Also can have certain security problems.

108
00:06:04,721 --> 00:06:08,610
If you do it from inside a browser performance can also be

109
00:06:08,610 --> 00:06:09,443
an issue.

110
00:06:09,443 --> 00:06:10,276
Now,

111
00:06:10,276 --> 00:06:13,500
since that engine was taken out of the browser here with

112
00:06:13,500 --> 00:06:14,990
this note JS tool,

113
00:06:14,990 --> 00:06:18,860
if you execute JavaScript code with that node JS tool,

114
00:06:18,860 --> 00:06:20,811
something we'll do in the next core sections,

115
00:06:20,811 --> 00:06:24,830
then you have more features available because in such an

116
00:06:24,830 --> 00:06:25,750
environment,

117
00:06:25,750 --> 00:06:29,400
all these performance and security considerations don't

118
00:06:29,400 --> 00:06:33,070
matter anymore because you'll then run code on your own

119
00:06:33,070 --> 00:06:35,830
machine instead of the machines of your visitors.

120
00:06:35,830 --> 00:06:38,330
And that's a key difference.

121
00:06:38,330 --> 00:06:43,204
And therefore, node JS also is a very popular choice when it

122
00:06:43,204 --> 00:06:46,540
comes to writing service side back and code.

123
00:06:46,540 --> 00:06:48,450
Because with that,

124
00:06:48,450 --> 00:06:51,656
we can use our existing JavaScript knowledge,

125
00:06:51,656 --> 00:06:55,120
add more features to it.

126
00:06:55,120 --> 00:06:58,440
Something we will do over the next core sections and then

127
00:06:58,440 --> 00:06:59,770
write back and code.

128
00:06:59,770 --> 00:07:04,290
And we don't have to learn a brand new programming language.

129
00:07:04,290 --> 00:07:05,901
That's why in this course,

130
00:07:05,901 --> 00:07:09,779
we'll focus on node JS for backend development,

131
00:07:09,779 --> 00:07:13,320
but of course, once you completed this course,

132
00:07:13,320 --> 00:07:16,990
and once you feel more confident as a web developer,

133
00:07:16,990 --> 00:07:21,040
you can also explore other languages like Python or PHP or

134
00:07:21,040 --> 00:07:25,440
Java or whatever you want to also see if you maybe then

135
00:07:25,440 --> 00:07:30,286
prefer using those languages, but no JS is super popular.

136
00:07:30,286 --> 00:07:33,521
We can leverage our existing JavaScript knowledge.

137
00:07:33,521 --> 00:07:36,982
It's a high performance backend language,

138
00:07:36,982 --> 00:07:40,881
and therefore it's a great choice to learn as a web

139
00:07:40,881 --> 00:07:42,720
developer and that's

140
00:07:42,720 --> 00:07:46,530
Why we will now dive deeper into node JS and backend web

141
00:07:46,530 --> 00:07:49,303
development in the next course sections.

