📜 ⬆️ ⬇️

How I started programming better

The author of the article is James Long , one of the creators of the Firefox Developer Tools

Several people at React Conf asked me for advice on how to program better. For some reason, people see me as an advanced programmer, whose advice is worth listening to. I thought it was worth writing down the “mental model” of how I approached programming over the years.

Some information: I am 32 years old and 10 years of solid experience. Probably only in the last couple of years I have gained confidence in what I am doing. But even now I continue to doubt myself. The fact is that this feeling never goes away, so try not to pay attention to him, go on with hacks and gain experience.
')
I must say that here are just a few tips for improving your abilities. In the end, you need to find out for yourself what is best for you. These are just the things that I thought were useful.


Over the years there have been a lot of people I have looked at with respect and followed new technologies. I learned a lot just trusting their opinions and studying the things they are working on. As a rule, these people were very fruitful, bright and inspiring. Look for them and let them inspire and teach you.

However, do not idolize them. It’s easy to look scary from a Twitter tape, but if you look at how they work in real life, you will see that they are not so outstanding. Everywhere hacks, etc. We all just experiment. Finally, do not blindly trust them; If you do not agree, attract attention and get experience from communication. Some of my most fruitful conversations occurred this way.

My emacs config is in the mess. I don’t know why my OCaml autocompletion is broken (for more than a month now). I do not automate things and sometimes have to dig into the history of the shell to find the right commands. First, I write the ugliest code. I put everything on the global object until I realized what I was doing. Even the most experienced programmer constantly uses hacks; the most important thing is to bring things to the end.


Beginners often think that their work doesn’t matter, because they are new. Or maybe you are an experienced programmer, but you work in a new area where you don’t feel comfortable. In my opinion, some of the best ideas are offered by beginners. They see an opportunity to improve existing things to which experienced people have already become accustomed with the opinion that has formed.

Your work always has value, no matter what. In the worst case, even if your idea doesn't work, the community will get a better understanding of why this particular approach has no meaning. (Note to the community: for our part, you should take this into account and be friendly to newbies).


When new technologies come out every day, it seems that you will lag behind the world if you miss the evening without work. This is not true. In fact, you will work better if you disconnect for a long time. The look will be fresh, but new ideas come to me unconsciously when I am not working.

Most of the daily innovations are just old ideas in new packaging. Truly revolutionary things appear every few years. A good lecture on this topic is Hammock Driven Development .


One of the best ways to objectively accelerate your development is to simply ignore the “tinsel” that really does not improve your abilities very much. In other words, correctly allocate your time. There are a certain number of hours in a day, and if you spend them on deeper things, you will notice a big difference over time.

So what is “tinsel”? It depends on you, but I can give you some examples of what I consider tinsel: the syntax of languages, the library API, the configuration of the build tools. Learning the new syntax for building ES7 JS will not make you a better programmer compared to learning how compilers work, for example. Using a new library that implements the same idea, but with a new API, is not that interesting. All this is important, of course, but I recommend devoting more time to learning deeper concepts that will have an effect for years to come.

I like to ask this question: do you spend most of your time to make the code “beautiful”? If so, I recommend not paying so much attention to it. Your code will still change a lot over time. It is better to clearly focus on the root problems that you face, and think carefully about the levels of abstraction. When you deal with all this, you can spend a little time polishing the code. (This also applies to the DRY principle. Don't worry too much about it. Feel free to repeat information at the levels of abstraction.)


If you are worried about an idea, then you can't wait to sit down and start immediately. You can not do this without at least a cursory study of how others solved this problem before. After several days of studying the problem, I always completely changed the intended way of solving it.

Very valuable quality - learn to read scientific articles. I don’t know anything about de-sanitization / operational and other semantics, so I cannot read many articles. But many use code instead of math, and it's not very difficult to read them. Just a huge amount of knowledge accumulated in the articles over the past 30 years. If you learn to extract it well, you will become a true opinion leader almost instantly.

Prettier is a great example. I knew exactly what I wanted to get, but I did n’t understand how. After a brief search, I found this article and after a few days I knew exactly what to do. A week later, there was a basic working prototype. If I had ignored previous studies, everything would have taken much longer.

If you need scientific articles, the GitHub Papers We Love repository is a good place to start.


There is nothing better than experience. Not everyone has the opportunity to experiment, but if you have time, then try and take on big projects. Do not even need to finish them. Just trying to overcome something like writing a compiler will give you a lot of new knowledge in the first few weeks.

Honestly, I hate the feeling when you have no idea how to solve a difficult problem. This is an unpleasant feeling. You understand that you have to learn a lot of material and understand a lot in order to get a little closer to the solution. But I always end up becoming a much better programmer.

Start by learning a new language. This is the most effective way to get yourself out of your current habits and look at things in a new light. For me, the best thing I did in my youth was learning Scheme . This extremely simple language makes you write everything in a functional way and really learn the basics of how the code works. The few years I spent on Scheme still benefit me; my view of code has changed fundamentally. (I even called my company Shift Reset LLC by the name of the shift / reset operators in Scheme).

Here is a list of a few things I would recommend. They all had a huge impact on my programming career. Most of them still continue to benefit indirectly and help me mentally dismantle new ideas. You do not need to do this to become a good programmer , there are many other ways to do this, but it helped me personally.

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


All Articles