<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Question | 酷 壳 - CoolShell</title>
	<atom:link href="https://coolshell.cn/tag/question/feed" rel="self" type="application/rss+xml" />
	<link>https://coolshell.cn</link>
	<description>享受编程和技术所带来的快乐 - Coding Your Ambition</description>
	<lastBuildDate>Fri, 29 Mar 2019 10:42:27 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2</generator>
	<item>
		<title>X-Y Problem</title>
		<link>https://coolshell.cn/articles/10804.html</link>
					<comments>https://coolshell.cn/articles/10804.html#comments</comments>
		
		<dc:creator><![CDATA[陈皓]]></dc:creator>
		<pubDate>Mon, 16 Dec 2013 02:22:37 +0000</pubDate>
				<category><![CDATA[杂项资源]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Question]]></category>
		<category><![CDATA[程序员]]></category>
		<guid isPermaLink="false">http://coolshell.cn/?p=10804</guid>

					<description><![CDATA[<p>X-Y Problem 对于X-Y Problem的意思如下： 1）有人想解决问题X 2）他觉得Y可能是解决X问题的方法 3）但是他不知道Y应该怎么做 4）于是...</p>
<p class="read-more"><a class="btn btn-default" href="https://coolshell.cn/articles/10804.html"> Read More<span class="screen-reader-text">  Read More</span></a></p>
The post <a href="https://coolshell.cn/articles/10804.html">X-Y Problem</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></description>
										<content:encoded><![CDATA[<p><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415450859608158"
     crossorigin="anonymous"></script></p>
<h4><img decoding="async" loading="lazy" class="alignright size-medium wp-image-10809" alt="" src="https://coolshell.cn/wp-content/uploads/2013/12/x-y.problem-231x300.jpg" width="231" height="300" />X-Y Problem</h4>
<p>对于X-Y Problem的意思如下：</p>
<p>1）有人想解决问题X<br />
2）他觉得Y可能是解决X问题的方法<br />
3）但是他不知道Y应该怎么做<br />
4）于是他去问别人Y应该怎么做？</p>
<p>简而言之，<strong>没有去问怎么解决问题X，而是去问解决方案Y应该怎么去实现和操作</strong>。于是乎：</p>
<p>1）热心的人们帮助并告诉这个人Y应该怎么搞，但是大家都觉得Y这个方案有点怪异。<br />
2）在经过大量地讨论和浪费了大量的时间后，热心的人终于明白了原始的问题X是怎么一回事。<br />
3）于是大家都发现，Y根本就不是用来解决X的合适的方案。</p>
<p>X-Y Problem最大的严重的问题就是：<strong>在一个根本错误的方向上浪费他人大量的时间和精力</strong>！</p>
<h4>示例</h4>
<p>举个两个例子：</p>
<blockquote><p>Q) 我怎么用Shell取得一个字符串的后3位字符？<br />
A1) 如果这个字符的变量是$foo，你可以这样来 echo ${foo:-3}<br />
A2) 为什么你要取后3位？你想干什么？<br />
Q) 其实我就想取文件的扩展名<br />
A1) 我靠，原来你要干这事，那我的方法不对，文件的扩展名并不保证一定有3位啊。<br />
A1) 如果你的文件必然有扩展名的话，你可以这来样来：echo ${foo##*.}</p></blockquote>
<p><span id="more-10804"></span></p>
<p>再来一个示例：</p>
<blockquote><p>Q）问一下大家，我如何得到一个文件的大小<br />
A1)  size = <code data-enlighter-language="raw" class="EnlighterJSRAW">ls -l $file  | awk &#039;{print $5}&#039;</code><br />
Q) 哦，要是这个文件名是个目录呢？<br />
A2) 用du吧<br />
A3) 不好意思，你到底是要文件的大小还是目录的大小？你到底要干什么？<br />
Q)  我想把一个目录下的每个文件的每个块（第一个块有512个字节）拿出来做md5，并且计算他们的大小 ……<br />
A1) 哦，你可以使用dd吧。<br />
A2) dd不行吧。<br />
A3) 你用md5来计算这些块的目的是什么？你究竟想干什么啊？<br />
Q) 其实，我想写一个网盘，对于小文件就直接传输了，对于大文件我想分块做增量同步。<br />
A2) 用rsync啊，你妹！</p></blockquote>
<p><a href="http://www.perlmonks.org/index.pl?node_id=542341" target="_blank">这里有篇文章</a>说明了X-Y Problem的各种案例说明，我从其中摘出三个来让大家看看：</p>
<blockquote><p>你试图做X，并想到了用Y方案。所以你去问别人Y，但根本不提X。于是，你可以会错过本来可能有更好更适合的方案，除非你告诉大家X是什么。</p>
<p>— <i>from <a href="http://www.perlmonks.org/index.pl?node_id=430320">Re: How do I keep the command line from eating the backslashes?</a> by <a href="http://www.perlmonks.org/index.pl?node_id=163683">revdiablo</a></i></p></blockquote>
<blockquote><p>有些人问怎么做Y，但其它他想做的是X。他问怎么做Y是因为他觉得Y是最好搞定X的方法。 于是大家不断地回答“试试这个，试试那个”来帮助他，而他总是在说“这个有问题，那个有问题，因为……”。基本不同的情况，其它的方案可能会更好。</p>
<p>— <i>from <a href="http://www.perlmonks.org/index.pl?node_id=327963">Re: Re: Re: Re: regex to validate e-mail addresses and phone numbers</a> by <a href="http://www.perlmonks.org/index.pl?node_id=180961">Limbic~Region</a></i></p></blockquote>
<blockquote><p>X-Y Problem又叫“过早下结论”：提问者其实并不非常清楚想要解决的X问题，他猜测用Y可以搞定，于是他问大家如何实现Y。</p>
<p>— <i>from <a href="http://groups.google.com/groups?hl=en&amp;selm=Pine.GHP.4.21.0009061210570.8800-100000@hpplus03.cern.ch">&lt;Pine.GHP.4.21.0009061210570.8800-100000@hpplus03.cern.ch&gt;</a> by Alan J. Flavell</i></p></blockquote>
<p>其实这个问题在我之前的《<a title="你会问问题吗？" href="https://coolshell.cn/articles/3713.html" target="_blank">你会问问题吗</a>》里提到的那篇How To Ask Questions the Smart Way中的提到过，你可以<a href="http://www.beiww.com/doc/oss/smart-questions.html#id265951" target="_blank">移步去看一下</a>。</p>
<p>所以，我们在寻求别人帮助的时候，最好把我们想解决的问题和整个事情的来龙去脉说清楚。</p>
<h4>一些变种</h4>
<p>我们不要以为X-Y Problem就像上面那样的简单，我们不会出现，其实我们生活的这个世界有有各种X-Y Problem的变种。下面我个人觉得非常像XY Problem的总是：</p>
<p style="padding-left: 30px;">其一、大多数人有时候，非常容易把手段当目的，他们会用自己所喜欢的技术和方法来反推用户的需求，于是很有可能就会出现X-Y Problem &#8211; 也许解决用户需求最适合的技术方案是PC，但是我们要让他们用手机。</p>
<p style="padding-left: 30px;">其二、产品经理有时候并不清楚他想解决的用户需求是什么，于是他觉得可能开发Y的功能能够满足用户，于是他提出了Y的需求让技术人员去做，但那根本不是解决X问题的最佳方案。</p>
<p style="padding-left: 30px;">其三、因为公司或部门的一些战略安排，业务部门设计了相关的业务规划，然后这些业务规划更多的是公司想要的Y，而不是解决用户的X问题。</p>
<p style="padding-left: 30px;">其四、对于个人的职业发展，X是成长为有更强的技能和能力，这个可以拥有比别人更强的竞争力，从而可以有更好的报酬，但确走向了Y：全身心地追逐KPI。</p>
<p style="padding-left: 30px;">其五、本来我们想达成的X是做出更好和更有价值的产品，但最终走到了Y：通过各种手段提升安装量，点击量，在线量，用户量来衡量。</p>
<p style="padding-left: 30px;">其六、很多团队Leader都喜欢制造信息不平等，并不告诉团队某个事情的来由，掩盖X，而直接把要做的Y告诉团队，导致团队并不真正地理解，而产生了很多时间和经历的浪费。</p>
<p>所有的这些，在我心中都是X-Y Problem的变种，这是不是一种刻舟求剑的表现？</p>
<h4>参考</h4>
<ul>
<li><a href="http://meta.stackoverflow.com/questions/66377/what-is-the-xy-problem" target="_blank">StackOverflow: What is XY Problem?</a></li>
<li><a href="http://www.perlmonks.org/?node_id=542341" target="_blank">PerlMonks: XY Problem</a></li>
<li><a href="http://mywiki.wooledge.org/XyProblem" target="_blank">Greg&#8217;s Wiki</a></li>
</ul>
<p>（全文完）<!--



<p align="center"><a href= target=_blank><img decoding="async" src=""></a></p>





<p align="center"><img decoding="async" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.weixin.jpg"> <img decoding="async" loading="lazy" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.mini_.jpg" width="300" height="300"> <br />关注CoolShell微信公众账号和微信小程序</p>

 

--></p>
<div style="margin-top: 15px; font-size: 16px;color: #cc0000;">
<p align="center"><strong>（转载本站文章请注明作者和出处 <a href="https://coolshell.cn/">酷 壳 &#8211; CoolShell</a> ，请勿用于任何商业用途）</strong></p>
</div>

<div class="wp_rp_wrap  wp_rp_vertical_m" id="wp_rp_first"><div class="wp_rp_content"><h3 class="related_post_title">相关文章</h3><ul class="related_post wp_rp"><li ><a href="https://coolshell.cn/articles/3713.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/plugins/wordpress-23-related-posts-plugin/static/thumbs/10.jpg" alt="你会问问题吗？" width="150" height="150" /></a><a href="https://coolshell.cn/articles/3713.html" class="wp_rp_title">你会问问题吗？</a></li><li ><a href="https://coolshell.cn/articles/22298.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2022/10/communication-150x150.png" alt="聊聊团队协同和协同工具" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22298.html" class="wp_rp_title">聊聊团队协同和协同工具</a></li><li ><a href="https://coolshell.cn/articles/22173.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2022/02/http_method-150x150.png" alt="“一把梭：REST API 全用 POST”" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22173.html" class="wp_rp_title">“一把梭：REST API 全用 POST”</a></li><li ><a href="https://coolshell.cn/articles/22157.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2022/02/monitoring-150x150.jpeg" alt="谈谈公司对员工的监控" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22157.html" class="wp_rp_title">谈谈公司对员工的监控</a></li><li ><a href="https://coolshell.cn/articles/21589.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2021/07/knowledge_sharing-300x169-1-150x150.jpeg" alt="如何做一个有质量的技术分享" width="150" height="150" /></a><a href="https://coolshell.cn/articles/21589.html" class="wp_rp_title">如何做一个有质量的技术分享</a></li><li ><a href="https://coolshell.cn/articles/20977.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2020/08/programmer.01-e1596792460687-150x150.png" alt="程序员如何把控自己的职业" width="150" height="150" /></a><a href="https://coolshell.cn/articles/20977.html" class="wp_rp_title">程序员如何把控自己的职业</a></li></ul></div></div>The post <a href="https://coolshell.cn/articles/10804.html">X-Y Problem</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></content:encoded>
					
					<wfw:commentRss>https://coolshell.cn/articles/10804.html/feed</wfw:commentRss>
			<slash:comments>135</slash:comments>
		
		
			</item>
		<item>
		<title>你会问问题吗？</title>
		<link>https://coolshell.cn/articles/3713.html</link>
					<comments>https://coolshell.cn/articles/3713.html#comments</comments>
		
		<dc:creator><![CDATA[陈皓]]></dc:creator>
		<pubDate>Tue, 22 Feb 2011 00:40:49 +0000</pubDate>
				<category><![CDATA[杂项资源]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Question]]></category>
		<category><![CDATA[程序员]]></category>
		<guid isPermaLink="false">http://coolshell.cn/?p=3713</guid>

					<description><![CDATA[<p>在工作和生活中，总是会有很多人问题我很多技术方面的问题。有一些时候，问问题的和答问题的总是会有一些不爽的事情发生。如下面的几种情况： 比如：“我的电脑老是蓝屏，...</p>
<p class="read-more"><a class="btn btn-default" href="https://coolshell.cn/articles/3713.html"> Read More<span class="screen-reader-text">  Read More</span></a></p>
The post <a href="https://coolshell.cn/articles/3713.html">你会问问题吗？</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></description>
										<content:encoded><![CDATA[<p><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415450859608158"
     crossorigin="anonymous"></script>在工作和生活中，总是会有很多人问题我很多技术方面的问题。有一些时候，问问题的和答问题的总是会有一些不爽的事情发生。如下面的几种情况：</p>
<ul>
<li>比如：“我的电脑老是蓝屏，怎么办？”，通常这样的问题90%以上的回答是：“重装吧”。这让问问题的人感到很沮丧，但你不能不承认那不是答案。而且有时候让人无法解答，比如：“我的makefiel出错了，你帮我看看我的makfile”，我通常会非反问，报了什么错吗？</li>
<li>另一种情况是，回答问题的人首先先对问问题的人的抱怨，你问的问题就不对，或是，你问的这个问题是什么意思，而导致问问题的人却在不停地解释，结果花了好长时间来讨论问题本身是什么。</li>
<li>还有一种情况是，问的问题太简单了甚至太白痴了，比如你自己试一试或是读读文档就知道了的问题，或是问这个问题直接表明了你的无知或是懒惰。这种问题会相当影响别人对你的印象。</li>
<li>第四种情况是，提问者滔滔不绝，扯这扯那，讲了一大堆，听得听累了。最后都不知道你要干什么。</li>
</ul>
<p>所以，怎么去问问题，怎么问一个好的问题，是一个很重要的事。你提问的技术直接关系到了你是否能够很快得到你满意的答案。</p>
<p>这里有一篇文章推荐给大家《<a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank" rel="noopener noreferrer">How To Ask Questions The Smart Way</a>》，中文版在这里《<a href="https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way" target="_blank" rel="noopener noreferrer">提问的智慧</a>》，我把其中的几个亮点总结如下：</p>
<p><span id="more-3713"></span></p>
<ul>
<li>提问前先自己尝试查找答案，读读文档、手册，看看有没有相似的问题，看看那些方法能不能帮你解决问题，自己去试一试。如果你是程序员，你应该先学会自己调查一下源代码。（不然，人家回答你的一定是——RTFM &#8211; Read The Fucking Manual）这样的问题很多。我有时候很不愿意回答这样的问题，因为我觉得问问题的人把我当成了他的小跟班了。</li>
</ul>
<ul>
<li>提问的时候，找正确的人或是正确的论坛发问。向陌生人或是不负责的人提问可能会是很危险的。不正确的人，会让你事倍功半。如果你问Linux的人Windows太慢怎么办？他们一定会让你把Windows删了装Linux去的。</li>
</ul>
<ul>
<li>问的问题一定要是很明确的，并且阐述你做了哪些尝试，你一定要简化你的问题，这样可以让你的问题更容易被回答。对于一些问题，最好提供最小化的重现问题的步骤。</li>
</ul>
<ul>
<li>你一定要让问题变得简单易读，这和写代码是一样的。只有简单易读的邮件，人们才会去读，试想看到一封巨大无比的邮件，读邮件的心情都没有了。而且，内容越多，可能越容易让人理解错了。</li>
</ul>
<ul>
<li>你问问题的态度应该是以一种讨论的态度，即不是低三下四，也不是没有底气。只有这样，你和你的问题才能真正被人看得起。要达到这个状态，不想让别人看不起你，你就一定需要自己去做好充足的调查。问题 问得好的话，其实会让人觉得你很有经验的，能想到别人想不到的地方。</li>
</ul>
<ul>
<li>不要过早下结论。比如：“我这边的程序不转了，我觉得是你那边的问题，你什么时候能fix？”，或是“太难调试了，gdb怎么这么烂？！”。当你这么做的时候，你一定要有足够的信息和证据，否则，你就显得很自大。好的问题应该是，“我和你的接口的程序有问题，我输入了这样的合法的参数，但是XX函数却总是返回失败，我们能一起看看吗？”，“我看了一下gdb的文档，发现我在用XXX命令调试YYY的时候，有这样ZZZ的问题，是不是我哪里做错了？”</li>
</ul>
<p>（全文完）<!--



<p align="center"><a href= target=_blank><img decoding="async" src=""></a></p>





<p align="center"><img decoding="async" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.weixin.jpg"> <img decoding="async" loading="lazy" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.mini_.jpg" width="300" height="300"> <br />关注CoolShell微信公众账号和微信小程序</p>

 

--></p>
<div style="margin-top: 15px; font-size: 16px;color: #cc0000;">
<p align="center"><strong>（转载本站文章请注明作者和出处 <a href="https://coolshell.cn/">酷 壳 &#8211; CoolShell</a> ，请勿用于任何商业用途）</strong></p>
</div>

<div class="wp_rp_wrap  wp_rp_vertical_m" ><div class="wp_rp_content"><h3 class="related_post_title">相关文章</h3><ul class="related_post wp_rp"><li ><a href="https://coolshell.cn/articles/10804.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2013/12/x-y.problem-150x150.jpg" alt="X-Y Problem" width="150" height="150" /></a><a href="https://coolshell.cn/articles/10804.html" class="wp_rp_title">X-Y Problem</a></li><li ><a href="https://coolshell.cn/articles/22298.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2022/10/communication-150x150.png" alt="聊聊团队协同和协同工具" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22298.html" class="wp_rp_title">聊聊团队协同和协同工具</a></li><li ><a href="https://coolshell.cn/articles/22173.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2022/02/http_method-150x150.png" alt="“一把梭：REST API 全用 POST”" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22173.html" class="wp_rp_title">“一把梭：REST API 全用 POST”</a></li><li ><a href="https://coolshell.cn/articles/22157.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2022/02/monitoring-150x150.jpeg" alt="谈谈公司对员工的监控" width="150" height="150" /></a><a href="https://coolshell.cn/articles/22157.html" class="wp_rp_title">谈谈公司对员工的监控</a></li><li ><a href="https://coolshell.cn/articles/21589.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2021/07/knowledge_sharing-300x169-1-150x150.jpeg" alt="如何做一个有质量的技术分享" width="150" height="150" /></a><a href="https://coolshell.cn/articles/21589.html" class="wp_rp_title">如何做一个有质量的技术分享</a></li><li ><a href="https://coolshell.cn/articles/20977.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2020/08/programmer.01-e1596792460687-150x150.png" alt="程序员如何把控自己的职业" width="150" height="150" /></a><a href="https://coolshell.cn/articles/20977.html" class="wp_rp_title">程序员如何把控自己的职业</a></li></ul></div></div>The post <a href="https://coolshell.cn/articles/3713.html">你会问问题吗？</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></content:encoded>
					
					<wfw:commentRss>https://coolshell.cn/articles/3713.html/feed</wfw:commentRss>
			<slash:comments>39</slash:comments>
		
		
			</item>
	</channel>
</rss>
