📜 ⬆️ ⬇️

Do not copy-paste someone else's code, dial it yourself


If there is something unchanged from the day when I started writing code to the present day (and I have been writing about 500 days). So this is the fact that ignorance of where to start is incredibly scary. I acutely remember the panic of learning HTML, when I had no idea how to get my divs to be where I wanted to. I understood the concept of the grid, but the implementation was in no way given to me for several days.

Relief, in the end, came after the greatest insight of my coder life: My God, so the working code is everywhere! On the Internet, it is everywhere. Just find, copy, see how it works - and you're in chocolate. I began to use Google, “view the source code of the page” and “explore the element”, at night studying the structure and logic of the working code of others. And for a certain time it was enough. I needed to study so elementary things that it was enough to see how other people encoded, and then slightly change this code to fit my needs — that's all I needed. However, when my skills improved, I found that I lacked the ability to write code from scratch as elegantly as I would have liked. And I began to do differently: instead of copying someone else's code, I began to type it completely myself .

When Hunter S. Thompson worked on errands in The Time magazine in 1959, he spent his free time reprinting the Great Gatsby by F. Scott Fitzgerald and Bye Bye, Weapon! By Ernest Hemingway in order to better feel - like this, write a great book. In order to understand all the twists and turns in the author's logic and plot, one reading is not enough, you had to feel what it was like to actually create a thing. I found that programming is the same.

When I do something from using someone else's jQuery plugin to creating a static Python page using some framework (such as Cactus , for example), if it is only possible, I put someone else's code on one screen, my IDE on another and re-type all the code myself. It's amazing how deeply I can understand the logic and any unfamiliar syntax, by the time I finish writing. My mind tells me: “well, here is the separation of lines, here they have parsing, STOP! I didn’t know what can be done in JavaScript! ”
')
And it works! This is amazing. I suggest you try.

No one has learned how to become a great writer, just by reading a book , you have to feel it.

translator's note:
I myself do not have enough excerpts to retype someone else's code, but I think I should try it. For training. Interestingly, does anyone practice this?

Source: https://habr.com/ru/post/162687/


All Articles