找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1423|回复: 0

[建议] 提问前需搞清XY问题,提高交流效率

[复制链接]
100 分钢镚 回复本帖可获得 1 分钢镚奖励! 每人限 1 次(中奖概率 70%)
epiman 发表于 2024-7-22 23:55:18 | 显示全部楼层 |阅读模式

注册后推荐绑定QQ,之后方才可以使用下方的“用QQ帐号登录”。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
什么是XY问题?3 [; ^% ]- k7 Z" l1 F6 U

( e6 R% X  Z: g( aXY问题是关于正在尝试的解决方案,而不是实际的问题。无论是对于寻求帮助的一方,还是提供帮助的一方,这都会造成大量时间、精力的浪费。3 c+ l. W3 F+ Z' J4 v+ k( o7 M3 r

! I7 r4 ?! E+ c
  • 用户想做X。
  •     用户不知道怎么做X,但觉得如果能做到Y,就能摸索出解决方案。
  •     用户也不知道怎么做Y。
  •     用户请求对问题Y的帮助。
  •     其他人试图帮助用户解决Y,但却感到困惑,因为尝试解决Y似乎是个奇怪的问题。
  •     经过大量互动和浪费的时间后,终于发现用户其实需要X方面的帮助,而Y甚至不是对X的合适解决方案。: I  i6 V& ^: o

8 f# w; S2 G% b& y/ `1 F- P当人们被自认为的解决方案卡住,无法退一步完整解释问题时,问题就出现了。, [" {( M2 P( i9 q6 B6 o8 n6 `1 r
/ }! o! q1 r5 M6 ?
示例
9 o0 ]9 E2 X" K( \1 J6 I' D4 s* G+ x, v+ A& `. G
示例1
2 x$ \' l$ \& n& p  G, M5 i4 K8 X4 qn00b实际上不想要文件名中的最后3个字符,而是想要获取文件扩展名,为什么要问最后3个字符?. x& H% E/ t! i+ s7 y
  1. <n00b> How can I echo the last three characters in a filename?8 y8 ^: ~, q* o1 k7 [/ d
  2. <feline> If they're in a variable: echo ${foo: -3}
    ) B0 \5 r& B- d  k5 D
  3. <feline> Why 3 characters? What do you REALLY want?6 g& Q, Y6 V) V% t0 Y: \3 Y
  4. <feline> Do you want the extension?  j6 j' r, n' P* u' e. w
  5. <n00b> Yes.
    + e2 k3 W) ]" Z; }6 D$ i5 t5 b
  6. <feline> There's no guarantee that every filename will have a three-letter extension,
    / x0 \+ }4 X9 S
  7. <feline> so blindly grabbing three characters does not solve the problem.$ U6 r/ Q4 h* I) H7 y$ N9 ~6 U$ |
  8. <feline> echo ${foo##*.}
复制代码

$ `5 W8 s) _* W7 M" h: V示例2
( S7 ?( \- G0 f, p% ]如果Angela一开始就解释她想防止别人发现她的操作系统,可能讨论会更短、更有成效。
2 ~* i! j% d$ Y: \
  1. Angela: 'nmap -O -A 127.0.0.1' returns some lines starting with 'OS:'. How to change it?
    # a# t" F4 i+ ^5 c# T5 y3 a  z
  2. Obama: Look in the sourcecode for nmap, find how it figures out the Linux part, then rewrite your TCP/IP stack to not operate in a way nmap can detect.5 ]" J$ n0 {* I; _. ^9 X+ G* {
  3. Angela: Yeah, but I don't know about linux system api at all.
    ' I$ y! j9 n# Q0 C$ C( a/ S
  4. Obama: Well, nmap's fingerprint is based on the way the TCP/IP stack works, there's no real way except to rewrite the appropriate parts of said stack.
    9 U5 U# ^/ d% \
  5. Angela: I really need to avoid these messages. Can iptables do this work?
    + H7 [6 k  L: D0 Y' F  Q4 X2 U
  6. Obama: Well, don't use OS detection or version scanning( H6 ?  s0 Q* |( p/ m0 U2 h1 ?- F: x
  7. Angela: I want to prevent others from knowing the type of my OS
复制代码
中文出处:https://segmentfault.com/a/1190000044541188
5 }7 K! Y5 ?3 a( b英文出处:https://xyproblem.info/
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

改名|钢镚|会员|联系我们|公卫人 ( 沪ICP备06060850号-3|沪公网安备31010402334125号 )

GMT+8, 2025-8-17 00:42 , Processed in 0.050832 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表