6

I've noticed that a lot of homework questions asked about on Stack Overflow, particularly in the Python tag, task students with "drawing" some sort of "shape" or pattern at the command line by outputting asterisks, digits or other such symbols according to a mathematical rule.

Now, I want to stress: these questions are almost universally bad, and most are in some way irredeemable - that is to say, there's no chance of getting OP to provide whatever would be needed to fix the question, because an OP with that much of a clue wouldn't have had a problem with the assignment in the first place. Some are just debugging questions - and sometimes the problem falls into a common pattern, other times it's idiosyncratic. Probably a lot more, though, are how-tos where OP is just generally stuck, and lacks the ability to decompose the problem, figure out individual steps and implement them. Furthermore, many of them are incorrectly tagged which I'm sure is annoying a few people.

However, there are a lot of useful things that can be said about these questions in general. Having a canonical would mean questions can be closed more quickly to avoid FGITW1, and ensure a bunch of these beginners don't walk away empty-handed. I imagine a question that includes a few example requests and then asks "how do I approach tasks like this?", and answers that make reference to other existing canonicals (e.g. to explain string multiplication, doing multiple prints on the same line) and describe some logical analysis (stuff like "if you want to right-align X symbols within Y columns, conceptually this means putting Y-X spaces before the symbols").

My fear is that any obvious attempt at this would swiftly be closed as NMF, downvoted, and delete-voted. Some people don't seem to like artificial canonicals for "easy" questions at all, but aside from that it would be hard to refute the NMF argument anyway.

Is there any way to make this work? Perhaps as several questions? If anyone here has specific experience teaching beginners in a classroom environment, perhaps you can offer more specific suggestions?

1 Yes, I know that closing as a duplicate prevents the 9-day Roomba rule from kicking in. However, an accepted or upvoted answer does that too, and also blocks the 30-day and 365-day rules. It's hard to get three people to coordinate and click through the closure interface before any of several single actors clicks Submit, and it's impossible to prevent OP from accepting an answer that "helped" even if it didn't answer a question. Aside from that, if a question is closed and not deleted, however terribly asked it is, I only see a reason to care if it's messing with search results or allowing bad ideas (like, say, gratuitous use of eval) to spread.

12
  • Re "any obvious attempt at this would swiftly be closed as NMF, downvoted, and delete-voted.": Yes, there ought to be some kind of system support for creating canonical questions (for instance, they could get 10 fake upvotes (community endorsed credibility) owned by the Community user and be locked for voting for a few weeks or months). Like on Area 51, a number of users could commit to contributing to one. Jan 26 at 21:26
  • 1
    Would such a canonical be helpful for the users asking these questions? would it be like the null pointer canonical that is universally useless to the majority of users who have that problem? If the asker is so far removed from being able to solve their problem that they cant decompose it down into the smaller bit that is making their situation not work, how would seeing a different but similar one being solved help?
    – Kevin B
    Jan 26 at 21:31
  • I haven't actually looked at the null pointer canonical. Any particular thoughts on what makes it useless? "If the asker is so far removed from being able to solve their problem that they cant decompose it down into the smaller bit that is making their situation not work, how would seeing a different but similar one being solved help?" I mean, if we're giving up at that point, then is it actually possible to teach anyone to program in the first place? Jan 26 at 21:33
  • NRE canonical is "useless" because it requires reading through many cases and does not give copy-paste ready code. For this one I'm sure even MRE in the question itself would be plenty for many people to copy-paste. Jan 26 at 21:37
  • "copy-paste ready code" doesn't make sense in the first place for the problem of "I have an NRE; how do I fix it?" because it's a debugging question, not a how-to question. There's no way to provide code that can be pasted in to an existing project, because we don't even know the existing project's variable names, and that's actually necessary since we aren't just defining a new function. What I would hope for from the NRE canonical is stuff like, explaining how to read the error message and work through a stack trace; how to use a debugger and check what variables are null; what "null" means. Jan 26 at 21:41
  • it's "useless" because the poeple landing on that post with that problem usually don't have the ability to track down why an NPE is occuring. In your sample the whole reason they're asking is exactly that.
    – Kevin B
    Jan 26 at 21:45
  • Right; so it ought to help them develop that ability instead. My thinking is that a well written canonical here could do the equivalent for the triangle drawings. I would expect the answers to be quite code-light, and based in theory, on the level of "print will skip to the next line by default, so we should start by thinking about what text needs to appear on the first line, then the second etc; then look for a pattern in that; then think of a way to express that as a mathematical rule". Something like that. Jan 26 at 21:49
  • Just note that "useless for one asking duplicate" is more-or-less not a concern for SO. What we really should care whether google visitors find it as useful answer. For C# NRE one there are 2M views - meaning potentially that many people did not need to ask the question. Jan 26 at 21:50
  • 2M views mostly means it has a title and inbound/outbound links the search engine likes, though. Jan 26 at 21:51
  • It does have a ton of views, but it also has a ton of anonymous downvotes.
    – Kevin B
    Jan 26 at 21:52
  • Speaking of which: IIRC I do have access to that anonymous voting information, but I can't recall how to get at it.... Jan 26 at 21:53
  • Here you go: stackoverflow.com/tools/post-feedback
    – Kevin B
    Jan 26 at 21:55

1 Answer 1

1

I think that particular case does not seem to be too hard to come up with decent MRE in the question and reasonably scoped set of "need help with", combined with immediate self-answer it should not go below -10 votes and probably not going to be deleted instantly. As soon as you linked duplicates to that question it will make much harder to be deleted.

Suggestion is to find several non-deleted to-be-duplicates, prepare both Q and A, post and quickly use it as duplicate target if you really afraid of question being NMF. I don't think this particular case have to be NMF so and hopefully will survive on its own.

Proposed Q (better wording is needed):


Drawing triangles on console

I have assignment to "draw" filled rectangle, filled right-angle triangles (with slope down to the left and to the right) and outline of triangle with top in the middle. I got rectangle ok (code below) and right-angle one with slope to the right. I can't get the other two as all my stars got squished to the left when printing. I'm also not sure how to get just outline.

for (i=1; i < 10; i++)
   print(string_repeat("*", 20)) // rectangle
   // print(string_repeat("*", i)) // filled triangle.

I'd also appreciate if you could explain how to draw those in the middle rather than squished to the left. And any hints on drawing circle the same way (which is advanced part of the assignment).


Answer:

  • adding spaces to shift to middle (print(" " + ...) )
  • adding spaces to get to the first character of the shape
  • adding spaces to skip inner part of the shape to draw outline
  • link to drawing lines in general (Brezernhem) and special case of 45 degree once (x++, y++).
  • conversation about drawing lines (as code shown above) vs. figuring out if particular "pixel" should be filled based on (x,y) with drawing circle as an example using (x - x0)^2 + (y - y0)^2 <= r^2
3
  • 1
    Students with these kinds of assignments are definitely not going to benefit from exposure to Brezenham's line algorithm. They're simply being asked to reason about counting up/down and making the 45-degree triangle point in the correct direction. I haven't even been seeing questions about circles. The point of these assignments isn't to build an intuition about how rastering works; it's to build an intuition about how iteration works. Jan 26 at 21:36
  • 1
    Also put a comment or small note in the question to clarify it is meant as the canonical question, and should not be closed as a duplicate of an older one.
    – Bergi
    Jan 26 at 21:42
  • 1
    There are students that get stuck but are eager to learn (or just get curious) so may be useful. The answer there would be mostly for people who are not going to actually ask the question and actually search before asking - you are way more concerned about people who can't search/ask :) Jan 26 at 21:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .