Being an amateur programmer, I often have questions which are well within my ability to answer for myself. In the service of these questions, I'll run tests and experiments that give me answers that sometimes (perhaps often) run counter to what I might expect, and I sometimes find it might be useful to share my results here, primarily for the benefit of other amateur programmers. (Incidentally, it also creates an opportunity for me to get feedback on my testing method and samples...)

The reason why I'm bringing this up here is because, although I feel it's normal and right to share results that are clearly useful or deeply counterintuitive, many of the tests I run are more 'curious' and less 'profound'. Many are to do with microoptimization and are similar in scope and significance to this other well-received question I've asked.

My question for Meta is this: Is it reasonable to post more situations like the one linked as long as they are new (non-duplicate), at least somewhat interesting (pointful), and are actually questions (which can be answered)? I presume they are (as is answering our own questions), since that is at least part of the purpose of the SO project, but I'm interested in hearing other peoples' opinions on this sort of minor dialogue.

My concern here comes mainly from the fact that I actually have a lot of these minor sorts of questions, and while one such question may be a sort of quaint novelty here, there are easily six or seven others (out of dozens of other, forgettable tests I've run) that I feel at least sufficiently worthy of sharing... The dichotomy here is that, although my one question was well-met, I also find that these simple questions do not exist yet, and that is kind of warding all on its own. I don't want to be spammy.
– AugustaMay 7 '15 at 23:45

6

6 or 7 questions doesn't seem too spammy to me. But if you're worried… well, you obviously have the right attitude to coding problems: Instead of guessing, or asking someone else to guess, come up with a good test and run the test. Why not do the same thing here? Post 1 or 2, and see what kind of votes and other reactions you get. If they get closed or downvoted, stop (or rethink how you're doing them); if they double your rep overnight, keep going.
– abarnertMay 8 '15 at 1:25

As a non-Python programmer, I'd like to point out that Google's best result for EAFP is "European Association of Fish Pathologists". I nominate you for the "Best Accidental Humor" award.
– GusMay 8 '15 at 16:14

4

@Gus: Translated from Dutch, EAFP stands for "Easier to Ask for Fish than Permission". The idea is that Python is designed so that fish diseases will raise exceptions as appropriate, so you don't need to pull out each fish and check its scales before feeding it (or deal with the race conditions inherent in the fact that the fish may have caught ick between the time of checking and the time of feeding, especially if it's a rare Dutch Toctou).
– abarnertMay 8 '15 at 22:07

2

@Gus: By the way, when I do an "I'm feeling lucky" on EAFP, I get this StackOverflow question, which describes EAFP and LBYL before getting into whether it's appropriate for Java. (And what a great question; it seems calculated to allow Java programmers to explain why EAFP is always bad, even in Python, while Python programmers can explain why it's always good, even in Java, and both are likely to get more votes or get accepted than the answers that explain how Java is not Python and actually answer the question…)
– abarnertMay 8 '15 at 22:10

3

@abarnert I feel like "I'm feeling lucky" is itself an ideal presentation of EAFP.
– AugustaMay 8 '15 at 22:41

@tepples I think it's a bit silly to try to take the metaphor this literally, but... You don't get banned for one bad post, no matter how bad. You get banned for a pattern of ignoring feedback--for neither looking before you leap nor asking forgiveness. You can argue about which one is a more appropriate way to deal with a given class of errors in a given kind of program, but doing neither and not dealing with errors at all is going to be punished with segfaults.
– abarnertMay 10 '15 at 17:08

In particular, it's a well-defined problem that others are likely to face in the future.

If you can say the same about the problem you encountered, researched, and then solved, and you're sure that the solution doesn't exist on SO yet, then by all means, post a self-answered question.

Do make sure that the question and answer individually meet all the rules. Don't ask a leading question that already contains the answer and then the answer is just "Yes, that's the right way to do it. Here's the result you get." And don't ask a stub question just as an excuse to post an answer, where all the explanation is in the answer. Explanation of the scenario and problem goes in the question, solution and its explanation go in the answer.

In the case of the question linked, the real situation that others are likely to encounter is needing to compare two alternate python implementations of the same task, and the actual code being looked at isn't important, it is just a case study illustrating how to read the bytecode, what it means, and what sort of surprising things can happen during the translation from source code.

I don't think you need a whole series of these looking at different variations of the code... at least, not if they all result in the same bytecodes, just in different orders. Q&A that show certain non-obvious bytecode instructions are probably interesting to your python-charming colleagues (of whom I am not one).

Is it safe for me to conclude that you'd say these case-example questions are fair game, then, with the provision that they can be applied to broader programming concepts (rather than one narrow and exclusive example) and that this broader topic has not already been addressed by a similar question that merely uses a differently-worded (-coded?) example? In the linked question, the substance of the thing was more about comparison methods (is 'implementation' the correct term here?) than the exact example code, but I felt that it could be generalized to that point. (Which is why I asked it. :D )
– AugustaMay 8 '15 at 0:23

Incidentally, I understand that it's perfectly reasonable to answer my own questions (which I have even done once or twice!); I was more concerned with presenting research on issues that seem minor, at least to me, and whether that's kosher here (since there don't seem to be many of them that I've seen). :)
– AugustaMay 8 '15 at 22:48

@Augusta and Ben: When answering your own questions, you could always consider marking it as community wiki. That way it's quite visible to everybody that you're not just doing it for potential points.
– Claus JørgensenMay 10 '15 at 16:11

2

@Augusta Think about how you'd vote if someone else asked the question. Is it so trivial that the question should be closed, or that he should be downvoted because anyone sophisticated enough to ask the question could do the same research in 5 seconds? Or is it a good question he could legitimately want help solving? If the latter, the fact that you've actually made up the question knowing the answer shouldn't really make a difference.
– abarnertMay 10 '15 at 17:12

@abarnert No, obviously not, because I wouldn't want to waste my time writing a question that can be obviously and immediately answered any more than I would want to have to close a question equally as pointless. ;)
– AugustaMay 11 '15 at 5:48

@Augusta: Well, that's my point: if the example would be too minor for someone else to post, don't post it; if it would, don't worry about it. The only risk is that your judgment turns out to be way off-center for the SO community (or the SO Python tag community), but that isn't that likely—and if is true, you'll learn quickly after the first post or two with only minor damage to your rep that you'll quickly outpace.
– abarnertMay 11 '15 at 18:48

@abarnert I guess the worst thing that could happen is that I spend a bunch of time writing a post and then learn fairly quickly that it was a mistake and have to delete it. It's only happened once out of the six or eight questions I've posted, so I suppose I can be fairly confident in my judgement. I think I understand what you're getting at, though! :D
– AugustaMay 11 '15 at 22:04