In my opinion, if you are writing pseudo-code in an answer, then you should probably take a moment to ask yourself - is this question too broad?. Good questions almost always show sample code, that way, you can build on top of the OP's code when you answer. A question that requires you to write complete (pseudo)code in your answer is almost always unfit to be on SO. Remember, SO is not for general questions and answers.
We almost always expect the OP to specify the language being used when he / she posts a question. Under usual circumstances we don't want generic answers. What the OP (and other programmers who look at the post) usually want is an answer that is specific to the language being used. Personally, I would not go to the PHP tag and look for an answer if I am using Java (even if an answer exists there). I would probably ask the same question in the Java tag (and it would be incorrect to mark it as a duplicate of the PHP one).
Lets take an example :
....
Store data in Map1
Replace all digits in yourString with 0.
Add ourString to a List.
Read input from file X and store it into a String array.
...
Several questions could come up that could determine whether your code would work or not. Assuming you are using Java.
- Which Map implementation should I use?
- Should I use replace or replaceAll?
- Which List implementation?
- Should I use Scanner or BufferedReader + FileReader or Files.readAllLines()?
If something is incorrectly assumed in the pseudo code, then the entire code might break (what if you make assumptions that a data structure is mutable but in the OP's language it is not? Or what if a data structure that you use doesn't exist in the OP's language?). Now, we know that pseudocode is not language specific but that doesn't mean that we cannot hit a brick wall when implementing it in a given language.
Does that mean, I always have to write answers that contain code?
No. But you could write something that is language specific.
For example :
....
Create a LinkedHashMap and store data in it.
Replace all digits in yourString with 0 using String#replaceAll()
Add ourString to a LinkedList
Read input from file X and store it into a String array using Files.readAllLines()
Parse Strings as Integers using Integer.parseInt()
...
This way, your answer will still be helpful to a lot of people looking to solve this problem in java.
Finally,
For this question (and others) is this bad practice on SO?
It is not always bad, but I think it would be better to stay away from posting such answers.