7 golden rules of one programmer

    This article is about seven simple rules that I have formulated for myself over the years of working as a programmer. Seven rules that raised my effectiveness. Made me better. These are my rules and they work for me . I am not trying to impose them on you, I want to share with you, and perhaps find out about what rules and principles you follow.

    The computer is always right


    The most annoying situation in programming is when the code is correct but not working. “ Yes, there are three lines, damn it, there’s simply nowhere to make a mistake! Probably a bug! I’ll go spend three days studying the bug reports of the compiler / interpreter / framework ... ” There is a feeling that the computer is mocking you!

    The main thing to remember here is that there is a mistake in these three lines. If the code does not work correctly, then the code is written incorrectly . Point. Only you are to blame. Universal tip - go to sleep! Well, or at least get distracted by a cup of tea. When, after some time, you return to the code, it will probably become clear that there is an extra negation operator, or two variables with similar names are mixed up, or some other little thing that we never admit to anyone.

    Calm down and everything will work out


    Emotions are our worst enemy. Personally, as you may have guessed by the number of exclamation points, I am an emotional person. And sometimes it can be difficult for me to concentrate on the code, especially if this code was not written by me, and the code is not of the best quality. The brain somehow switches itself to the development of particularly sophisticated torture methods for the author of the code.
    You need to force yourself to calm down. You need to accept the task not as a mockery of your brain, but as a challenge. Yes, bad code, no documentation, yes difficult, but I'm a programmer, this is part of my work and I can handle it .

    The hardest thing is to get started.


    It happens that you look at a task and don’t know how to approach it. Which side to start? And in general, something is laziness today. “I'll sit for 10 minutes in VKontakte, then I'll start. Well, after coffee. Well, the old code needs to be refactored, and then I'll start. And what about low priority tasks? I will fulfill it and will definitely start ... " .
    Just get started . Start from either end. Break the task into small pieces and start doing them. Stop procrastinating, discard extraneous thoughts, concentrate on the task, and begin work. Then it goes like clockwork.

    Read books


    Read books. I will write again: Read books!
    For some reason, many programmers completely ignore books. “ I get an excellent education at work ”, “ I don’t have time ”, “ I read articles on the Internet ”. It's all great, but I personally think the best source of knowledge is still books. I consistently buy one or two books a month, plus I re-read something old from time to time. I won’t lie, an impressive pile of what I bought, but haven’t read yet (as with games in Steam) has accumulated on my shelf , but I’ll get there, I will definitely get there.

    Know your tools


    Take the time to take a detailed look at the tools and technologies that you work with. It will pay off many times. Thoroughly study all the features of the language in which you are programming. Just grab and read the official documentation from cover to cover. Do not use the IDE only as a code editor, in any modern environment there are a bunch of tools to improve the quality of the code and your productivity. Do not use the framework only as an architecture skeleton. Study it and it will save you a lot of time. Understand the intricacies of a version control system. The better you know your tools, the more work they do for you .

    Don't be a perfectionist


    I wrote above that the most difficult thing is to start. So, finishing is not always easy either. You can debug and refactor code endlessly. “ What a long method? "," Maybe it's in a separate class? ”,“ It would be more convenient if ... ”,“ What if later it will be needed ... ”,“ What if ... ”. In programming, you cannot be a perfectionist. The problem is that it’s enough to read Robert Martin or the Gang of Four, as soon as you want to rewrite all your code. You need to understand that there is no perfect code. I adhere to the rule: “ The code should work without bugs, be testable and readable" All. As long as the method code meets this requirement, I do not touch it. Even if it has two loops, three conditional statements and four parameters.

    Know how to relax


    The biggest problem with programmers is that we love our work. My break-up begins on vacation, a week without programming - and I have a dream about how I think through the architecture of a new application. Plus, the programmer is not difficult to find orders on the side, which can be done at night. Plus your projects. And how many times could you not fall asleep because your brain refused to switch from a task that you had been doing all day?
    All this leads to overwork, and, as a rule, to a decrease in productivity. Rested Programmer - Effective Programmer. Get enough sleep. Find a hobby that has nothing to do with brain activity and devote a couple of hours a day to it. This will distract the brain from work, restart it. The most interesting ideas and the most correct decisions have recently come to my mind in the gym.

    Also popular now: