A
A
Artemy2018-02-06 01:15:29
Algorithms
Artemy, 2018-02-06 01:15:29

Is it useful to reinvent the wheel when learning?

Let's say that I don't know languages ​​and have never written code. Which of the following options do you think is better?
1. I look at what algorithms are. I analyze examples of algorithms. Only after that I try to repeat them.
2. I look at what algorithms are. I'm trying to understand how they should work (through the description of the algorithm, visualization (for example, as with sorting algorithms on YouTube), and so on). I'm trying to write the code myself, which fits the description. Only after that I compare the performance of my bike with a well-known bike.
It is clear to me that the first option is faster and the second one is slower, but in which case would the best experience be obtained?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Stalker_RED, 2018-02-06
@Artemonim

Yes, when learning it is useful to do something on your own. If you can create an algorithm yourself, it's better than giving up without finding a suitable ready-made one. But at the same time, it is worth remembering that many algorithms honed by cool professionals can speed up your homemade product at times, tens of times, and sometimes by many orders of magnitude.
So if you suddenly realized that you can apply that algorithm from the book to this problem - apply it.
As an illustration, I will give a comparison of nine sorting algorithms:
https://youtu.be/ZZuD6iUe3Pc
And two pathfinding algorithms
https://www.youtube.com/watch?v=g024lzsknDo

I
InoMono, 2018-02-06
@InoMono

It is useful as it develops thinking.
But it is harmful because a modern specialist should have a broad outlook on the search and use of other people's solutions. Many people prefer not to bother in the intrigue of things already debugged by other people, not to strain, but to make guano on their knees and use it.
In general - bikes are useful for learning.
But not more.

V
Vasily Vasilyev, 2018-02-07
@Basil_Dev

By "parodying" someone else's code, you completely kill your ingenuity, which makes the brain think in a stereotyped way. And this is not good.

D
dmitriyprog, 2018-02-06
@dmitriyprog

Yes and no. After all, I'm sure you don't try to build a computer yourself before writing a program.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question