How to think like programmers novice white - experience solving problems

How do you interested in programming, you may have seen these words:

“Everyone in this country should learn to program a computer, because it teaches you to think.” — Steve Jobs

You may also want to know, like programmers think in the end mean? How can I do?

Essentially, this is a more efficient way of solving the problem.

In this article, my goal is to teach you this way.

Finally, you will know how best to solve the problem.

Why is this important?

We have encountered many problems every day, both large and small. The way we deal with these issues sometimes are random.

Unless you have a system, method, or with a "random manner" may be your "solve" the problem (Let me start learning programming to write code when doing things):

  • 1, try Solution

  • 2, if not, try again

  • 3. If there is no effect, repeat step you know good luck

Such an approach, in bad luck when you, silly. In short, when the worst way to solve the problem of this method! It is also very time-consuming.

The best way is:

  • a, there is a frame

  • b, practice it

Almost all employers regard the ability to solve the problem in the first place!

Problem-solving skills employers are looking for is already an aspect of programmers, test engineers, system designers, and other value most.

The ability to break up large computational thinking or complex issues, and basic technical ability needed for the work as valuable - by Hacker Rank (2018 Developer Skills Report)

A framework

To find the correct framework, I followed Tim Ferriss book about learning suggestions "the 4-Hour Chef" in, "The 4-Hour Chef"

It makes me interviewed two people who impressed me:

C. Jordan Ball (ranked 1st or 2nd out of 65,000+ users on Coderbyte, and V. Anton Spraul (author of the book “Think Like a Programmer: An Introduction to Creative Problem Solving”.

I asked them the same question, you guessed how? Their answer turned out to be very similar!

Next, you'll soon be able to recognize them ~

Of course, this fact does not mean that everything they are carried out in the same way, each person is different, you will be different, but if you start with good principles that we all agree, you also It will go farther and faster.

The biggest mistake I see new programmers make is to focus on learning grammar, rather than learning how to solve problems. by - V. Anton Spraul ( http://vantonspraul.com/ )

So, when you encounter a new problem, how should you do it?

Proceed as follows:

1, understanding

Very precise knew he was asked what the problem is. The reason why most difficult problem, because you do not understand them, so this is the first step.

How to know when you understand a problem? - When you use simple language to explain it in their own time.

You may remember, when you're stuck on a problem, once you start to explain it, you immediately see the logical loopholes, and loopholes it may also be that you have not previously seen.

Most programmers know the feeling of it!

That's why you should write down your questions, draw a map, or tell others.

"If you can not explain something in simple terms, you do not understand it." If you can not use simple language to explain something, you can not understand it - Richard Feynman

2, plan

Do not plan in the absence of circumstances, plunged headlong into the process of solving the problem (and I hope you can mix in the past), plan your Solution Now!

If you do not plan to write down the exact steps, did not not help you.

In programming, this means that do not immediately start hacking. Give your brain some time to analyze problems and process information.

In order to get a good plan, answer this question: given input X, Y returns to step needed to enter the world of what programmers inside, there is a great tool to help them achieve this, and that is a comment?!

3, Split

This is the most important step

Do not try to solve a big problem once, or you might cry.

Instead, when you put this question to split into sub-problems one by one, these sub-problem is easier to solve.

Then, one by one for each sub-problem solving, from the most simple to start. The simplest means, you know the answer (or closer to the answer).

The easiest way to another means to solve the problem of the child does not depend on solving other problems.

Once you solve each sub-problem, and then connect the dots

Connect all "sub-solution" for the solution of the original problem you offer! Then congratulations, you did it!

The technique it is the cornerstone of all problems, remember it (I suggest you re-read it again this step)

If I could give a beginner a skill to solve every problem, that is, "to reduce the problem of skills", for example: Suppose you are a new programmer, you are asked to write a program that reads 10 numbers and then calculate which figure is the third highest for a new programmer, this can be a daunting task, even though it only needs basic programming syntax

If you mess up, you should simplify the problem. Instead of focusing on the third high figure. How to find the highest number yet in a whole? Or too hard? It found that the largest numbers from the three it? Or too hard? If that is the larger of the two to find it?

You will simplify the problem to know how to solve problems and to prepare degree solutions. Then expand a little problem, the solution to match again, and proceed back to where you know you are beginning. - V. Anton Spraul

4, stuck it?

Now, you may be sitting there thinking, these steps seem pretty good thing, but if I'm stuck, set the child can not solve the problem how to do?

First, take a deep breath. Because this is normal!

Do not worry, friends, everyone will like this!

The difference is that the best programmer / problem solvers, more curious bug / error, not angry!

In fact, when you encounter misfortune, there are three things you can try:

Debugging: Check your solution step by step, trying to figure out what went wrong. That debugger.

(Art debugging is to find out what you really tell your program what to do, not what you think you tell it what to do)

Reassess: step back from one-another point of view the question, what can be abstracted into a more general way?

(Sometimes we have problems too obsessed with the details, so that they ignore the general principles to resolve the problem on a more general level!)

The classic example, a long string of consecutive integers the sum of the seek, 1 + 2 + 3 + 4 + ... + n, with a simple elimination method can quickly identify such a formula: n (n + 1) / 2, thus avoiding having to do extra points.

(Another way is to start re-evaluated again. Delete all of the contents, start again with new eyes. You will be surprised that this is how effective.)

Search / Research: You're not wrong, is to use Google, whether you have any questions, some people may have been resolved. Find that person / solutions. In fact, even if you solve the problem, but also do so! (You can from high school program to solve a lot of others)

(Note: Do not look for ways to solve the big problems only to find solutions to sub-problems, why because unless you work hard, (even a little bit), otherwise you will not learn anything, if you have learned nothing.? then you are wasting your time)

5. Practice

Do not expect just one week can become very powerful, if you want to be a good problem solver, you should go to solve many problems!

Practice, practice, practice! Sooner or later you will realize that this problem can be solved by a very easy way.

So how do you practice it? In fact, there are many choices!

For example: the national chess games, math problems, Sudoku, video games, cryptokittiles, bla bla bla ...

In fact, a universal model of success know that they practice "crowd solve the problem," the habit. For example: Peter Thiel (Peter Thiel) playing chess, elon Musk (Elon Musk) playing video games ....

Byron Reeves (Byron Beeves), if you want to know after three to five years of business leadership would be like, so long to see what is happening right online game

Fast forward to today, elon Musk, Reid Hoffman, Mark Zuckerberg and many others have said, the game is they say cornerstone of the company. --Mary Meeker (Internet Trend Report 2017)

This means you should only play video games? Not all yes.

But in the end this has anything to do with video games? Yes, that is the problem solved!

So you should do is find an outlet for exercise, so that you can solve a lot of small problems. (Ideally, you like or something, so much the better)

For example, I like programming challenges every day, I have tried to solve at least one challenge (usually Coderbyte) https://coderbyte.com/

As I said, all the problems have similar patterns!

6 Conclusion

Now, you know "like programmers thinking" what it means.

You also know that problem-solving skills is an incredible yuan.

If that's not enough, you must also know how to practice problem-solving skills.

You see, this is not looks cool!

Finally, I wish you many problems haha.

You're not wrong, at least you now know how to solve, at the same time, you will understand that each solution will enable you to get improved!

"Just when you think you've successfully navigated one obstacle, another emerges. But that's what keeps life interesting. Just when you think the success of cross-domain has been an obstacle when there is another obstacle appeared, but that's what makes life change It was interesting.

Life is a process of breaking through these impediments - a series of fortified lines that we must break through these barriers process of life is a breakthrough - we have to break through a series of defense.

Each time, you'll learn something. Every time, you will learn some things.

Each time, you'll develop strength, wisdom, and perspective. Each time, you will develop your tension, wisdom, and insight

Each time, a little more of the competition falls away Until all that is left is you: the best version of you "- Ryan Holiday every time, more competition will disappear until you become your own best .-... - Ryan Holliday (obstacle is the path)

Now, to solve some issues now!

Recommended reading:

Learn Python programmer, programming capabilities are "degenerate" into what?

What is the front-end development line learning? Internet trends, skill requirements

Select the programmer, which means lifelong learning, in front of a cozy, but confuse people hotbed

Programmer's skill tree, determines the height of a lifetime career

Guess you like

Origin blog.csdn.net/momingzhe23/article/details/91357921