How do I code well?

Posted 喵喵7781

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了How do I code well?相关的知识,希望对你有一定的参考价值。

今天在google里面搜索 code well, 在Quora上面发现了这样的回答,很有用处,特此存了下来。ps:Quora是类似知乎的分享知识平台。

原文地址:https://www.quora.com/How-do-I-code-well

内容如下:

Never too late. Learning to code good is a never ending process. It's like asking when you are playing violin good enough. The only answer is every day you can become a bit better.

There hundreds of interesting libraries in GitHub. Most of them use good coding patterns. You can recognize them because they are readable and easier to understand. It worth studying and understanding them. Pick a problem you would like solve. Then pick libraries that would help to solve that problem. And study them. Imagine yourself reinventing them. 

Also implementation of most frameworks are awesome.

The best way to learn is seeing lots of examples instead of reading concise rules. Think about learning a language. Reading the grammar book does not help much. You need read, write and speak.

You need to be aware of pure object oriented, functional and logic languages also. Even if you won't use them professionally. Skipping them is missing precious solution patterns.

Finding a solution requires a goal. If you don't have a goal then create a pseudo goal for your target field. A typical example is if you want to make web applications then how can you build yet another to do list in a better way?

Think about a violin player again. He is asking "what are the drills to make so that I can play any composition?". There are no such drills. He needs to decide whether to play Bach or to fiddle.

After some point, you'll see that domain knowledge becomes more important than coding itself.

Consider wood working. Given a saw and sand paper, you can process wood. But are you building living room furniture or a magnificent yacht? That part is domain knowledge.

Back to the start. Be an avid user of GitHub. Watch and follow projects. Love them. Study them. Study their implementation. Use them for your goal.

以上是关于How do I code well?的主要内容,如果未能解决你的问题,请参考以下文章

Life -1a How well do you sleep? Teacher: GABRIELE

How do I duplicate a resource reference in code behind in WPF?

How to do NTG2.5 coding with SDConnect C4

How to do NTG2.5 coding with SDConnect C4

How do I install uudecode?

How does a single thread handle asynchronous code in JavaScript?