1
00:00:00,330 --> 00:00:01,450
All right welcome back.

2
00:00:01,650 --> 00:00:06,550
So as I promised in the last video we're now done with just pure command line basics.

3
00:00:06,810 --> 00:00:11,240
We're going to continue to use all of the commands we talked about in pretty much every video.

4
00:00:11,520 --> 00:00:14,070
But they're not going to be the focus of the videos going forward.

5
00:00:14,070 --> 00:00:19,590
They're just now another tool for us to use as we learn new technologies the new technology that we're

6
00:00:19,590 --> 00:00:20,320
going to learn about.

7
00:00:20,340 --> 00:00:22,120
And this video is no.

8
00:00:22,140 --> 00:00:22,740
Yes.

9
00:00:22,890 --> 00:00:27,420
And before we get there I'm just going to make a new directory to put some files in.

10
00:00:27,470 --> 00:00:36,780
So I'm going to make directory intro to node just like that and then CD into intro to node just for

11
00:00:36,780 --> 00:00:43,880
more practice and I'll add a file objectives dot empty and this file won't actually do anything all

12
00:00:43,890 --> 00:00:48,630
that will use it for is a place for me to put some objectives so that we can guide what we're going

13
00:00:48,630 --> 00:00:50,420
to talk about in this lecture.

14
00:00:50,430 --> 00:00:55,630
So this is intro to node and there are just two main points I want to talk about.

15
00:00:55,770 --> 00:00:58,550
The first one is what is node.

16
00:00:59,010 --> 00:01:02,770
The second one is Why are we learning it.

17
00:01:03,720 --> 00:01:07,900
And then the very last point is it doesn't matter.

18
00:01:07,920 --> 00:01:10,040
So I'll come back to that at the end.

19
00:01:10,070 --> 00:01:13,140
So let's begin and talk about what node is.

20
00:01:13,170 --> 00:01:18,750
So you might have heard of node before and that's because right now it's the trendiest hottest thing

21
00:01:18,750 --> 00:01:21,070
in web development for whatever that's worth.

22
00:01:21,120 --> 00:01:23,520
We're going to talk more about why we're actually learning it.

23
00:01:23,520 --> 00:01:27,720
I assure you that it's not just because it's trendy but that is one reason that you may have heard of

24
00:01:27,720 --> 00:01:34,050
it before it's all over the place on blogs and books and all sorts of conferences node is all the rage

25
00:01:34,050 --> 00:01:34,730
.

26
00:01:34,770 --> 00:01:36,470
So what is node.

27
00:01:36,780 --> 00:01:39,860
I have the official know O.J.'s home page here.

28
00:01:39,860 --> 00:01:41,270
Node JS. dot org.

29
00:01:41,520 --> 00:01:49,700
And according to this page no J S is a javascript runtime built on Chromes V8 javascript engine no JSE

30
00:01:49,710 --> 00:01:56,610
uses an event driven non-blocking IO model that makes it lightweight and efficient no JSF package ecosystem

31
00:01:56,730 --> 00:02:01,060
NPM is the largest ecosystem of open source libraries in the world.

32
00:02:01,650 --> 00:02:05,500
So let me try and explain it in a simpler easier to understand way.

33
00:02:05,910 --> 00:02:10,460
Up until a few years ago all the javascript that you wrote had to run in the browser.

34
00:02:10,500 --> 00:02:15,870
It was the only place for you to execute javascript code and that meant that all javascript that you

35
00:02:15,870 --> 00:02:18,150
wrote was only front end code.

36
00:02:18,150 --> 00:02:22,330
You couldn't do anything server side because the only place that it could run is the browser.

37
00:02:22,590 --> 00:02:24,770
So that's what we've been doing up until this point.

38
00:02:24,810 --> 00:02:31,260
Writing our javascript in js files linking them through a script tag to an Tim L file an opening that

39
00:02:31,260 --> 00:02:35,780
in the browser but that all changed a few years ago when no genius came along.

40
00:02:36,000 --> 00:02:40,980
So all that note is is a way for us to write javascript code on the server side.

41
00:02:41,430 --> 00:02:47,400
So remember this diagram from the intro to back end lecture where I showed a generic stack where this

42
00:02:47,400 --> 00:02:54,150
line right here denotes the boundary between the back and or server side and the front end or client

43
00:02:54,150 --> 00:02:56,130
side before node came along.

44
00:02:56,130 --> 00:03:01,350
All the javascript we wrote was happening up here on the front it just like all of the JavaScript we've

45
00:03:01,380 --> 00:03:02,330
written so far.

46
00:03:02,610 --> 00:03:09,870
And then on the back end there were languages like Python or DHP or Ruby or Java but javascript was

47
00:03:09,870 --> 00:03:10,850
not an option.

48
00:03:11,010 --> 00:03:12,900
But no it changed all of that.

49
00:03:12,900 --> 00:03:17,820
Now we can write javascript code right here on the server side interact with our database to start a

50
00:03:17,820 --> 00:03:24,090
server to create new files and all sorts of server side logic and we can write javascript on the front

51
00:03:24,090 --> 00:03:24,570
end.

52
00:03:24,840 --> 00:03:28,170
So what that means is that we can now write javascript everywhere.

53
00:03:28,440 --> 00:03:29,670
Sort of wrap that up.

54
00:03:29,730 --> 00:03:35,850
I don't want you to get too hung up on the terminology of a javascript runtime built on Chromes V8 javascript

55
00:03:35,850 --> 00:03:36,780
engine.

56
00:03:36,910 --> 00:03:43,310
All that you need to take away for now is that node is how we run javascript on the server side.

57
00:03:43,860 --> 00:03:45,110
So that was the first point.

58
00:03:45,360 --> 00:03:50,990
What is node the next and probably more important point is why are we even learning it.

59
00:03:51,630 --> 00:03:57,630
So as I mentioned earlier node is definitely the hippest the trendiest it technology for people to be

60
00:03:57,630 --> 00:03:58,640
learning right now.

61
00:03:58,860 --> 00:04:04,440
But I'll say this right now that is the smallest reason why we're learning it so it's not something

62
00:04:04,440 --> 00:04:05,730
that we can ignore.

63
00:04:05,820 --> 00:04:10,260
But it is definitely the least important of the reasons that I'm going to mention.

64
00:04:10,530 --> 00:04:12,480
So add that here.

65
00:04:13,170 --> 00:04:14,530
It's popular.

66
00:04:14,700 --> 00:04:15,970
We can't deny that.

67
00:04:15,990 --> 00:04:20,730
I'll show you some stats and charts that reveal some interesting trends about how Noad compares to other

68
00:04:20,730 --> 00:04:24,080
similar technologies in the last few years.

69
00:04:24,120 --> 00:04:27,690
So what does it mean for a technology to be popular.

70
00:04:27,690 --> 00:04:32,670
The first thing that I'll mention is that node is definitely popular amongst existing developers.

71
00:04:32,730 --> 00:04:38,670
Almost everyone that I know who is an engineer or a senior engineer has picked up node on the side as

72
00:04:38,670 --> 00:04:41,880
something that they're interested in something that they want to learn about.

73
00:04:41,910 --> 00:04:46,890
They'll build side projects and act together things late at night which is always a great sign when

74
00:04:46,890 --> 00:04:49,550
there's a lot of excitement and buzz about our technology.

75
00:04:49,590 --> 00:04:53,370
But again I don't think that's a great motivation for you a beginner to learn.

76
00:04:53,370 --> 00:05:00,260
Note what this chart shows is just the rank of the ten most popular languages on get hub.

77
00:05:00,270 --> 00:05:07,050
Over the last seven years and you can see that in 2012 javascript overtook Ruby as the most popular

78
00:05:07,050 --> 00:05:08,920
language on all of get help.

79
00:05:09,390 --> 00:05:12,740
The last two pages I want to highlight I think are the most important here.

80
00:05:12,800 --> 00:05:17,990
They're from that web site stack share that I demonstrated earlier the last two pages I want to show

81
00:05:18,120 --> 00:05:22,540
are from that website Stex share that I introduced in the intro to back in video.

82
00:05:22,680 --> 00:05:30,030
And I have a search open for DHP which will pull into its own window and I have one for no yes as well

83
00:05:30,360 --> 00:05:33,240
and I want to just take a look at these key terms.

84
00:05:33,240 --> 00:05:38,640
Why people like HP and why people like No J us and there are good reasons on both sides.

85
00:05:38,850 --> 00:05:42,940
I don't want you to get the impression that I'm trashing peech or anything but I just do want to show

86
00:05:42,940 --> 00:05:48,960
a contrast in some of the reasons people like them so APHC some of the more popular reasons are large

87
00:05:48,960 --> 00:05:51,620
community which is definitely an important aspect.

88
00:05:51,630 --> 00:05:54,880
We also have that over here great community for Node 2.

89
00:05:54,900 --> 00:06:01,350
I want to highlight though our good old Web and Web Foundation as well as the best glue on the web.

90
00:06:01,350 --> 00:06:06,180
These are different ways of saying that ph V has been around for a long time and it's sort of the grandfather

91
00:06:06,180 --> 00:06:07,890
of web development if you will.

92
00:06:07,890 --> 00:06:12,510
Now let's take a closer look at some of the reasons people like Noad and some of the ones all highlight

93
00:06:12,960 --> 00:06:18,090
are great libraries which is really important and we're going to use some of those libraries.

94
00:06:18,450 --> 00:06:23,340
Javascript's that's the most voted or second most voted one and that's really really important.

95
00:06:23,460 --> 00:06:24,210
It's in javascript.

96
00:06:24,210 --> 00:06:25,770
People love javascript.

97
00:06:25,770 --> 00:06:27,900
We'll be able to write javascript on the server side.

98
00:06:27,900 --> 00:06:30,450
We don't have to learn another language.

99
00:06:30,480 --> 00:06:35,010
The other aspect is high performance and that's one of the reasons it's getting so much attention from

100
00:06:35,010 --> 00:06:37,320
companies and startups all over the world.

101
00:06:37,470 --> 00:06:41,980
What makes something higher performing or more performance is for another lecture entirely.

102
00:06:42,120 --> 00:06:46,860
But the fact that so many people have mentioned they like it for being high performance is a great indicator

103
00:06:47,100 --> 00:06:49,020
of the fact that it's high performance.

104
00:06:49,020 --> 00:06:53,910
So I spent the last few minutes trying to prove to you that note is popular it's trendy there's new

105
00:06:53,910 --> 00:06:56,780
jobs in it and it's only getting more and more popular.

106
00:06:56,970 --> 00:07:01,810
But I did start out by saying that that's not a reason really why we should be learning it.

107
00:07:02,070 --> 00:07:07,890
It's the smallest reason but the most important reason that we're learning it is that it's in javascript

108
00:07:08,640 --> 00:07:11,060
and that's important because we already know javascript.

109
00:07:11,130 --> 00:07:14,310
So we don't have to start from square one pick up another language.

110
00:07:14,430 --> 00:07:21,780
Learn how variables work in THP or in Ruby or in Python and how loops work and how arrays work and objects

111
00:07:21,790 --> 00:07:26,290
and oh wait some of these languages don't have objects and things just change so much.

112
00:07:26,550 --> 00:07:29,260
It can be very confusing for someone who's just starting out.

113
00:07:29,260 --> 00:07:30,520
Do you have to switch gears.

114
00:07:30,640 --> 00:07:35,490
One hundred percent and abandon javascript for you know the next half of the course until we bring it

115
00:07:35,490 --> 00:07:39,270
back at the end rather than doing that by using node.

116
00:07:39,360 --> 00:07:44,130
We're able to write javascript on the server side with the same exact syntax that we know and love.

117
00:07:44,190 --> 00:07:48,070
And I've been working with for the last half of this course.

118
00:07:48,270 --> 00:07:53,970
One of the phrases I would repeat to my students all the time is that you guys are not here to learn

119
00:07:53,970 --> 00:07:56,070
technologies you're not here to learn languages.

120
00:07:56,310 --> 00:08:02,370
You're here to learn web development and web development changes so fast you might go from a job where

121
00:08:02,370 --> 00:08:07,920
you're writing Ruby and using rails and then a year later you go somewhere else and you're asked to

122
00:08:07,920 --> 00:08:10,570
learn node and you're writing express or sales.

123
00:08:10,580 --> 00:08:11,030
Yes.

124
00:08:11,100 --> 00:08:16,590
And then a year later you're picking a python and flask and things can change all the time.

125
00:08:16,590 --> 00:08:20,020
So to summarize I'd say that it does matter in the short term.

126
00:08:20,160 --> 00:08:24,120
It is something that I mean I thought about this for a very long time.

127
00:08:24,180 --> 00:08:30,120
You know I'm fortunate I've taught things in C and in Java in Noad and Javascript in Ruby and Rails

128
00:08:30,120 --> 00:08:31,110
and Python.

129
00:08:31,260 --> 00:08:34,090
So it wasn't a matter of what I was comfortable teaching.

130
00:08:34,170 --> 00:08:38,060
I was able to pick what I felt would be best delivered through this video course.

131
00:08:38,100 --> 00:08:43,410
What would be the best first server side language for someone who has never done any server side programming

132
00:08:43,680 --> 00:08:46,610
and who is just starting out by using a video course.

133
00:08:46,710 --> 00:08:48,280
And I ended up setting a node.

134
00:08:48,330 --> 00:08:53,350
So it does matter in the short term but if you do continue with this it really doesn't matter.

135
00:08:53,370 --> 00:08:54,680
So I'll append this.

136
00:08:54,700 --> 00:08:56,330
It doesn't matter.

137
00:08:56,460 --> 00:09:01,350
Long term and that's true it really doesn't.

138
00:09:01,350 --> 00:09:03,200
This is just your first introduction.

139
00:09:03,360 --> 00:09:04,530
So it seemed significant.

140
00:09:04,530 --> 00:09:09,780
And it was certainly an important and significant choice for me to make and I thought a lot about it

141
00:09:10,080 --> 00:09:15,480
but for you once you learn node once you learn server side programming it won't be difficult to transition

142
00:09:15,480 --> 00:09:17,870
to something like Ruby or to Python.

143
00:09:18,210 --> 00:09:22,950
Hopefully this video got you at least a little bit excited about learning node and about making web

144
00:09:22,950 --> 00:09:23,480
apps.

145
00:09:23,670 --> 00:09:28,100
Because in the next video we're going to see our first taste of writing code using node
