Some of you may have noticed that I am always harping about "abstracting the problem" and "posting the smallest compilable piece of code that demonstrates a problem."

I rambled a bit about why this is important if anyone cares to read:
http://daviddoria.blogspot.com/2010/05/problem-abstraction-helping-others-help.html

Dave

Recommended Answers

All 8 Replies

It is not all black and white as I see it. Newbies generally do not know where the problem is and constructing a suitable, simple example demonstrating a problem is not easy for them. Secondly, sometimes in their endeavor to simplify things they might actually leave the important details out and we specifically ask for the exact problem statement and compiler errors rather than their interpretation.

i would prefer if the questions have a generic template, something like
a)statement explaining the problem
b)expected output
c)current output
d)inputs
e)code
f)compiler errors if present

But yes, thinking in terms of making the question more understandable is definitely important, and there is some link that gets posted once in a while giving tips on how to ask a question correctly.

This is a link to Narue's sticky on posting questions
http://www.daniweb.com/forums/thread78223.html

As far as I'm concerned this should be read by everyone who joins before the start posting.

commented: Yes. If only everyone could read simple instructions. +4

I understand what you are getting at. I agree that sometimes people dump off yards and yards of code when it's not always necessary. However, I think asking for the smallest and yet compilable code can bring about a Heisenberg-like effect.

The more the OP takes out the trickier it is to make sure that everything is declared/applied/called in the right place. The code example in your blog was designed as such, and would only match a handful of cases. One example would be where the OP knew enough to rearrange his code for the benefit of the solver but didn't know enough to catch an elementary bug.

The other danger is when the OP goes to great lengths to "summarize" the code for this purpose. All the compiler error messages essentially become invalid and additional errors can creep in. Also, if the OP doesn't really know where the error is, forcing him/her to guess can take the attention off of the real problem.

I understand what you are getting at. I agree that sometimes people dump off yards and yards of code when it's not always necessary. However, I think asking for the smallest and yet compilable code can bring about a Heisenberg-like effect.

The more the OP takes out the trickier it is to make sure that everything is declared/applied/called in the right place. The code example in your blog was designed as such, and would only match a handful of cases. One example would be where the OP knew enough to rearrange his code for the benefit of the solver but didn't know enough to catch an elementary bug.

The other danger is when the OP goes to great lengths to "summarize" the code for this purpose. All the compiler error messages essentially become invalid and additional errors can creep in. Also, if the OP doesn't really know where the error is, forcing him/her to guess can take the attention off of the real problem.

This.

Sometimes it isn't necessary to require them to add code. To the untrained eye, the debug output can throw you wildly off course. This means that they could paste entirely the wrong code anyway.

If they're here because they want help solving a thought problem. I.e. I need to create a word counter, but I don't know what to do. Then our answers will be of the sort: Look up string functions and delimiters.

Then off they toddle to do research (supposedly) and should have a go at writing something. Then they come back later and say "I tried to do it like this, but I'm getting a lot of compiler errors."

I firmly believe at this point we need the compiler output more than the entire source code.

Dumping of source code should be a last resort.

But that's just my opinion anyway :)


I firmly believe at this point we need the compiler output more than the entire source code.

I agree that the compiler output is quite valuable, but without the code it has no inherent meaning.

Dumping of source code should be a last resort.

Agreed. Especially if the OP is at a level where they can pare down the code.

But that's just my opinion anyway :)

That's the case from my end too.

I agree that the compiler output is quite valuable, but without the code it has no inherent meaning.

It gives us (as more experienced programmers) a better idea of where to look. If we get the compiler output we can then direct them to the place we think the error is. This will hopefully reduce the amount of code dump that is necessary.

In some cases it may be possible to solve with just compiler output. But in all cases it definitely serves as a starting point.

I see what you are saying, feeding back the troublesome points to the OP who references them in his/her own copy of the code. This could turn into a spoonfeeding thing very quickly. "Okay, I fixed the one error, here's the next one." (ad nauseum)

I agree, but that's where we have to step back and draw a line. Even if they post code, it makes it even more tempting to just modify it and paste it back. That way they haven't learned anything at all.

I suppose in the end it's down to us as a community to limit how much we assist as it becomes necessary. Not every question will be the same and neither will the OP's skill level and the answers the community gives should reflect that.

(But overall I agree with what you're saying, just a shame there's no general way things should be done without alienating someone)

Note: We and They refer to the Community and the OP respectively. Not high level programmers and low level programmers. I'm not THAT elitist :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.