3 ms·
Sometimes the asker is wrong in what they’re asking, or barking up the wrong tree. In the example you give, unless the C++ Standard Library has changed since I
by eschaton 8y ago
Sometimes the asker is wrong in what they’re asking, or barking up the wrong tree. In the example you give, unless the C++ Standard Library has changed since I last used it a number of years ago, a strict interpretation of your question gives the answer “You can’t;” the person suggesting Boost was trying to be helpful without calling you out as asking an unreasonable question.
The person asking a technical question should always include the goal they’re actually trying to achieve, not just the technical step they think they need to accomplish to get there. Otherwise they won’t actually get the best help possible.
- vortico 8y agoThere are two correct answers: Use std::filesystem on C++17, or rename() on POSIX and MoveFileExW() on Windows (which are what boost::filesystem calls internally). These answers are correct because they answer the question literally, and someone can extract accurate, useful information from it. If there was no correct answer, the answer should be "you can't" from someone confident enough to make that claim. I agree that it is good for the asker to somewhat demonstrate that their question is asked correctly to avoid the XY Problem, but more times than not, the reason they're trying to achieve something in the way they ask it is so incredibly boring, it does nothing but distract from the original question. For example, "I need to rename a file and I'm writing a C++ project for my boss, and we need to distribute this package on a cluster managed by an external IT team that runs a build script on our code that pulls everything from a proxy, where each file needs to be approved by another team, and this needs to take place as quickly as possible because the machines are wiped weekly and someone needs to monitor the build process, so it makes everyone's lives easier if we don't pull in libraries, blah blah blah." It's 100x easier to just say "I need to rename a file on C++. Constraints: no libraries". When I see a question phrased this way, I can empathize exactly why, because the asker has an encyclopedia of information behind the question that I don't know (or want to know), and they have kindly phrased it as concisely as possible for an expert to quickly help them. I'm just saying that I try very hard to avoid answering questions like "I want to do X without Y" with simply "do Y", because as much as I think I might be helping them by showing them their question is "wrong", I'm not. I just waste their time making them explain the reasons behind their constaints.