Original: Liu Xin code farmers turn over

There are a lot of skills required to be a good coder. Here are a few that I think are more important based on my experience.

1. Develop a computer mindset.

The computer is a classic order, loop, branch idiot, dogmatic, following specific instructions.

But the complexity of the needs of the human world, and the fact that they are described in natural language, creates a huge gap from computers.

Obviously, this gap needs to be filled by helpless and painful code farmers.

The coder has to understand human needs, learn to think like a computer, understand the computer’s instructions, and then work hard to do a good job.

For example: the manager gives you a module requirements, you have to stand in the perspective of the computer, it with existing data structure or custom data structure, plus general less complex algorithms, with computer language to describe it, this is the basic skills, and specific language, and framework independent.

This habit of thinking can not be raised, do not code farming.

See my previous article, learn to Program, not Learn Java.

2. Ability to locate problems

In the early 20th century, a motor failure at Ford halted production, shutting down almost the entire plant.

The company sent a large number of maintenance workers for repeated maintenance, and invited many experts to look, but how can not find the problem where, let alone maintenance. The leader of Ford was so angry that it would be a huge economic loss for Ford to stop for even a minute, let alone a day.

At this time someone proposed to ask the famous physicist, electrical expert Steinmenz help, we listen to the rational, hurriedly sent someone to steinmenz invited.

Steinmenz examined the motor carefully, then drew a chalk line on the motor housing and said to the staff, “Open the motor and reduce the coil inside by 16 turns at the mark.” They complied, and amazingly, the trouble was eliminated! Production resumed immediately!

When the Ford manager asked Steinmenz how much he wanted, Steinmenz said, “Not much, only ten thousand dollars.” Ten thousand dollars? I just drew a simple line! Ford’s most famous pay slogan at the time was “$5 a month,” which was a high wage at the time.

One line, $10,000, the sum of an ordinary employee’s income over 100 years! Seeing the confusion, Staments turned and made a list: Draw a line, $1; Know where to draw the line. $9,999.

In the world of software development, it’s common to see a similar situation: there’s a Bug in the software, and people spend a lot of time working on it, day and night, only to discover that a file was opened and forgotten to close. It only takes one line of code to fix!

That’s why people who can quickly locate problems are great.

Code farmers have several ways to locate the problem, one is to view the error log, infer the error may, this is the most intuitive and the most direct.

However, in many cases, the real killer is not at the scene of the murder, which requires analysis. You can debug the code step by step to find the real killer, or you can output logs in the code to check the runtime behavior, but either method is time-consuming and laborious.

Even more tragically, many of the problems occurred in the production environment and were impossible to debug.

A good coder can create a mental model of how the software works, set inputs and outputs, put his head back and run a mental simulation, and quickly identify the problem. See article “Programmers without breakpoints are Good Programmers”

3. Ability to search

It is impossible for a person to master all the knowledge. When he meets something he doesn’t understand at work, he can’t learn systematically in many cases. Fortunately, we have the powerful tool of searching to use.

But some people try a lot of keywords can not find the ideal content. And some people are almost a hit, nothing but disadvantageous.

Underlying this is an understanding of the nature of the problem.

Learning how to choose the most appropriate keywords for your search is also an important skill for the coder. Practice it.

4. Skillful use of IDE

I’m not opposed to programming directly with a text editor like Notepad, but SUFFICE it to say that being proficient with an IDE can greatly improve the efficiency of programming. Among other things, the Eclipse IDE offers at least these features: smart hints: any syntax errors will show you immediately. Automatic completion: can save typing a lot of code formatting: instantly let the code look good a lot of code browsing: easy to open a class, view the class inheritance system, method call level reconstruction: dealing with dirty code absolute killer. There is absolutely no text editor.

So if you want to make programming fly, get an IDE out of the way.

5. Ability to refactor code

Elegant design and beautiful code can’t be designed and written all at once.

But in iteration after iteration, time after time of reconstruction slowly emerge.

So refactoring is very important. If you don’t have it, check out Martin Flower’s classic book refactoring: Improving the Design of Existing Code.

6. Ability to write tests

Testing here is primarily unit testing, and this part of the work is done by programmers, not testers.

Writing unit tests is about making sure that the business modules you write are working as expected.

In addition, these tests become a kind of “documentation” that describes the behavior of the software and is never out of date.

More importantly, these tests will act as responsible sentinels: when you change code in the future, running these tests will tell you if you did damage to the original logic, which is invaluable.

Proficient in SCM

SCM: source code management system, such as SVN, Git, and CVS.

Today’s software development is all about teamwork, even distributed collaboration, so an SCM system is almost a team necessity.

Daily work starts from SCM check out code, so mastering at least one SCM is the basic ability of the coder. If not, go to Github to open a free account to learn.

8. Ability to build software

To build software is to download code from the SCM, compile it, test it, package it, and deploy it to a test or production environment.

This process would be boring if it was manual.

The process should certainly be automated, and programmers should at least learn about tools like Ant and Maven and platforms like Jekins to help us build software.