在线搜索不仅仅是按回车键

注: 机翻,未校对。


Searching for coding help online is about more than hitting Enter.

在线搜索不仅仅是按回车键

What Is Google-Fu ? Do You Have It ?

What Is Google-Fu? Do You Have It?
Hardly any code is able to run perfectly on its first try. When developers hit Run, programs may encounter compiler errors, runtime errors or unexpected outputs.
几乎没有任何代码能够在第一次尝试时完美运行。当开发人员点击“运行”时,程序可能会遇到编译器错误、运行时错误或意外输出。

There are a few options available at that point. Experienced developers may have seen a similar problem before and remember how to fix it, or another developer on the team may recognize the problem and be able to offer a hand.
在这一点上有几个选项可用。有经验的开发人员以前可能见过类似的问题并记得如何解决它,或者团队中的其他开发人员可能会意识到这个问题并能够提供帮助。

But, more often than not, whether it’s because the problem is particularly thorny or there’s no one around who can help, developers have to fall back on another skill — their Google-fu.
但是,通常情况下,无论是因为问题特别棘手,还是因为周围没有人可以提供帮助,开发人员不得不依靠另一种技能——他们的 Google-fu。

4 Ways to Level Up Your Google-Fu 提升 Google-Fu 的 4 种方法

The ability to successfully query search engines can hardly seem like a skill, but in practice, learning and finding solutions to technical problems online is important and doesn’t come easily to everyone. Software developers sometimes refer to this skill as “Google-fu.”
成功查询搜索引擎的能力似乎很难成为一项技能,但在实践中,在线学习和寻找技术问题的解决方案很重要,对每个人来说都不容易。软件开发人员有时将这种技能称为“Google-fu”。

Google-fu is not only about knowing which keywords to type into a search bar — developers must be able to navigate an entire search process successfully in order to find answers. That often involves performing a series of tangential searches that gets them incrementally closer to the solution, while simultaneously knowing how to avoid queries that would only distract from their original question.
Google-fu 不仅仅是知道在搜索栏中输入哪些关键字——开发人员必须能够成功地浏览整个搜索过程才能找到答案。这通常涉及执行一系列切向搜索,使他们逐渐接近解决方案,同时知道如何避免只会分散他们原始问题的注意力的查询。

The goal is to strike a balance between understanding and efficiency. Developers should be able to quickly zero in on the answer and not spend all day getting lost online. This means they need to be able to quickly determine whether a website or resource has useful information, and also be able to arrive at a solution to their problem through it or use it to further inform their next search.
目标是在理解和效率之间取得平衡。开发人员应该能够快速找到答案,而不是整天在网上迷失方向。这意味着他们需要能够快速确定网站或资源是否有有用的信息,并且还能够通过它找到解决问题的方法,或者使用它来进一步告知他们的下一次搜索。

So while typing a few words into a search bar and hitting Enter may not seem like much of a skill, developers’ ability to bend search engine results to their will is undeniably important to their work.
因此,虽然在搜索栏中输入几个单词并按 Enter 键似乎不是什么技能,但开发人员根据自己的意愿弯曲搜索引擎结果的能力对他们的工作无疑很重要。

Some are great at it and can find answers quickly and easily. Others hardly ever have any luck, spending countless hours chasing down internet leads without ever getting to the right answer. Although search engines are admittedly doing most of the work, developers’ varied success rates are due to their using different techniques — when to search, what to search and how to search.
有些人很擅长,可以快速轻松地找到答案。其他人几乎没有任何运气,花费无数小时追逐互联网线索,却从未得到正确的答案。尽管搜索引擎确实完成了大部分工作,但开发人员的成功率各不相同,这是由于他们使用了不同的技术——何时搜索、搜索什么以及如何搜索。

Here’s what you can learn from a few Google-fu experts on how to improve your own technique.
以下是您可以从一些 Google-fu 专家那里学到的关于如何改进自己的技术的知识。

Don’t Trust Every Answer You Find 不要相信你找到的每一个答案

The easiest search to do when encountering a coding error is by querying the error message provided by the compiler. Usually, that’s a good place to start.
遇到编码错误时,最简单的搜索是查询编译器提供的错误消息。通常,这是一个很好的起点。

“I actually always start by copying and pasting error messages,” said Dan Hales, software developer at ASR Analytics. “It’s a good way to find other people asking about exactly that same error message.”
“实际上,我总是从复制和粘贴错误消息开始,”ASR Analytics的软件开发人员Dan Hales说。“这是找到其他人询问完全相同的错误消息的好方法。”

Though Hales recommends cleaning up the error message before searching on it because messages may contain references to the developer’s code — such as file names — that are not universal and could throw off search results. Instead of copying the entire text of the error message, which can be hundreds of lines long, developers should trim the message and search on important phrases, such as the name of the exception.
不过,Hales 建议在搜索错误消息之前先清理错误消息,因为消息可能包含对开发人员代码的引用(例如文件名),这些代码不是通用的,可能会丢失搜索结果。开发人员不应复制错误消息的整个文本(可能长达数百行),而应修剪消息并搜索重要短语,例如异常的名称。

“There’s no substitute for experience and knowledge.”
“经验和知识是无可替代的。”

Sometimes this technique can lead to the answer right away, especially if it’s a common problem that people have already seen and encountered before. But blindly copying over error messages into a search query won’t solve every problem — and if developers aren’t careful, it can even lead them astray.
有时,这种技术可以立即得出答案,特别是如果这是人们以前已经看到和遇到的常见问题。但是,盲目地将错误消息复制到搜索查询中并不能解决所有问题,如果开发人员不小心,甚至会误入歧途。

Tim Maliyil, CEO of security company AlertBoot, said the power of search engines also is their downside — anyone can post an answer, even if they don’t know what they’re talking about.
安全公司AlertBoot的首席执行官蒂姆·马利伊尔(Tim Maliyil)表示,搜索引擎的强大功能也是它们的缺点——任何人都可以发布答案,即使他们不知道自己在说什么。

“You need to have a basic understanding of how things work to decipher if an answer makes sense, or if it’s just, you know, garbage — inefficient or just [offering] bad solutions,” Maliyil said. “There’s no substitute for experience and knowledge.”
“你需要对事情的运作方式有一个基本的了解,才能破译一个答案是否有意义,或者它是否只是垃圾——效率低下或只是[提供]糟糕的解决方案,”马利伊尔说。“经验和知识是无可替代的。”

Answers could be simply outdated as well, said Austyn Tomasik, senior software engineer at Focused Labs.
答案也可能已经过时了,Focused Labs的高级软件工程师Austyn Tomasik说。

Sometimes a solution looks like a good idea, “Then you’re like, ‘Oh, this is actually six years old,’” Tomasik said. “Or they didn’t mention the version that they’re working on, and whatever they’re referencing doesn’t exist in your version. You just have to make sure you’re looking at [that] and not wasting time.”
有时,解决方案看起来是个好主意,“然后你会说,‘哦,这实际上是六岁了,’”托马西克说。“或者他们没有提到他们正在开发的版本,他们所引用的任何内容都不存在你的版本。你只需要确保你正在关注[那个],而不是浪费时间。

Pinpoint What Question You’re Really Trying to Ask 确定您真正想问的问题

Developer forum websites like Stack Overflow have some measures in place to prevent people from disseminating bad advice, such as community voting that elevates the best responses. But those methods are less effective for specialized questions, which are read and voted on less often. Developers still need to rely on their ability to ask precise questions and hone their search based on the relevance of responses.
像 Stack Overflow 这样的开发者论坛网站有一些措施来防止人们传播不良建议,例如提升最佳响应的社区投票。但这些方法对于专业问题效果较差,因为这些问题的阅读和投票频率较低。开发人员仍然需要依靠他们提出精确问题的能力,并根据响应的相关性来磨练他们的搜索。

Hale said unsuccessful searches sometimes result from developers rushing to find a fix before understanding the scope of the problem.
黑尔说,搜索失败有时是因为开发人员在了解问题的范围之前就急于找到解决方案。

“A lot of people Google because they’re trying to find a solution to their problem — but they don’t really know what question they have,” he said. “Before you start typing stuff into Google, if you know exactly what you’re expecting and what should be happening, that can combine with the error message to really narrow down your results to something more useful.”
“很多人在谷歌上搜索是因为他们试图找到解决问题的方法 - 但他们真的不知道他们有什么问题,”他说。“在你开始在谷歌上输入东西之前,如果你确切地知道你期待什么以及应该发生什么,这可以与错误消息相结合,真正将你的结果缩小到更有用的东西。

“A lot of people Google because they’re trying to find a solution to their problem — but they don’t really know what question they have.”
“很多人在谷歌上搜索,因为他们试图找到解决问题的方法,但他们并不真正知道自己有什么问题。

Using debugging tools and printing values to the console during program execution are good ways to pinpoint where errors are coming from. When Hale runs into particularly tricky problems, he dumps a lot of information into the console, looking for the section of code that’s causing the error.
在程序执行期间使用调试工具和将值打印到控制台是查明错误来源的好方法。当 Hale 遇到特别棘手的问题时,他会将大量信息转储到控制台中,寻找导致错误的代码部分。

Creating a minimal, reproducible code snippet that can replicate the problem is another good way to isolate the issue, Hale said. This practice helps developers focus on one error at a time and not have to worry about cross-contamination from other parts of the codebase. Ultimately, understanding the code as much as possible will help developers form better searches.
Hale 说,创建一个最小的、可重复的代码片段来复制问题,是隔离问题的另一种好方法。这种做法有助于开发人员一次专注于一个错误,而不必担心来自代码库其他部分的交叉污染。最终,尽可能多地理解代码将有助于开发人员形成更好的搜索。

“It’s not something where there’s a quick and easy fix — you really just have to know the ins and outs of the piece of code that you’re working with, and what your codebase is supposed to do,” Hales said. “There’s not really a good substitute for that, unfortunately.”
“这不是一个快速简便的修复方法——你真的只需要知道你正在使用的一段代码的来龙去脉,以及你的代码库应该做什么,”Hales 说。“不幸的是,没有一个好的替代品。

Be Precise With Your Terminology 准确使用术语

For Kristin Jackvony, principal engineer for quality at Paylocity, a successful search is all about finding the right terms to query. That’s because the correct term will link to important resources like library documentation or forum discussions where someone already asked a similar issue. Incorrect terms will instead yield irrelevant results. Getting to the right terminology is a process of refining your search words until you find applicable information.
对于 Paylocity 的质量首席工程师 Kristin Jackvony 来说,成功的搜索就是找到正确的查询词。这是因为正确的术语将链接到重要的资源,如图书馆文档或论坛讨论,其中有人已经提出了类似的问题。不正确的术语反而会产生不相关的结果。获得正确的术语是一个完善搜索词的过程,直到找到适用的信息。

“Usually I do three- or four-word phrases, usually no more than that,” Jackvony said. “And then I would fine-tune by changing one of the words. Sometimes even just changing one word might be enough to get you a different result.”
“通常我会做三到四个单词的短语,通常不超过这个,”杰克沃尼说。“然后我会通过改变其中一个词来微调。有时,即使只是改变一个词,也足以让你得到不同的结果。

Jackvony shared her experience refining a search regarding authentication issues — a notoriously challenging area. While trying to figure out why her browser-side code wasn’t working properly, she started by searching the phrase, “authentication at browser level.”
Jackvony 分享了她改进有关身份验证问题的搜索的经验——这是一个众所周知的具有挑战性的领域。在试图弄清楚为什么她的浏览器端代码无法正常工作时,她首先搜索了短语“浏览器级别的身份验证”。

But that phrase yielded results that were too broad, and Jackvony realized she needed to focus specifically on how tokens are stored in the browser. She changed the search term to focus on “cookies,” and how to save the authentication token as a cookie on the browser. That change proved to be important — and set her on the right path.
但是这句话产生的结果太宽泛了,Jackvony 意识到她需要特别关注令牌在浏览器中的存储方式。她更改了搜索词,将重点放在“cookie”上,以及如何将身份验证令牌保存为浏览器上的cookie。事实证明,这种改变很重要,并使她走上了正确的道路。

“Sometimes even just changing one word might be enough to get you a different result.”
“有时,即使只是改变一个词,也足以让你得到不同的结果。

“When I’m starting to see some of the answers I might get better ideas of what words to use,” Jackvony said. “When I first did my search, I was talking about tokens, and then I saw people were talking about cookies. I thought, ‘Oh, what I really need is a cookie.’ So then I’d go back to my original query and then change my word ‘token’ to ‘cookie.’”
“当我开始看到一些答案时,我可能会对使用什么词有更好的想法,”杰克沃尼说。“当我第一次进行搜索时,我谈论的是 token,然后我看到人们在谈论 cookie。我想,‘哦,我真正需要的是一块 cookie 。因此,我会回到我原来的查询,然后将我的单词’token’更改为’cookie’。

Other people can be great resources for finding the right search terms. Even if they don’t know how to solve your problem, they might know the correct technical phrase that can better refine your search. As a software tester, Jackvony isn’t as familiar with certain software terminology as developers are. She finds that developers are often able to produce the right term very quickly when she describes what she’s looking for.
其他人可以成为找到正确搜索词的重要资源。即使他们不知道如何解决您的问题,他们也可能知道正确的技术短语,可以更好地优化您的搜索。作为一名软件测试人员,Jackvony 并不像开发人员那样熟悉某些软件术语。她发现,当她描述她要找的东西时,开发人员通常能够非常快速地产生正确的术语。

Jackvony also recommends rubber-ducking — talking through the problem out loud to yourself in order to force details to the surface.
杰克沃尼还建议采用橡皮回避——大声自言自语地解决问题,以便将细节浮出水面。

“Sometimes just stating the problem out loud, or in writing to somebody, helps sort of jog your brain,” Jackvony said. “Then you suddenly realize that you’re either trying to solve the wrong problem, or you remember how you solved it last time.”
“有时只是大声说出问题,或者写信给某人,有助于让你的大脑慢下来,”杰克沃尼说。“然后你突然意识到,你要么试图解决错误的问题,要么你记得你上次是如何解决的。

Aim for Higher-Level Understanding 以更高层次的理解为目标

Though forums are useful and can clear up common issues quickly, developers shouldn’t only rely on those sites to solve their problems.
虽然论坛很有用,可以快速解决常见问题,但开发人员不应该只依靠这些网站来解决他们的问题。

Tomasik from Focused Labs said that, while Stack Overflow is still dominant, she’s noticed blogs and tutorials are better resources for certain types of problems.
来自 Focused Labs 的 Tomasik 说,虽然 Stack Overflow 仍然占主导地位,但她注意到博客和教程是解决某些类型问题的更好资源。

“If you’re looking at things that are very specific, sometimes you can find someone who’s encountered it and they wrote it up in a blog post,” she said.
“如果你正在研究非常具体的事情,有时你可以找到一个遇到过它的人,他们把它写在博客文章中,”她说。

Formal documentation is also a great resource, and is often provided by the company that created the tool or library. Hales recommends looking at the inputs and outputs corresponding to library functions because unexpected program outputs can often be traced back to error outputs from library functions. For instance, the developer may expect a function to return an object, but due to an error it returns a null.
正式文档也是一个很好的资源,通常由创建工具或库的公司提供。Hales 建议查看与库函数相对应的输入和输出,因为意外的程序输出通常可以追溯到库函数的错误输出。例如,开发人员可能期望函数返回一个对象,但由于错误,它返回 null。

“If I’m not getting that object, it must be something within this method because it was supposed to return that object to me,” he said.
“如果我没有得到那个对象,它一定是这个方法中的东西,因为它应该把那个对象还给我,”他说。

Jackvony recommended going to developer sites or Wikipedia to read generally about unknown terms while refining a search. Helpful information can be found on company blogs, formal documentation or other developers’ blogs. Developers who gain a deeper understanding of the technical principles are able to conduct better searches.
Jackvony 建议在优化搜索时访问开发人员网站或维基百科,大致阅读有关未知术语的信息。有用的信息可以在公司博客、正式文档或其他开发人员的博客上找到。对技术原理有更深入理解的开发人员能够进行更好的搜索。

“Sometimes you don’t know something, and you are so new to it that you don’t even know what you don’t know,” Jackvony said. “That’s the time where you stop and you say, ‘OK, let me go back to what problem I am trying to solve. And is this path I’m on leading me toward that solution?’”
“有时你不知道一些事情,而且你对它太陌生了,你甚至不知道你不知道什么,”杰克沃尼说。“那是你停下来的时候,你说,'好吧,让我回到我试图解决的问题。而我正在走的这条路是否正在引导我走向那个解决方案?


via:

  • 23
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值