News for hackers. Stuff that matters.
Re:How to debug small programs by brudgers on Friday March 07, 2014 @05:41AM (#7359516)
The degree to which it is acceptable to shit on students is a result of the prohibitions on laughter stackOverflow's moderators love. All the meanness and tribalism finds it's way oit and is vented upon the weakest members of the community.

Yes, students can be rude asshats. But hang around 'regex' and asshattery is no more unusual than 'SML'.

This article captures the smug prickishness that stackOverflow increasingly celebrates. JustFuckingGoogleIt was clever a decade ago. It's quick and to the point and the pain is over.

Learning to program is hard. A non-working program with a looming deadline is genuinely and legitimacy stressful. And so what does the article do? It begins by belittling the student, telling them their question was not worthy of the great community. Let's be honest, the intended audience isn't students, its other StackOverflow contributors and its purpose isn't to teach but belittle.

And that's the shame of it. A good article on debugging could be useful. Hell a teacher might even incorporate it into the class. But of course the StackOverflow community could not produce such a document. It violates their unfortunate tribal mores.

Re:How to debug small programs by MikeTaylor on Friday March 07, 2014 @05:53AM (#7359550)
"And that's the shame of it. A good article on debugging could be useful."

This is a good article on debugging. It has a lot of specific, actionable, helpful advice. I can only assume you stopped reading after first couple of paragraphs.

Re:How to debug small programs by brudgers on Friday March 07, 2014 @09:04AM (#7360209)
If I had stopped reading after a couple of paragraphs, I would not have been aware the article contained any "actionable advice." Likewise if I had stopped after 3 paragraphs or four or even five. It is only after six paragraphs of putting the student in their place - instead of just linking to StackOverflow's own prose describing good questions - that "First, turn on all compiler warnings" makes an appearance.

Is this good advice? Not really. Manipulating compiler setting is a homework task in itself for a student. What could be simpler than setting compiler warnings? It's all right here:

http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

However, there's a bit of a logical error in this method. [0] Apparently what a student is supposed to do after turning them on is return to stackOverflow and ask another question. Well at least the author recognizes that turning on compiler warnings isn't really progress toward debugging except in the sense that debugging consists of asking questions on StackOverflow.

Yet in fairness, it is hard to call this bad advice to a student struggling to finish an assignment given the next piece of "helpful advice" is:

"If your program still has a bug, obtain a rubber duck."

The reason I struggle with this being better or worse than the first piece of advice is that at least rubber ducks don't make sport of trolling students with homework questions. [1] According to the article, obtaining a rubber duck will allow the student's code to compile. All that's left is to refactor, write some tests, and a specification. Wasn't that helpful? Someonw has already made and posted a video presentation of the method. [2]

[0] OK, it's not really a logical error, it's just a way to keep the victims coming back for more. See next footnote.

[1] http://codegolf.stackexchange.com/questions/16226/i-need-a-p...

[2] https://www.youtube.com/watch?v=tNfGyIW7aHM

Re:How to debug small programs by ds9 on Friday March 07, 2014 @09:35AM (#7360402)
I actually think the article has some value (rubber ducking is good :), but continuing the parent's line of criticism: "Now step through the code using a debugger".

That's all he says about that! Even for experienced developers, and depending on the language, editor and other factors, installing and configuring a debugger is often non-trivial. In fact setting up a working environment is a whole other adventure for a newbie, and a different set of knowledge and skills than programming. Yet this author merely recommends the debugger without giving clues.

Of course he can't give directions for every situation, but recognizing the big leap in the advice would be more considerate of the intended audience.

Re:How to debug small programs by brudgers on Friday March 07, 2014 @09:59AM (#7360541)
Rubber Ducking is good for someone who writes code all day all year. It's something a person can do if they aren't struggling with syntax and logic and EMACS shortcuts while under a short deadline while having no team for support.

I suspect most students wind up at StackOverflow via websearch. Their background is writing text messages and formulating good questions conforming to StackOverflow's style guide is a skill unto itself. Most programming education is sink or swim. It doesn't start with writing tests and specs - let alone learning to use a debugger (call stacks are part of data structures and algorithms courses not introductory programming classes).

The people who have more of it right than anyone are the PLT group. Their curriculum is not designed to weed out the weak. It optimizes on preventing false negatives rather than false positives. It's not as if there is a scarcity of computational resources any more.

Likewise, it's not like StackOverflow will run through its supply of webpages unless students are actively discouraged and abused. It is only because a focus on preventing false positives ego strokes those who have been identified as positive, that the practice sees so much love at StackOverflow. There's a back button on the browser for anyone who doesn't like helping students with homework. The site would be better if using it was the preferred behaviour.

Re:How to debug small programs by stonemetal on Friday March 07, 2014 @11:19AM (#7361049)
Your average CS computer lab is Windows or OSX with an IDE already installed, use the debugger is asking them to click a button not install GDB from source.
Re:How to debug small programs by maaaats on Friday March 07, 2014 @07:57AM (#7359907)
>> This article captures the smug prickishness that stackOverflow increasingly celebrates.

How is the article smug? To me, it comes with good tips for beginners on how to approach a problem and solve it effectively without having to wait for hours on random people on the internet.

>> And so what does the article do? It begins by belittling the student

How does the article belittle the student?

>> telling them their question was not worthy of the great community

Should HN allow everyone to post whatever they want, or should new users rather learn the rules, scope of the site etc.? This is called basic moderation.

>> Let's be honest, the intended audience isn't students, its other StackOverflow contributors and its purpose isn't to teach but belittle.

No, it's not. It's to have a good source one can point beginners to in the future. Good for them, good for SO.

>> A good article on debugging could be useful.

This article is good for beginners. You are just so biased and full of hatred for anything mentioning SO that you're not seeing straight.

Re:How to debug small programs by DanielStraight on Friday March 07, 2014 @09:41AM (#7360436)
Really, I think the issue is that StackOverflow isn't what it appears to be. When you visit StackOverflow, all your instincts tell you it's a place where you can ask any question and discuss the answer with people who are interested in the question, like on a message board (or the abysmal Yahoo Answers). Really, StackOverflow is more like a crowd-sourced FAQ for programming. It's a wiki, a reference document, not a discussion board. That's why they don't like non-specific or duplicate questions. Non-specific and duplicate questions aren't helpful in a FAQ. That's why they don't like humor. You wouldn't put humor on Wikipedia.

The other problem is that StackOverflow is fairly static after the initial answering period on a question, so they can't even have questions which compare programming languages or databases or such, because those answers will change and no one is going to come back and update the information on the question page. But information does get updated on wikis. So even though StackOverflow is essentially functioning as a wiki, it doesn't present the affordances of a wiki, so people don't keep pages up-to-date like they would on a wiki.

Notice that the way a non-participating StackOverflow user uses the site is exactly the same way a non-participating Wikipedia user uses the site. You search for something, the StackOverflow question or Wikipedia article comes up as the first result. You click it, get the information you need, and leave.

StackOverflow is a wiki-FAQ for programming posing as a discussion board.

(And just like on Wikipedia, I don't participate on StackOverflow because I expect anything I ask to be closed for one reason or another just like I expect anything I add to Wikipedia to be deleted for one reason or another.)

Re:How to debug small programs by darklajid on Friday March 07, 2014 @06:23AM (#7359639)
Are you aware of the author's work?

Eric Lippert isn't a random SO lover and writes lots and lots of helpful articles. I consider this one helpful as well. The advice is good. You focus on the "so SO closed your question" part and seem to ignore the meat of the article?

Re:How to debug small programs by brudgers on Friday March 07, 2014 @09:21AM (#7360307)
I recognized the name as familiar when I saw it, but until reading his "about me" didn't connect it up with his role in C#. What stands out to me, is that the tribalism of StackOverflow is so rampant that its noxious treatment of students flows so naturally into the writing of someone like Lippert. The tragedy is that within the standards of the StackOverflow community [1], mere condescension and RTFCM ['C' is for "compiler"] has a claim to being helpful.

Could Lippert write an article truly helpful for students? Almost certainly, but this is not it. Such an article can't be written from a starting point of holding students in contempt, and that's part and parcel of the tribal mores at StackOverflow.

My advice would be to follow his own advice and teach a rubber duck to debug. Or better still a rubber duck's 15 year old daughter sitting in a Nairobi internet cafe writing code on her cell phone.

Re:How to debug small programs by darklajid on Friday March 07, 2014 @04:31PM (#7362857)
I'm not sure I follow. Disclaimers aside: Eric Lippert is for me on the same level as Raymond Chen. An amazing source into Microsoft's world - and yes I know that Eric isn't working there anymore).

Your reply again seems to fight SO. I get the feeling you use this article to further your cause, to prove that SO is bad. I've got no stake in that conflict, my SO account is ancient and I'm mostly a reader for years.

I don't believe Eric meant to belittle people and I think your impression is .. a lot more negative than it should be.

Last but not least: If a rubber duck's 15 year old daughter (Hey, at this point I could turn around and ask you why the example character is female and turn this into a different type of mud-slinging contest) sitting in Nairobi (why Africa?) would type code on her cell phone and it didn't work right away, SO really isn't the answer.

You might not like it, but generic "Hey, so I wrote this stuff and it doesn't really work" sort of questions aren't deemed acceptable. Mistaking a QA site with (more and more) strict guidelines for a generic place to call for help and coming up with an example that feels like a call of "think of the (african, female) children)" won't help. This is the wrong place and judging people for these guidelines is .. weird.

There might be a need for a place where your fictional characters should be able to ask for help and get real support. I wouldn't know and I can only imagine that it would be hell to try to help out.

All of that is totally irrelevant for the article at hand though. Eric teaches people to fish, you seem to argue that he'd (we'd?) hand out the meals instead.

Re:How to debug small programs by ericlippert on Wednesday March 19, 2014 @02:20PM (#7430670)
I do not hold students in contempt. My article is an honest attempt to help students, because, as I note in the first few paragraphs that you object to, their current course of action is one that is not helping themselves.

When I was a CS student at Waterloo, no one taught us how to debug small programs. Maybe things have changed since then, but at the time this was just a skill you were expected to pick up for yourself. I remember many times coming into the lab early in the morning and finding my fellow students asleep on their keyboards, having stayed up all night trying to find a bug in a 20 line program.

If you don't like my article then that's too bad; my suggestion to you is rather than complaining about it, why not write your own that you like better? I'd be happy to publish a link to it.

Re:How to debug small programs by ericlippert on Wednesday March 19, 2014 @05:33PM (#7432038)
On a more personal note, I'll add that I find it ironic that you accuse me of meanness, contempt and belittling others, because I find that rather mean, contemptuous and belittling.

In the future if you have a problem with something that someone has written on the Internet, why not contact them and have a civil conversation about it? It's not like I'm hard to get ahold of.

If in the future you do that, you might find that you've misunderstood the motivation of the article you find so objectionable. And the author might find out from you that they could communicate their point in a better way. The world would get better all around, and that could all happen without resorting to profanity and name-calling in a public forum.

Re:How to debug small programs by ZoFreX on Friday March 07, 2014 @07:03AM (#7359742)
> StackOverflow is not about to debug your programs for you.

Could not disagree more. Students: submit your homework to StackOverflow. You'll get yelled at, but someone will be desperate enough for imaginary internet points that they will give you an answer regardless (just make sure you keep your accept rate high enough).

(NB: This is facetious. I don't condone submitting your homework to StackOverflow: You won't learn that way.)

Re:How to debug small programs by jwdunne on Friday March 07, 2014 @07:20AM (#7359795)
LOL you think this is bad and StackOverflow has it hard?

I founded a number if groups on Facebook a few years ago and they're primarily a QA sort of community, like SO but purely on FB. We don't just get the "help me find the error questions" but also:

- have u got free PDF for <expensive book> - please give me code for <trivial project> (often be explicit that its a student project) - what programming language should I learn? (Often its java or PHP. I literally know one guy who has been trying to decide for 3 fucking years)

Sometimes I will get "I am just 2 gud at java coding" and also group/page spam.

Sometimes questions like the above, especially the free pirated PDFs! Can't believe people would be rude enough to try and throw all my hard work over the years down the pan because they don't want to pay for education.

I don't make money from this. Nor has it improved my career prospects. How dies StackOverflow sound now?

Re:How to debug small programs by brudgers on Friday March 07, 2014 @09:45AM (#7360460)
Why the fuck should anyone at StackOverflow give a shit if, when, or how someone cheats on their homework?

The answer is simple. Every building has a side where the dumpster goes. Crapping on students is StackOverflow's. Because it's the only officially sanctioned form of meanness on the site, that's where the venom flows. It is StackOverflow's culture which makes submitting homework questions a poor way to learn. Pair programming and mentoring are excellent pedagogical techniques.

Homework questions don't reflect any more laziness than any other category of StackOverflow questions. Indeed it might be the case that fewer homework questions can be answered by Googling than questions about EMACS. I know, because I've answered both and homework questions tend to require solving a logical puzzle not just RTFM'ing.

I learned a great deal from answering homework questions because that's about my level of expertise (just like Googling EMACS questions is). The internet points I earned are the same color as everyone else's - a shade of earnest helpfulness colored by the need to be loved.

Students wind up at StackOverflow because that's where the search engines take them. A student can't avoid landing there as part of making an honest effort to solve the problem. Getting rid of students is simple, stop SEO and prohibit crawling bots. Notice how HN doesn't have a problem?

The behaviour of StackOverflow's community toward students is simply a function of nothing better to serve as the other. It's the petty gatekeeping of a medieval guild. It has all the merit of kicking puppies.

(This is facetious. I don't condone kicking puppies)

Re:How to debug small programs by unwind on Friday March 07, 2014 @04:23AM (#7359252)
This is great, both as actual content and advice to (beginner) programmers but also as "link-bait" in the best sense of the word, i.e. content that is very likely to gather a lot of inbound links.

As a very active Stack Overflow user, I immediately start thinking about how many questions that are going to get links to this as comments. :)

Well done, I hope it helps although I guess the supply of beginner programmers won't dry up over night.

Re:How to debug small programs by mopedDreams on Friday March 07, 2014 @07:32AM (#7359837)
Print("If you're reading this, that means the program got to this point!")
Re:How to debug small programs by cooper12 on Friday March 07, 2014 @09:27AM (#7360351)
Yep. This can be very useful. You could even print out the values of variables at certain points. It become less useful though as the output of the program increases, or as your program becomes more complex. that's when the things mentioned in the OP are helpful.
Re:How to debug small programs by collyw on Friday March 07, 2014 @05:36AM (#7359500)
Turn on all compiler warnings. Read them carefully.

I wish my end users would actually read the error messages at all.

Re:How to debug small programs by userbinator on Friday March 07, 2014 @05:26AM (#7359479)
That is a rather long way of saying "figure out exactly what the program is doing, and whether it matches what you think it should be doing."
Re:How to debug small programs by moistgorilla on Friday March 07, 2014 @06:45AM (#7359701)
Some people need this sort of explanation.
Re:How to debug small programs by oneeyedpigeon on Friday March 07, 2014 @04:05AM (#7359201)
that link points to a google ad at the bottom of the page ...