All right, so let's do a quick overview on what we just learned, so we want to keep our logic simple.
That's the whole idea.
And what we want to take with us is that we always want to look out for simpler implementations.
So if we have finished our logic, our initial logic, that makes the future work, that's perfect.
But always try to go back to your code and try to simplify it and make it more readable, more easier
to understand.
So if you have a similar approach in mind to what you initially have wrote, well, you should take
the time to refactor that and make your code much simpler in terms of logic.
And this is a good example for why we have had with the calculation of the distance, we have wrote
our own logic to basically calculate the distance between two points, which is fine.
But having such extensive implementations are always going to be risky for production applications.
If those implementations are not really dedicated and we just do some code from stack overflow.
But apparently we can stop reinventing the wheel, at least for this feature of calculating the distance,
and you can always be on the lookout for something that was already there.
So in our case location, that distance was something built in and that functionality was already there,
provided by and right and is stable.
We know it's fine and we know we can use it in production apps.
We don't have to worry about bugs.
And so so in this case, we shouldn't have reinvented the wheel.
And instead we have revised our code and we have replaced our logic with something that was out of the
box, something that was already working.
So with this in mind, also try to understand that if your implementation or try to remember that if
your implementation doesn't add anything new, well, if there is something that's already doing that,
why should you start doing it from scratch is not going to help you, because it's going to actually
take a lot of time and you can save time by using existing implementations.
So this is the main take over from this main takeaway of this video is very important to have these
kind of points in your head.
But also, I need you to be very careful with this approach, because if you always want to go on the
easy route, well, you might be losing.
For example, if you want to learn something new, I don't advise you to always go on this route.
I advise you to start writing it from scratch and do that logic on your own.
But some of the time in companies and working for companies, you don't have this kind of luxury.
So if it's in your free time or the company actually allows you to write that from scratch and do some
dedicated logic, do it.
Don't hesitate.
Most of the time you don't have this kind of luxury.
So this is a takeaway from this video.
Let's move on to the next video where we are going to do something even cooler.