-20

Here's question I just voted to close. After seeing the video below I thought maybe I was wrong to vote to close.

This talk from Strange Loop suggests that making people figure out things on their own is not actually an effective way of learning to program.

I have no idea if it's true or if the methodology is valid but in the talk they basically claimed

  • many devs are self taught
  • those devs feel like everyone else should learn by teach themselves
  • lots of classes/clubs expect students to self teach/self explore and just get feedback on their issues from the teacher
  • in contrast to all of that, research shows that giving the answers is the best way to learn

From the video

enter image description here

  • Group A: was the group asked to figure things out
  • Group B: shown solutions, and asked to use them in problems
  • Group C: shown solutions

(A) did worse than (B) and (C). (B) and (C) did equally well.

It's possible I misinterpreted the message. It's also possible the message is wrong.

But, if it correct then it seems like the standard response to "give me teh codez" question which is usually some form of "show us what you tried" is actually not the best way to help. The best way to help, according to the research referenced in this video, is to show working examples of good solutions.

Sure some people will just copy and paste but many will apparently learn by example. I know much of my own knowledge comes from being taught the solution (examples include sorting algorithms, 3D projection, file io, etc). I didn't "figure it out" unless "figure it out" means search for a working example.

NOTE: I'll distinguish between 2 kinds of "give me teh codez" questions

  1. Algorithm / interview problem type questions

    answer is usually 5 to 20 lines of code)

  2. Write my app for me.

    answer would be a 100s or 1000s of lines.

Clearly 2 is not a fit for S.O. The question is more of is #1 a question for S.O. without showing work. Questions like "How do I loop through an array from the ends to the middle?" without showing any work.

38
  • 4
    I'm not sure what is being asked here but it sounds like you're suggesting theres nothing wrong with "give me the codes"? "we are trying to build something that benefits the world at large, not just the one person having the problem." (source)
    – Sayse
    Commented Jan 7, 2020 at 10:37
  • 10
    This is all nice and dandy, but so what? We gonna provide everyone with individualised code now and not close as duplicate and/or entertain any and all questions no matter how badly asked?
    – deceze Mod
    Commented Jan 7, 2020 at 10:45
  • 6
    You should incorporate that kind of example as context into your proposal. I'm on the fence about those kinds of questions… yes, they're eminently answerable, but… I mean… come on, it's pretty darn trivial. Where exactly do we draw the line between that and just being Mechanical Turk for Programmers? OP of that question should at least have been more detailed about what part of that simple problem they're stuck with exactly.
    – deceze Mod
    Commented Jan 7, 2020 at 10:55
  • 6
    Question you linked is fine example why are "give me teh codez" questions bad. If such question gets guided explanation, from explaining the algorithm to explanations of written code, then you can learn something from such Q/A and it can be useful to others. But when people ask simple question and code, most of the time they get just that, few lines of code and nothing else. Nothing to learn here except copy pasting some piece of code you don't understand. Nothing useful for others with slightly different requirements.
    – Dalija Prasnikar Mod
    Commented Jan 7, 2020 at 10:58
  • 14
    I have no teacher training, no teacher's union card, no teacher's salary, no prof tenure. I am not qualified to teach 'Computers 101'. I don't want to teach 'Computers 101'. Don't ask me to teach 'Computers 101'. Commented Jan 7, 2020 at 11:01
  • 5
    So we're back to the age-old debate: where do we draw the lower boundary? SO has always been a site for professional and enthusiast programmers. How experienced do we expect you to be to qualify at least as "enthusiast"…?
    – deceze Mod
    Commented Jan 7, 2020 at 11:03
  • 12
    There is a large and annoying herd of cucumbers on SO: those who will immediately answer '101' questions for internet points, even though the questions are pan-galactic gargle duplicates. I don't follow that herd. Commented Jan 7, 2020 at 11:14
  • 2
    @deceze I agree! Sometimes the pure satisfaction of having helped a stranger is worth so much more than the (likely no more than +35, if that) reputation. Does that philosophy go against the "Principles of the Founders?" Commented Jan 7, 2020 at 12:35
  • 4
    With the added graphic: the crucial part there seems to be the explanation, right? Well… we hardly see really good explanations in answers to those kinds of questions, so… 🤷‍♂️
    – deceze Mod
    Commented Jan 7, 2020 at 13:03
  • 10
    And how is this research is applicable to SO? This is not a university nor place to LEARN as such. This is place to find answers to particular problems you are unable to solve on your own... there is a whole Internet full of examples out there... people are hardly "on their own"... it is just they need to look around and try to actually solve the problem before dumping the question here without doing anything before asking. What kind of developers are we here to educate? Ones that expect to be spoon feed every step of the way, or ones that will be able to tackle problems on their own.
    – Dalija Prasnikar Mod
    Commented Jan 7, 2020 at 13:20
  • 5
    @AdrianMole I have seen students (even high school students) asking good questions. But they did their research and they managed to explain what is their problem. What they don't understand. When you have such narrow scoped, question with proper problem statement, even if it may seem trivial, it will be useful Q/A (unless it is a exact duplicate)
    – Dalija Prasnikar Mod
    Commented Jan 7, 2020 at 13:45
  • 2
    @Adrian I don't disagree with that, there's clearly a demand for it. But I think SO's existing model doesn't fit that. We'd need something closer to a traditional forum, or Reddit, where information ages away at some point. SO strives to be canonical before anything, and it's what's made it what it is; helping individuals one by one is not that and would only clutter up the site.
    – deceze Mod
    Commented Jan 7, 2020 at 13:47
  • 7
    @Adrian That's the thing, SO's primary goal is diametrically opposed to "helping everybody" (at least individually), so help must be "denied" to some people. Always has been. Arguably that's why it's useful to a lot of people instead of individual people. How tenable that original mission statement is these days is very debatable though, and we simply don't know what exactly would happen if we changed it to something else (though we've been guesstimating since forever).
    – deceze Mod
    Commented Jan 7, 2020 at 13:52
  • 2
    @Dalija Yes, especially if a good explanation is the crucial factor that makes answers really useful, the bottleneck to be able to provide that is simply manpower. There aren't many people that are willing or able to provide really good explanations, much less so consistently over a long period of time. People able to provide that should only ever have to deal with well-asked questions which help the most people possible. But the reality is that one is mainly busy with digging through trash. And the reason for that is that people are unwilling or unable to write "altruistic questions".
    – deceze Mod
    Commented Jan 7, 2020 at 14:02
  • 3
    @Adrian Absolutely. Sometimes the most basic question spawns the best and broadly applicable answers. But there's a very fine line between a simple problem and a basic question well asked. And unfortunately often one gets mistaken for the other, likely simply through fatigue due to the number of bad posts…
    – deceze Mod
    Commented Jan 7, 2020 at 14:05

5 Answers 5

28

Many "give-me-teh-codez" questions are perfectly fine with our rules.

"How-to" questions are on-topic, and do not necessarily require the asker to post their "prior efforts".

What they need to be is adequately scoped so they can be answered. Without proper scoping and context, many of such questions can easily fit into "too broad", "unclear" or even "opinion based" buckets.

With sufficient scoping, many of these are also closable, but as dupes. Which is still helpful to the asker (and future users).

Regarding the example you link to, at the very least it would benefit from an edit to clarify matters.

  • What part of problem statement the are they having issues with?
  • Do they know how to iterate an array at all?
  • Or how to write any kind of loop flow-control structure?
  • Or how to count how many elements an array has?
  • Or even how to log to the console?

etc.

That's what "prior efforts" many time give you: sufficient context and scope to understand what the asker really needs. If they are having problem with all of the above, the question is too broad. If they are having problems with only one part, it would be a dupe.

(Or maybe their attempts show you they really know how to cope with their issue, but are actually dealing with a typo or something like that; that happens all too often as well and it is fine: help the user, close/delete question, move on).

While "what have you tried so far" comments are not great, they are useful to help the user bring their actual problem into focus, and to see exactly what's the best course of action for the question.

Also, the objective is (or at least was) to build a library of high-quality questions and answers, not to mentor each asker on a personal bases. In that regard, "new research" into teaching effectiveness is moot for the site's purposes.

3
  • So then what's your opinion on this question. The scope is small. The answer would be 2-4 lines max.
    – user128511
    Commented Jan 7, 2020 at 10:55
  • 2
    I can't find the post now, but I remember someone suggesting that all debugging questions are actually how-to questions in disguise, and that the "show what you've tried" requests are mainly to get the OP out of the "Debug this for me" mindset and instead ask "Why does this statement do x, and how to make it do y?" which tailors to the same adequate scoping you're taking about.
    – Davy M
    Commented Jan 7, 2020 at 20:23
  • @gman There should be a dupe target for that on how to iterate backwards. Commented Jan 8, 2020 at 22:39
17

Sadly, the questions with code are often worse than those without. Many 'this code does not work' questions are from users with next-to-zero software skills or knowledge: its obvious that they did not author the code they posted, and did not undertake even the most obvious debugging steps, (e.g. printing out a loop counter), because they have no clue how to.

In fact, it is not unknown for code to be posted that is merely a pro-forma outline as handed out by prof, or even code completely unrelated to the task described, in an attempt to con the naive drones into doing all their work for them while giving the appearance of 'posting a code attempt'.

So, given that the code is often not worth reading anyway, I have no objection to 'simple algorithm' questions, though I would probably downvote code-only answers to such.

2
  • 6
    Code or no code, there is just way too many poor questions... I would say that main issue is having good problem statement and narrow scope of the question.
    – Dalija Prasnikar Mod
    Commented Jan 7, 2020 at 11:37
  • 1
    @DalijaPrasnikar absolutely!! therefore I've started including according remarks to my answers or comments if I like the overall scope and direction of the question: which problem are you going to solve? what are business requirements or other motivation? Many of us including myself think too often in solutions without taking time to assess the problem. Commented Jan 7, 2020 at 12:21
9

@gman, thank you for your thought-provoking question, one that you've posted in a non-judgemental and educational way. I want to add that there may be a social/psychological context to this question as well, somewhat analogous to that of organ donation:

While research studies have shown that patients with end-stage alcoholic cirrhosis often do well post-liver transplant and that alcohol abstinence prior to transplant is only a weak predictor of post-transplant recidivism, it is a hard requirement prior to a patient's being listed for transplantation. One of the main motivations for this has less to do with medical outcomes research and more to do with continuing to encourage the general population to donate a valuable resource -- to agree to organ donation, the thinking being, "why should I give someone my liver who destroyed their own through moral weakness". Now mind you, I'm not saying that I agree with this thinking -- just that it does exist and must be accounted for since the rate-limiting factor for liver transplantations is the shortage of donor livers.

Similarly, this site offers a service that is dependent upon a volunteer's willingness to donate a valuable resource, that being their time, effort and knowledge in an effort to answer a service consumer's questions. My own bias is that if we encourage questions that show minimal to no effort, many contributors to the site may lose interest in helping to improve it.

Of course, this answer depends entirely on what are the limiting factors for site success (which depends on what metric are used to define success) and how much this success depends on retaining the sub-set of site members noted above who may be committed to providing answers. I don't know the answers to this.

8

The purpose of having people attempt the problem first is to weed out trivial issues, encourage refinement of the question before posting and to prevent questions from those who just want others to do the work for them (and aren't actually interested in learning anyway).

Now, some may argue that this doesn't actually work in practice, but it will work for some and we may never see what has been prevented by it so it is difficult to evaluate.

The point about people learning better when they are given explanations is obvious. In the context of a learning programme, this will also be linked to the structure and pacing of the learning. New concepts will be built upon older ones to reinforce and stretch existing knowledge that can be relied upon to exist.

The scope of an answer here shouldn't include primers on basic concepts and you can't be sure what pre-existing knowledge readers have. If the readers do not have enough base knowledge an explanation won't be very useful and perhaps will lead to confusion. It is reasonable to expect that the readers will seek help elsewhere if they can't understand the solution. Perhaps they will misunderstand the solution and blindly implement it in inappropriate situations but that is their responsibility.

4

I would approach this problem not from your side "What is the most effective way for people to learn from my answers?" But from the other side: "How likely is it that people will effectively learn from my answers?"

The issue I run into with many "give me teh codez" questions is that these users do not come here to learn in the first place. They often have been given a task then cannot be bothered doing, or came up with an idea they just want to see working, without having to put in the effort.

These users will put a question here in the hope some poor schmuck will actually do the work for them (before they get downvoted into oblivion and closed), and go away happy making money off of your hard work.

Another issue I run into quite a bit is what @yivi points out as well: The user obviously lacks the base knowledge to understand and learn from the answer. When given "Teh Codez" they will post endless follow up questions like "what does X do", "How do I apply this to Y project." Or reply with the dreaded "It doesn't work", because they cannot seem to figure out how to correctly modify that one small local reference you helpfully named "Modify_me_to_your_specific_needs_please". These users do want to learn, but have obviously picked the wrong place to start. As controversial as it may sound: Stackoverflow is a site to answer programming questions, not to provide a full course on a programming language.

Both these groups will go to great lengths for you to do all the work for them, but won't actually (be able to) learn from the answer. And most of the answers you provide them are unlikely to help anyone else on this site. They will often be very specific niche problems. Or will often not generate much traffic. Most also have horrible titles so are very unlikely to be found by anyone else searching for the same issue.

These groups are possibly not the ones you think of group "C" in your question, but are definitely a (large) part of it. Therefore I find it no more than fair to request at least the slightest bit of effort or research from their part. This will show they are willing and capable to work and/or to learn, and will help you to tailor your answer to their specific level with the amount of explaining you include.

Please note that I am not saying these groups should be chased off this website. When their behaviour is pointed out they might agree and change their ways, actually becoming valued users of this site. But this is very unlikely when you just indulge them with whatever answer they so require.

You must log in to answer this question.