博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
作为一个开发人员如何挣钱_作为开发人员如何提出好的问题
阅读量:2524 次
发布时间:2019-05-11

本文共 8507 字,大约阅读时间需要 28 分钟。

作为一个开发人员如何挣钱

Knowing how to ask questions in the right way is a key skill for life in general. A well-structured question will, more often than not, return a useful, direct answer.

通常,知道如何以正确的方式提出问题是人生的一项关键技能。 一个结构合理的问题通常会返回一个有用的直接答案。

When it comes to coding, there are some steps you can take to increase the chances of getting a good answer.

在编码方面,您可以采取一些步骤来增加获得良好答案的机会。

So, one of the skills I try to improve with my students in class is how to ask good questions when they run into an issue.

因此,我试图与班上的学生一起提高的技能之一是,当他们遇到问题时如何提出好的问题。

Here are the main points I teach them:

这是我教给他们的要点:

做基础 (Do the basics)

The very first items on your good-question-asking-quest (⚔️) are the basics.

您的好问题提问任务(⚔️)上的第一个项目是基础知识。

In the early lessons of an in-person course, an instructor might talk you through the solution, while fixing your code. But, in the big bad world of online communities, not doing at least the basics is often like a red flag to a bull.

在现场课程的早期课程中,讲师可能会在解决您的代码的同时告诉您解决方案。 但是,在在线社区这个糟糕的大世界中,至少不做一些基础工作通常就像是对公牛的危险信号。

检查您的代码编辑器是否存在拼写错误和语法错误 (Check your code editor for typos and syntax errors)

Syntax highlighting is a powerful ally when spotting simple typos.

当发现简单的错字时,语法高亮是一个强大的盟友。

Especially for any Brits out there:

特别是对于那里的英国人:

In the early days, the majority of your errors will be typos and syntax errors. These should be a quick fix with the help of your trusty code editor.

在早期,您的大多数错误将是拼写错误和语法错误。 这些应该在您值得信赖的代码编辑器的帮助下快速解决。

检查书面错误 (Check for written errors)

If the language you’re writing provides written errors, check the console/logs. Read through the error to see what and where the error is.

如果您所写的语言提供书面错误,请检查控制台/日志。 通读错误以了解错误的内容和位置。

尝试了解发生了什么 (Try to understand what’s going on)

Once you’ve done the basics, you’ll be a little more informed on what the issue might be.

完成基础知识后,您将对可能出现的问题有所了解。

Now it’s time to read through the code line-by-line. Use any debugging tools available for the language and dig into the problem.

现在该逐行阅读代码了。 使用适用于该语言的所有调试工具,并深入研究问题。

Take your time here. The deeper your understanding of the problem, the more hypotheses you can create. This will, in turn, lead to a clearer question.

慢慢来 您对问题的理解越深,就可以创建更多的假设。 反过来,这将导致一个更明确的问题。

If it’s a user interface (UI) issue, use your browser’s developer tools. Toggle styles off and on and see which ones are being over-written by others.

如果是用户界面(UI)问题,请使用浏览器的开发人员工具。 切换样式,然后查看其他样式正在覆盖哪些样式。

Otherwise, use debuggers and inspect the values of variables. Are they what you expected? Is something showing as undefined when you expect it to have a value?

否则,请使用调试器并检查变量的值。 他们是您所期望的吗? 当您期望它具有值时,是否显示为undefined

If necessary, comment-out blocks of code to zero-in on where the issue is.

如有必要,请注释掉代码块以对问题出处进行归零。

进行一些Google搜索 (Do a few Google searches)

By now, you should at least have an understanding of the problem. This means you should be able to structure a focused question. Before asking anyone else for help, head to Google to do some searching.

到目前为止,您至少应该对问题有所了解。 这意味着您应该能够组织一个重点突出的问题。 向其他人寻求帮助之前,请先前往Google进行搜索。

Google is a developer’s best friend. Even experienced developers need to Google their way out of problems on a regular basis. Good developers are also, very often, good Googlers.

Google是开发人员最好的朋友。 即使是经验丰富的开发人员,也需要定期使用Google解决问题。 优秀的开发人员通常也是优秀的Google员工。

The basic way to structure a decent Google query is as follows:

构造体面的Google查询的基本方法如下:

list the language, library, or framework, then add your spoken word question OR error message

列出语言,库或框架,然后添加您的口语问题错误消息

Here are a couple of examples of questions asked following this structure:

以下是按照此结构询问的几个问题示例:

Make sure you do a few different searches. Read through any results that seem appropriate for your issue. With a bit of luck, someone before you will have had the same problem and will have had their issue resolved.

确保进行一些不同的搜索。 通读所有适合您问题的结果。 幸运的是,您面前的某个人会遇到同样的问题,并且已经解决了他们的问题。

在项目之外重新创建问题 (Recreate the issue away from the project)

If you still haven’t fixed your problem, try recreating the issue away from the project. This is especially helpful if you’re facing some weird CSS problem. In this case, you can .

如果您仍未解决问题,请尝试从项目之外重新创建问题。 如果您遇到一些奇怪CSS问题,这将特别有用。 在这种情况下,您可以 。

Being able to separate your broken code from the rest of your project has a couple of benefits:

能够将残破的代码与项目的其余部分分开可以带来很多好处:

  • It will help you focus on the issue

    它将帮助您专注于该问题
  • It will help anyone else who gets involved fix the issue faster

    这将帮助其他参与其中的人更快地解决此问题

This comes back to valuing other people’s time. It will take them less time to go through a succinct code snippet than your entire codebase.

这回到了珍惜他人的时间。 与完整的代码库相比,使用简洁的代码段所需的时间更少。

准备分享您的代码 (Prepare to share your code)

OK, so you haven’t been able to fix the issue by yourself. No worries! Everything you’ve done until now has laid the foundation for being able to ask a great question.

确定,因此您无法自行解决此问题。 别担心! 到目前为止,您所做的一切都为能够提出一个很好的问题奠定了基础。

But, before you bring someone else in to help you out, there are a couple of things to do:

但是,在您邀请其他人帮助您之前,有几件事要做:

1)确保您的代码格式正确 (1) Make sure your code is well-formatted)

If you’re a disciplined developer, who has well-formatted code, then high-five ✋

如果您是一个训练有素的开发人员,并且拥有格式正确的代码,那么高五

If you’re not, then now is the time to get your code looking pristine ✨.

如果您不是,那么现在是时候让您的代码看起来原始✨了。

Consider using linters. Linters enforce good practices by issuing warnings/errors for poorly-formatted code. You can even make it so that you can’t push code that has linting errors.

考虑使用短绒。 Linters通过对格式不正确的代码发出警告/错误来实施良好做法。 您甚至可以做到这一点,以致于您无法推送包含掉毛错误的代码。

At the very least, and let it do the formatting for you.

至少, 然后让它为您进行格式化。

Bottom-line is: nobody wants to sort out the formatting of your code before they can even start helping you.

最重要的是:没有人愿意在甚至可以帮助您之前就整理出代码的格式。

2)确保您共享的代码会重新创建错误 (2) Ensure the code you’re sharing recreates the error)

Before you share your code, make sure it recreates the issue you’re experiencing. This should go without saying, but it will be extremely tough to help you if the code you’re sharing doesn’t recreate the error.

在共享代码之前,请确保它会重新创建您遇到的问题。 这应该不言而喻,但是如果您共享的代码没有重现错误,将很难为您提供帮助。

If the code requires a few steps to get up-and-running, be sure to include those steps when you share the code.

如果代码需要一些步骤来启动和运行,请确保在共享代码时包括这些步骤。

显示您为解决问题而付出的努力 (Show the efforts you’ve gone through to solve the problem)

At this point, you’re either raising your hand in the classroom or heading to somewhere like StackOverflow or a Slack channel to get an answer online.

此时,您要么在教室里举手,要么去诸如StackOverflow或Slack频道之类的地方在线获取答案。

When asking, it is crucial to go through the steps you’ve taken so far to resolve your issue. Provide anyone who might be able to help with as much information as possible to clarify your issue.

提出问题时,至关重要的是要完成您到目前为止解决问题的步骤。 提供任何可能能够提供更多信息的人,以澄清您的问题。

Here’s some of the information you should be sharing:

这是您应该共享的一些信息:

  • Your understanding of the problem. This could be a few different hypotheses by now. It is important that you articulate what you think the issue might be and what you’ve done to try to fix it.

    您对问题的理解。 到目前为止,这可能是一些不同的假设。 阐明您认为问题可能是什么以及为解决此问题所做的工作非常重要。
  • Screenshots of your issue/error. If it’s a UI issue, annotate your screenshot to highlight the problem.

    您的问题/错误的屏幕截图。 如果是UI问题,请在屏幕截图中添加注释以突出显示问题。
  • Code (preferably in a sandbox environment) that recreates the issue.

    重新创建问题的代码(最好在沙盒环境中)。

Read and re-read your question, if posting online. Be sure that you are providing as much detail as you can to help others help you.

阅读并重新阅读您的问题(如果在线发布)。 确保提供尽可能多的细节,以帮助他人帮助您。

A vague question is much more time-consuming to answer online than in-person.

一个模糊的问题比面对面回答要花费更多的时间。

保持所有人更新 (Keep everyone updated)

If you’ve posted the question online, you might resolve your issue before anyone else has time to answer it. If this is the case, be sure to post your own answer to your question.

如果您已在线发布问题,则可以在其他人没有时间回答问题之前解决问题。 在这种情况下,请确保对您的问题发表自己的答案。

It may seem strange to answer your own question online. But, people do it all the time and it could help someone else in the future.

在线回答自己的问题似乎很奇怪。 但是,人们一直在这样做,它将来可能会帮助其他人。

感谢任何试图帮助您的人 (Thank anyone who tried to help you)

This. Is. Crucial.

这个。 是的。 关键。

Thank everyone who tried to help you. Even if they didn’t actually help resolve your issue. They’ve taken time out of their day to help fix your broken code. Show your appreciation ?

感谢所有试图帮助您的人。 即使他们实际上并没有帮助您解决问题。 他们花了很多时间来帮助您修复损坏的代码。 表示赞赏?

Do you have any tips or tricks about asking good questions that you’d like to add? Please write them in the comments.

您有任何关于想补充的好问题的提示或技巧吗? 请在评论中写下它们。

Want to say hi? .

想打个招呼吗? 。

翻译自:

作为一个开发人员如何挣钱

转载地址:http://qdkzd.baihongyu.com/

你可能感兴趣的文章
电梯调度程序的UI设计
查看>>
转自 zera php中extends和implements的区别
查看>>
Array.of使用实例
查看>>
【Luogu】P2498拯救小云公主(spfa)
查看>>
如何获取网站icon
查看>>
几种排序写法
查看>>
java 多线程的应用场景
查看>>
dell support
查看>>
转:Maven项目编译后classes文件中没有dao的xml文件以及没有resources中的配置文件的问题解决...
查看>>
MTK android 设置里 "关于手机" 信息参数修改
查看>>
单变量微积分笔记6——线性近似和二阶近似
查看>>
补几天前的读书笔记
查看>>
HDU 1829/POJ 2492 A Bug's Life
查看>>
CKplayer:视频推荐和分享插件设置
查看>>
CentOS系统将UTC时间修改为CST时间
查看>>
redis常见面试题
查看>>
导航控制器的出栈
查看>>
玩转CSS3,嗨翻WEB前端,CSS3伪类元素详解/深入浅出[原创][5+3时代]
查看>>
iOS 9音频应用播放音频之播放控制暂停停止前进后退的设置
查看>>
Delphi消息小记
查看>>