On Stack Overflow, I see a lot of people answering questions with just code. It is not helpful to anyone at all. So, would it be possible to enforce pseudo-code answers? In my opinion, pseudo-code is pretty self-explanatory. Code without any explanation is neither helpful nor informative and no one learns from it.

To all the downvoters: this is not a duplicate question. I wanted to start a discussion about code in answers because it doesn't help the questioner to learn. They just copy and paste. Pseudo-code would encourage them to do research and learn from it.

While the other question use different approach, the answers there perfectly fit to this question as well.
–
Shadow WizardMar 3 '13 at 8:19

The code in words instead of writing it in an actual programming language with methods and etc.
–
khudermMar 3 '13 at 8:19

@ShaWizDowArd I don't think so. I did read that discussion. Over there, they talk about the code. My idea is to eliminate actual working code from answers and replace it with sudo code.
–
khudermMar 3 '13 at 8:21

@ShaWizDowArd lol what version of google are you using? It returns over 6M results for me
–
khudermMar 3 '13 at 8:29

6

Nonono. If the problem is code-only answers with no explanation, pseudo-code doesn't fix it. It's possible to write an unhelpful pseudo-code only answer. The problem is the lack of explanation, not the presence of code.
–
AndrewCMar 3 '13 at 8:31

2 Answers
2

The merits or demerits of a code-only answer is a different matter. But constraining answers to pseudocode would detract from a large majority of answers and add little or no value.

Most importantly (in my opinion), the ability to get a specific answer to a specific question would be lost. Sometimes even experienced developers want to be able to cut-and-paste a useful snippet of code that--from reading it--they determine will suit their needs.

Requiring people to translate every solution would be completely counterproductive.

Taking it a step further, I can't imagine any practical use for pseudocode to abstract a stylesheet language like CSS, markup languages, CIL dumps/explanations, etc.

I think the better discussions (which have already been had) are around what constitutes a properly explained answer, and when it's better to give guidance (to encourage learning) instead of an exact answer.
–
Tim MedoraMar 3 '13 at 8:47

I was reading through those discussions and I didn't really see a solution to those kind of answers. I guess downvotes on those answers will have to do.
–
khudermMar 3 '13 at 8:50

1

For better or worse, I think the answer is often "it depends". It's probably why your proposition to force pseudocode met with such resistance. FWIW, I often list out the logical parts of my answer so that the reader can 1) better understand my code and 2) choose to change the actual implementation.
–
Tim MedoraMar 3 '13 at 8:52

First of all I do not like limitations on how someone answers and tries to give help. If he likes to answer with code, with text, with pseudo code, with images, with whatever he believes can be best for all, then let him do it. Why should we limit him?

If the answer is not good, or does not help, then we have the vote system.

Now, if the person who asks the question likes to learn or not from the answer, is his/her responsibility, not ours. And many answers are not always useful. Also many people ask questions but they are not willing to hear the answer. Even if I have sometimes given code which is guaranteed to work, they argue with me just because they do not understand it – or because they have some other answer in their head and did not like to change that.

Now pseudo-code is one language by itself, but with no strict rules, and this means that everyone can write in their own style, making it difficult to understand and translate. It also makes it difficult to write it because we do not use it as out daily base language.

Also is not useful on the search machines, because users actually search for a function that throws exceptions, and maybe some of them can be on the question, but some other on the answer.

Now, I search a lot for many things on SO, many simple ones, like how to find if a check box is checked with jQuery. A simple call which I just do not remember some times. Some days with hundreds of lines of new code, my mind stops, so I need to see the code fast.

Google "jquery checked is checked" and find .is(':checked')

How that can be pseudo code, and if he can, then is not useful to me and I go way.

At the end, I do some time use pseudo code, but only on paper and only when I design stuff. I do it for me, or for people that are close to me, and if the do not understand it, they have me nearby to explain it. It is not useful after a week that I forget the design – it is useful only for the time when I have the design in my head and write it down on paper before I make it an actually working code. (At least for me)