This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

First of all, is talent more important than interest and hard work?

The recommended methods for most people to improve their programming skills are very basic things. Read code, understand code, write code, participate in projects, discuss code, etc… Of course, these practices do help programmers improve, but the actual effect is obviously very small.

Here are some tips and things I’d like to say to new programmers that I hope will help you.

Don’t be a coder

IT is an engineering field, not a science field, and the industry most similar to IT is building. And the code farmer’s work is no different from moving bricks, is the east to move the wheel west piece together, where the water leakage repair where, will lay a floor tile and a cement, can put up the house. The difference with an engineer is that a brick remover can’t produce architectural drawings, but an engineer can. A coder can’t figure out a project, but a programmer can.

Learn computer fundamentals well

Each of us programmers probably have a dream, that is to become a champion, we may be immersed in various frameworks, think that the framework is everything, think that the application layer is the most important, you are wrong. In today’s computer industry, the ability to apply is the basic quality, if you understand its principle can let you go further in the industry, and the basic knowledge of computer is the most important.

Computer basic knowledge for programmers is very important, important degree is high, want to become a senior programmer, must have a good computer foundation.

Before I wrote an article about the basic knowledge of computer, there are also a lot of good resources to share with you, there is a need to go to see: computer basic knowledge for programmers how important?

Don’t blindly copy code

Avoid duplicate code at all costs. If a commonly used snippet appears in several different places in the program, refactor it and put it in a function of your own. Repetitive code can cause confusion when your colleagues read your code.

Repetitive code that changes in one place and forgets to change in another is buggy and bloated. Modern programming languages provide a good way to solve these problems.

Learn to test your code

You know what your code does, and you try it out, and it works, but you actually need to fully validate it. Analyze all possible boundary cases and test that it works as expected under all possible conditions.

If there are parameters, pass some values outside the expected range. Pass a null value. If possible, show your code to a colleague and ask them if they can break it. Unit testing is a common way to do this.

Before submitting your code, sit down with a colleague and explain what changes you made. Often, you’ll be able to spot bugs in your code without a colleague having to say a word.

This is much more effective than reviewing your own code.

Make your code cleaner

If you find yourself writing a lot of code to solve a simple problem, you’re probably doing it wrong. The following use of Boolean is a good example:

if (numMines > 0){
   enabled=true;
}else{
   enabled=false;
}
Copy the code

You should write it like this: enabled = numMines > 0;

The less code, the better. This leads to fewer bugs, less refactoring, and less chance of errors. Moderation. Readability is equally important, and you don’t want to make your code unreadable by doing so.

Don’t use pure numbers

Embedding numbers directly into code is a bad habit because it’s impossible to say what they represent. It’s even worse when there’s duplication — the same number appears in multiple places in the code.

If you change one and forget the others. This leads to bugs. Be sure to use a named constant to represent the number you are expressing, even if it only appears once in the code.

Avoid premature optimization

When you try to optimize a feature code that already works, chances are you’ll break it. Tuning can only occur when a performance analysis report indicates that tuning is needed, usually at the end of a project’s development.

Tuning activities prior to performance analysis is a waste of time and can lead to bugs.

Think and assume more

As engineers, we enjoy high productivity: we like to build, build, build.

But if we don’t take the long view, we’re just getting bogged down and making it harder and harder to build anything.

Sometimes we write code before we understand the problem and end up giving up.

Sometimes our solutions, while very effective for a local problem, can make it worse or cause more serious consequences.

Sometimes we don’t finish the design in such a hurry that people have to spend more time fixing it later.

Sometimes we just can’t be bothered to write in the right way and simply copy or borrow someone else’s content, perhaps because we’re too busy with a project to take the time to think it through.

Learn fast search techniques and methods

Being a good programmer is not just a matter of skill, it’s also a matter of how well you find information, and this trend is becoming more and more obvious.

You should learn how to approach specific searches and know what you actually want to look up, and information filtering can be improved by building mental knowledge maps.

Finally, the more you search, the more experience you have, the higher quality sites and the more general documentation location, the easier it is to solve your questions, including which search engine to use.

In your first year of learning to program, every problem you encounter is one that 100 other people have already encountered. The solution has been documented online. The sooner you learn to effectively use Google for help, the happier you’ll be. Tip: Never copy code directly from the web if you don’t understand how it works.

Read good code

Take a look at the code written by senior programmers at work and ask them why they did the project a particular way. You can also learn from their good programming habits and reflect on them.

But it is worth noting that do not copy other people’s things; You have to be able to figure out what works and what makes sense, and then imitate them and try to find your own language.

Too many programmers are smarter than us. They write a lot of code that you can read if you need to. The code is most likely on Github.

Be curious and keep learning

If you’re not curious, don’t want to learn new things, don’t care about new technologies, new languages, then why are you in this business?

There is an unwritten agreement in the Internet industry that lifelong learning is a constant source of motivation for developers to keep learning, with new frameworks, new languages, and new frontiers.

Attitude is key

If you don’t like your job and are currently working at an entry-level level, how can you move to an intermediate level or improve your situation by changing jobs or careers?

On the other hand, if you love what you do, great! Less impetuous, sink down to experience the real essence of technology, do it steadily, will eventually have a good home. If you keep at it, I guarantee you’ll become a better programmer.

I suggest writing a blog

Keep a record of what you learn or summarize every day, even if it’s just a very basic, unusual, and alternative technical point. Accumulated over a long period of time, this is their growth footprint. I believe that five or ten years from now, when I look back at my article, I think it will be different

conclusion

In fact, there are so many ways to acquire knowledge that we don’t know what to learn. I think we should learn to calm down and think about what kind of knowledge can really help and improve ourselves, and what is a waste of time and does not help our work. Energy is limited, use it wisely.

After work, don’t forget to exercise more to keep healthy, communicate more to keep your mind active, share more to keep your mind clear. Of course, if you can take programming as your hobby and enjoy it for a long time, I think you are not far from the big bull.

Everyone has their own way of growth, the above suggestions for reference only, I wish you can find a belongs to their own bright way as soon as possible!

Welcome to leave a comment, you think what good advice can also share to digg friends, we work together, progress ~