1
00:00:00,720 --> 00:00:07,890
All right, so let's do a quick overview on what we just learned, so we want to keep our logic simple.

2
00:00:07,920 --> 00:00:09,000
That's the whole idea.

3
00:00:09,330 --> 00:00:15,650
And what we want to take with us is that we always want to look out for simpler implementations.

4
00:00:15,660 --> 00:00:21,990
So if we have finished our logic, our initial logic, that makes the future work, that's perfect.

5
00:00:22,380 --> 00:00:27,960
But always try to go back to your code and try to simplify it and make it more readable, more easier

6
00:00:27,960 --> 00:00:28,770
to understand.

7
00:00:29,280 --> 00:00:34,710
So if you have a similar approach in mind to what you initially have wrote, well, you should take

8
00:00:34,710 --> 00:00:38,860
the time to refactor that and make your code much simpler in terms of logic.

9
00:00:39,330 --> 00:00:46,570
And this is a good example for why we have had with the calculation of the distance, we have wrote

10
00:00:46,590 --> 00:00:51,120
our own logic to basically calculate the distance between two points, which is fine.

11
00:00:51,600 --> 00:00:58,410
But having such extensive implementations are always going to be risky for production applications.

12
00:00:58,410 --> 00:01:03,720
If those implementations are not really dedicated and we just do some code from stack overflow.

13
00:01:03,720 --> 00:01:10,200
But apparently we can stop reinventing the wheel, at least for this feature of calculating the distance,

14
00:01:10,410 --> 00:01:14,140
and you can always be on the lookout for something that was already there.

15
00:01:14,160 --> 00:01:20,490
So in our case location, that distance was something built in and that functionality was already there,

16
00:01:20,490 --> 00:01:22,700
provided by and right and is stable.

17
00:01:22,710 --> 00:01:25,350
We know it's fine and we know we can use it in production apps.

18
00:01:25,710 --> 00:01:26,910
We don't have to worry about bugs.

19
00:01:26,910 --> 00:01:30,840
And so so in this case, we shouldn't have reinvented the wheel.

20
00:01:31,080 --> 00:01:37,800
And instead we have revised our code and we have replaced our logic with something that was out of the

21
00:01:37,800 --> 00:01:40,720
box, something that was already working.

22
00:01:41,100 --> 00:01:48,690
So with this in mind, also try to understand that if your implementation or try to remember that if

23
00:01:48,690 --> 00:01:55,620
your implementation doesn't add anything new, well, if there is something that's already doing that,

24
00:01:55,920 --> 00:02:03,090
why should you start doing it from scratch is not going to help you, because it's going to actually

25
00:02:03,090 --> 00:02:07,710
take a lot of time and you can save time by using existing implementations.

26
00:02:08,240 --> 00:02:13,320
So this is the main take over from this main takeaway of this video is very important to have these

27
00:02:13,320 --> 00:02:15,030
kind of points in your head.

28
00:02:15,240 --> 00:02:21,690
But also, I need you to be very careful with this approach, because if you always want to go on the

29
00:02:21,690 --> 00:02:24,770
easy route, well, you might be losing.

30
00:02:25,110 --> 00:02:30,120
For example, if you want to learn something new, I don't advise you to always go on this route.

31
00:02:30,120 --> 00:02:34,020
I advise you to start writing it from scratch and do that logic on your own.

32
00:02:34,470 --> 00:02:39,600
But some of the time in companies and working for companies, you don't have this kind of luxury.

33
00:02:40,050 --> 00:02:45,510
So if it's in your free time or the company actually allows you to write that from scratch and do some

34
00:02:45,510 --> 00:02:47,490
dedicated logic, do it.

35
00:02:47,910 --> 00:02:48,780
Don't hesitate.

36
00:02:49,260 --> 00:02:52,570
Most of the time you don't have this kind of luxury.

37
00:02:52,920 --> 00:02:54,870
So this is a takeaway from this video.

38
00:02:54,900 --> 00:02:59,130
Let's move on to the next video where we are going to do something even cooler.

