1
00:00:02,180 --> 00:00:07,250
So we saw three different styles and of course, you can also mix these styles,

2
00:00:07,250 --> 00:00:13,050
you could have a procedural style where you also work with classes and where you have multiple functions.

3
00:00:13,190 --> 00:00:18,240
You can have a functional style where you somehow also sneak in some classes, though

4
00:00:18,410 --> 00:00:22,040
then technically it wouldn't be a pure functional style anymore.

5
00:00:22,040 --> 00:00:23,630
Which style is the best though?

6
00:00:24,020 --> 00:00:27,410
Well the best style is the style which best works for you,

7
00:00:27,410 --> 00:00:29,190
that really is the truth. Now,

8
00:00:29,330 --> 00:00:35,000
there will be people who strongly disagree because like a couple of other things in programming, this

9
00:00:35,000 --> 00:00:38,260
really is something where you can have religious debates.

10
00:00:38,360 --> 00:00:44,740
You can really discuss this and for a lot of people, it seems to be the most important thing in life,

11
00:00:44,750 --> 00:00:45,890
not to me though.

12
00:00:46,220 --> 00:00:52,730
You can write code, you can write apps with either style and you should find the style that best suits

13
00:00:52,730 --> 00:00:53,850
your needs.

14
00:00:53,870 --> 00:00:59,480
Now the more experienced you get as a developer, the more you will see that for a certain application

15
00:00:59,510 --> 00:01:04,100
types, some styles tend to work better than other styles

16
00:01:04,100 --> 00:01:07,250
and again you can find discussions about this on the Internet,

17
00:01:07,250 --> 00:01:14,900
some of them are even kind of friendly, which will show different applications and different examples

18
00:01:14,900 --> 00:01:22,670
for when to use which style. You'll also sometimes have programming languages which strongly favor one

19
00:01:22,670 --> 00:01:23,780
style over another,

20
00:01:23,780 --> 00:01:30,320
for example C# is a programming language which is heavily object oriented, Javascript on the other

21
00:01:30,320 --> 00:01:36,740
hand is pretty versatile, there you can follow any style and therefore sometimes you also are forced

22
00:01:36,740 --> 00:01:39,390
into a certain style and sometimes you are not.

23
00:01:39,440 --> 00:01:41,900
It's important to be aware of all these styles

24
00:01:41,930 --> 00:01:48,710
and nowadays at this point of time, the functional style is really having a strong comeback and is super

25
00:01:48,710 --> 00:01:51,460
popular and it does have great advantages.

26
00:01:51,740 --> 00:01:52,850
It's quite readable,

27
00:01:52,850 --> 00:01:55,500
your code is really nicely organized,

28
00:01:55,550 --> 00:01:57,400
it's very straightforward,

29
00:01:57,410 --> 00:01:59,790
functions tend to be relatively small

30
00:01:59,810 --> 00:02:08,540
if you're using this style correctly and it also produces highly reusable code. Object oriented programming

31
00:02:08,750 --> 00:02:10,070
was extremely popular

32
00:02:10,070 --> 00:02:14,120
a couple of years ago and it's still far from being not popular,

33
00:02:14,120 --> 00:02:14,980
don't get me wrong

34
00:02:15,620 --> 00:02:17,080
and it does have advantages.

35
00:02:17,090 --> 00:02:22,320
It's also producing reusable code and it splits your code into logical pieces.

36
00:02:22,340 --> 00:02:27,350
Now with the classes, you sometimes have a little bit of overhead which you don't really want though

37
00:02:27,650 --> 00:02:34,760
and sometimes it's easier to split it when following the functional style. The procedural style is not

38
00:02:34,760 --> 00:02:40,970
bad at all and great for some simpler scripts, the more complex your application gets, the more complex

39
00:02:40,970 --> 00:02:47,390
it might get to work with this style though because you will naturally end up with at least using some

40
00:02:47,390 --> 00:02:52,700
classes or some other functions to make it more readable at some point because if you only use this

41
00:02:52,700 --> 00:02:59,750
style and you write your code step-by-step your code can get harder to organize and to reason

42
00:02:59,750 --> 00:03:00,250
about

43
00:03:00,260 --> 00:03:06,530
but again here also, you can mix in more functions and so on and therefore also write great applications

44
00:03:06,530 --> 00:03:08,270
with the procedural style.

45
00:03:08,300 --> 00:03:14,210
I hope that this overview was helpful and that it helps you make decisions about which styles you want

46
00:03:14,360 --> 00:03:20,060
and most importantly, that it helps you understand styles being used in different projects or in different

47
00:03:20,060 --> 00:03:20,930
frameworks

48
00:03:20,960 --> 00:03:24,740
you work with in your future as a Javascript developer.
