[拇指飞动]Programner's Mind

# Programer's mind

-------------------------------------------------------------------------

-------------------------------------------------------------------------

## Break it down

- All problems, no matter how small or large, or how simple or complex, can be broken apart into small problems.

- Common student mistake: Trying to solve everything at once

## Learn the basics well, lookup the rest

- The knowleadge you need to solve a problem can be obtained by mastering the basics and looking up the rest

- Common student mistake: not learning the basics;

- Common student mistake: not knowng how to look up the rest

## Find and use examples

- Why reinvent the wheel?Find an example and learn from it, perhaps even improving it.

- Common Student mistake: not learning from the example

## Test, Test, Test(and test some more)

- Testing is one of the most important aspects to programming. Pay attention to testing. No amout of testing is enough.

- Common student mistake: not testing early and often

- Common student mistake: not thinking about how to test it, and randomly guessing

## Following directions

- Make sure you understand what it is you should be doing.

- Common student mistake: oversimplifying.

- Common student mistake: overcomplexifying.

## Solve the problem in English first

- Relieve yourself of the syntax issues, and come up with the solution path first.Focus on the problem/solution first.

- Common student mistake: getting lost in code and not forgetting what you are really trying to build and why.

- Common student mistake: Going too far with the English solution, and finding that it won't work once you jump into the code. After all, you don't know too much about code yet; it's easy to accidentally say something that you can't do in code(or once in code you see an easier way), but you don't know that yet because you haven't coded enough.

## Represent what?

- Software is built on data and processes. Thinking abou the data can simplify the solution for the process.

- Common student mistake: not spending enough time think aobut the data you need and the best way to represent it.

- Common student mistake: not adapting the data representation to make the process side easier.

## What does it do?

- Understanding the problem is different than understanding what the solution "does". You have to uderstand what the program will "do" if you want to be able to write it.

- Common student mistake:oversimplifying what the program should "do". Often, you forget about special cases or what it "shouldn't" do.

## Make sure you understand the problem

- If you don't understand the problem, the how can you propose or understand a solution to that problem.

- Common student mistake: not asking questions.

- Common student mistake: not identifying(early)what you don't understand.

## If you can't solve the bigger problem, solve a small one.

- If a problem is too complex, then don't solve it.Solve a smpler problem first and then return to the more complex problem.

- Common student mistake: returning to the biggest problrm first.Test, test,test,then slowly grow the amout of complexity you are dealing with.

## Have a plan B

- There is always more than one way to skin the cat. ALWAYS think abou alternative paths to solving the problem, and if you get stuck on the current path, try that path.

- Common student mistake: thinking that early commitment is bad.It isn't.

- Common student mistke: abandoning a path for another, but never being willing to revisit that old path again.

# Reference

[Think like a programmer] (http://wenku.baidu.com/view/ebe5fe8d6529647d272852f0.html)

原文地址:https://www.cnblogs.com/piaoger/p/2666414.html