6 ms·
> People told you to just use the string - wasn't that a good enough answer? "Don't do that" isn't a sufficient answer without explaining exactly why, though.
by orbitur 11y ago
> People told you to just use the string - wasn't that a good enough answer?
"Don't do that" isn't a sufficient answer without explaining exactly why, though. And if you aren't asking the right question, then the explanation might even seem obtuse.
- marktangotango 11y agoI can relate, in this case the op was actually hindered because he knew there are bytes behind the string. A key insight into why you shouldn't simply get the bytes is the .net char size is actually 2 byte, and the internal encoding is utf-16. Thus encoding/decoding is required, and if you haven't worked with encoding before, can be a bit confusing imo.
- lmm 11y ago"Don't do that" is the right answer when you're asking the wrong question. It's an invitation to take a step back and ask how to do what you actually want to do, at a higher level.
- amalcon 11y agoNo; the correct answer in that case is "Why are you trying to do that?"
- WalterGR 11y agoThat's what pedants do. When I was a kid learning line number BASIC, adults answered my questions knowing that I'd figure out The Right Way before anyone hired me to write the code for radiation treatment devices. The tech community's obsession with "The Five Why's" is toxic. When asking questions, you always have to first prove that you deserve an answer. It becomes a process of trying to anticipate any potential reason someone might have to argue "You're doing it wrong" - and preempt that. You can't just ask a question: you have to both ask and justify. Mostly I just don't bother, and I suspect that I'm not alone. And I have a degree and industry experience. It must be incredibly frustrating and discouraging for beginners.
- sbov 11y agoDunno. If someone asked me how to get the bytes of a string, I would ask why. Not because theres The Right Way to do things, but because they might be doing things The Hard Way. A why can reduce the amount of code written by 100%.
- derefr 11y agoSure, but when someone is first learning, frequently the true answer to "why are you doing that" is "to see what happens" (even if they have some flimsy justification within their pet-project at the time.) Giving them the answer lets them go back to experimenting so they can see, for themselves, why the path they're heading down might not be such a good idea. Formative experiences and such.
- sbov 11y agoYeah, that's a fine answer. But they might just not know of the other way to do things. Like, in Java, for a long time I didn't know there was an output stream that you could write a string directly, so I was always getting the bytes to write it. I wouldn't call that a formative experience.
- aaronbrethorst 11y agoThere is nothing inviting about someone saying "don't do that" to you. If you actually want to understand a beginner's intentions, you're a lot better off asking them what their goal is. In my experience mentoring new developers, it's much more helpful to ask "what is your goal?" instead of "don't do that."