开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
今日推荐开源项目:《传奇画师续作 purecss-gaze》
今日推荐英文原文:《Use the Documentation — Not StackOverflow》
开源日报第787期:《传奇画师续作 purecss-gaze》
今日推荐开源项目:《传奇画师续作 purecss-gaze》传送门:GitHub链接
推荐理由:他来了他来了,他带着新作走来了。这个项目是经常拿着 HTML+CSS 就上场画画去的项目作者的续作,这个表现出来的效果一如既往的令人惊讶,如果你不打开浏览器控制台,很难想像这真的不是一张图片而且一个个 HTML 元素堆砌起来的成果……
今日推荐英文原文:《Use the Documentation — Not StackOverflow》作者:Brett Fazio
原文链接:https://medium.com/better-programming/use-the-documentation-not-stackoverflow-45fe4663b94e
推荐理由:如果不是火烧眉毛,花点时间帮助未来的自己总不是坏事

Use the Documentation — Not StackOverflow

Understanding how to do something is much better than a quick fix

When faced with a problem, our first instinct is to Google to find the specific solution. This may be fine in other disciplines, but not in computer science.

Most of the time when we Google our problem, we are presented with a forum, like StackOverflow, that consists of a similar question and a specific answer. We read through the question to see if it fits ours, then we proceed to copy and modify the accepted answer to fit our needs. Problem solved, right? Well, not really.

Yes, you may have found a block of code on the internet that, with the magic of copy-paste, fixed your problem. But in the longer term, your understanding wasn’t really deepened. When faced with a similar problem again, you’ll probably have to resort to the same forum question. When faced with a more difficult problem, you’ll have to drain your energy trying to piece together seven or eight different solutions on the internet hopefully arriving at something that resembles good, working code.

Why Use Documentation Instead?

When I first got into iOS development, I used the BigNerdRanch iOS development books — they were the ones that looked the best at my local bookstore. One of the key things they hammered home was Shift+Command+0 — this keystroke brings up the documentation when using Xcode.

They didn’t suggest instantly giving up and Googling; the authors wanted me to use the documentation. This was great advice.

While forums online usually read like a quick fix, documentation reads like a textbook or a manual. I think a textbook is an apt comparison here because we use textbooks in school to deepen our understanding of an unfamiliar topic, and I think we should use documentation the same way.

If, for example, you were writing a Make file to compile your C++ app and one of the lines in your Make file kept resulting in an error, you could probably Google the error and find a line of Make code to fix your problem.

But what if you had looked at the documentation instead? Yes, it will take longer to scour through the documentation, but you will gain a deeper understanding of what’s going on. In doing so, you’ll be able to make connections between your newfound understanding of Make and the current problem at hand. Now, the next time you encounter a problem, you’ll be able to refer back to that deeper understanding and solve the problem yourself.

Should I Never Use StackOverflow Again?

No. There’s a time and place for everything. StackOverflow — and sites like it — are a great tool to figure out problems. But it shouldn’t be your primary source of learning and it shouldn’t be the first place you go when you have a problem.

If you refer to the documentation first but are unable to understand it or still can’t fix your code, going to StackOverflow next to ask the question is a logical next step — but now your question will be better. You can refer to the parts of the documentation that you looked at and still don’t understand, and try to connect that to your specific problem when you ask your question. Your question will be better.

People won’t view your question as just another person looking for someone else to fix their code. They’ll view your question as someone who’s really trying to understand something in order to fix a problem but just needs a little help. That’s a much better look.

With the long-term outlook in mind, being able to become the person who can solve your own programming problems, rather than relying on forums will make you a much better developer. It’s not to say that there isn’t a time and place for StackOverflow; if you’ve tried to learn it yourself but still can’t get it, StackOverflow is a perfect place to go.

Trying to learn things yourself should always be your go-to when a problem arises.
下载开源日报APP:https://openingsource.org/2579/
加入我们:https://openingsource.org/about/join/
关注我们:https://openingsource.org/about/love/