16

I recently posted Using '/' as greater than less than in Python?

I accept the downvotes, and I got the answer I was looking for, but I want to know what specifically needs to be changed to avoid asking a bad question in the future.

I thought the question was fine:

  • I feel I was clear what I was asking,
  • I did my research,
  • And I feel like I put in the effort to try and figure out what was going on.

I feel like my question was downvoted because I simply made a beginner mistake, and not because it was a bad question. Sure, it was a stupid misunderstanding in hindsight, but I don't know that anything was wrong with how I asked the question. If there is, I want to know what needs to be changed so I know how to ask better questions in the future.

2
  • I think that's an ok question. I probably wouldn't have mentioned code golf and just asked if if a/b: was valid syntax in an if statement to do the same thing as if a<=b:.
    – Kev
    Commented Aug 14, 2014 at 10:19
  • You might also be interested in the downto operator: What is the name of the “-->” operator?. :) Commented Aug 14, 2014 at 15:22

3 Answers 3

12

Any discussion of why voters cast their votes as they did will be speculation to some degree. If I had to guess, I'd say that this downvote was indeed along the lines of "that's the division operator, lamer!" To my eye, though, what is lacking in your question is the results of your research.

I could be remembering this all wrong, but I'm pretty sure I've seen this operator used and recommended in multiple instances.

is pretty darn vague; it doesn't really tell us anything useful about your understanding of the problem you have. It's just fluff.

What would have been a lot more helpful would have been you tracking down at least one mention of the technique you're asking about, and quoting it.

Even better would have been you trying the thing out yourself. Firing up the Python interpreter and playing around with if and / for ten minutes would have told you a lot about your problem. That information might even have led to you answering the question yourself, but at least it would give you a clearer idea of what's going on. Having that information in a question nearly always makes for a more interesting and useful-to-the-future post.

All that said, your question is concise and well-posed. I don't personally find it to be poor quality, but apparently another voter did.

1
  • 2
    Okay, I can accept that. I will put more thought into that in the future.
    – RageCage
    Commented Aug 13, 2014 at 20:39
9

Good questions on Stack Overflow (this is not a comprehensive list):

  1. Are clearly written and comprehensible
  2. Demonstrate adequate knowledge of the subject matter (not effort; that's something different)
  3. Are about a practical concern

Without speculating about downvoter motives, I'd say you're running afoul of item 3. In a practical program, a programmer would never use division where a conditional operator would suffice, just to save one character of source.

There's nothing you can do to improve the question, as far as I can tell.

7
  • while you're right, it's not a practical concern, he DOES mention he's trying to code golf... so it becomes relevant
    – Patrice
    Commented Aug 13, 2014 at 15:44
  • 6
    @Julldar Code golf is not something that we do on Stack Overflow. That's why we have a separate site for it.
    – Robert Harvey Mod
    Commented Aug 13, 2014 at 15:45
  • But I'm not able to ask a question like this on that site. Chances are it would be migrated here anyway.
    – RageCage
    Commented Aug 13, 2014 at 15:46
  • I've always seen code golf to be more people who post challenges about code golfing, no? I know there is a separate site, but I've never seen a "how can I golf this" question yet... although I admittedly didn't visit the code golf site that much
    – Patrice
    Commented Aug 13, 2014 at 15:47
  • 5
    @Batman: Not every question that can be asked is guaranteed a home somewhere on the Stack Exchange network.
    – Robert Harvey Mod
    Commented Aug 13, 2014 at 15:48
  • My question was not about division specifically. I completely misunderstood suggestions and things that people programmed, and was wondering if '/' was a comparison operator as well. It may be pertained to code-golf, but it's also a question about the language and programming. I've seen questions about alternative processes and operator usage on this site.
    – RageCage
    Commented Aug 13, 2014 at 15:52
  • 1
    Ultimately, people vote as they wish. I took a cursory look at the Python documentation, and it's not at all clear that using a division in a conditional expression without a conditional operator is even legal, but I wasn't one of the downvoters.
    – Robert Harvey Mod
    Commented Aug 13, 2014 at 15:58
1

I didn't see your question, but I frequently browse the Python tag and I probably would have downvoted it. I think you actually ran afoul of #2 in Robert Harvey's answer, which is failing to demonstrate adequate knowledge of the subject at hand.

Your question shows that you are trying to do something fairly arbitrary ("code golfing"), rather than trying to solve a real-world problem, without seemingly even the most basic knowledge of the language you're trying to carefully manipulate (you can't tell arithmetic operators from logical comparison operators). Furthermore, Python has a heavily ingrained culture of readability, and as the top comment on your question pointed out, you are trying to do something that primarily serves the purpose of obfuscation.

It's also probably not that useful to future readers, primarily because of the aforementioned lack of understanding. Had you phrased it in such a way that the question accurately reflected what it really is, which is to say a question about how the division operator can be used as a substitute for inequality comparison, that might not be the case. As written, the question is primarily helpful to you because you weren't really aware of what you were doing and thus of any of the limitations of it (e.g., only works in Python <2.7).

You must log in to answer this question.

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