How to properly post your coding problem in a forum

Discussion in 'Plugin Development' started by DxDy, May 17, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    DxDy

    As I’m getting increasingly frustrated with the level of posts here, a couple of hints for the less tech-savvy users:

    Make sure you have tried to debug the error first
    I can’t stress this enough. Before you even think about posting your problem, try to solve it for yourself.

    And even if you can’t: Make sure to gather all information that could help the people you’re asking for help. This includes, but is not limited to, making sure that the code which doesn’t work is actually executed, verifying that all relevant variables have the correct values and checking that you haven’t forgotten to upload the correct version for testing.

    If there’s an exception occurring please refer to "How to troubleshoot your own plugins by yourself". This guide will save you and the Bukkit-Community a lot of trouble. Most exceptions can be easily solved by just recognizing what occurs where.

    Alternative: If you don’t know how to do something please google it beforehand
    A significant chunk of posters here will find that the answer to their question will be a simple link to an old post where the exact same problem was solved.

    Using the proper way to display your code
    All code you’re posting belongs in code tags.

    [​IMG]



    An important thing to mind here is indendation. No one, and let me just reiterate this, no one, is ever going to help you if you post 200 lines of code without a single tab-stop.

    Furthermore you should consider using external snippet services if you're going to post longer sections of code. Popular choices here are pastebin and hastebin.

    If your code is part of an existing plugin which is open-source you can also mention your repository with a link. That will enable the people to have the full code at their fingertips if they need it, which obviously is the best possible way to help you. However, keep in mind that this is an optional extra, and not an excuse to neglect the points mentioned above.

    Posting code which is relevant to the problem
    You don’t need to post your whole file. In fact, you only should post code that is directly relevant to your problem. Since you’ve worked out the relevant parts of the code in (1) this shouldn’t be a problem. If your problem is related to an exception, please make sure that you tag the line the exception originates from with a comment.

    However, don't be too thrifty with your code. A single line of code won't give many chances to see what's going on. As a rule of thumb, you should always post at least the block of code (or even the method if it's not too long) which produces the exception, as well as anything related to it. To give an example:
    Code:
    // the commandsender won't get the message
    private void foo(final CommandSender sender){
      sender.sendMessage("blub");
    }
    
    This would not be appropriate. You would need to add the context (ie the circumstances under which the method is called, it's class instance created, ...). Don't have these? That might be part of your problem.

    Answering the right questions in your post
    The phrase “Something goes wrong, help!” is an absolute no-go. There are several important questions you will need to answer in your initial post.
    • What is supposed to happen?
    • What does actually happen?
    • How to reproduce the error?
    • What have you done so far to debug the problem?
    The appropriate way of reacting to help
    This is something that is often overlooked. Always keep in mind that the people answering to your post are dedicating their spare time to helping you. If that isn’t a reason to be friendly to them I don’t know what is. You need to make sure that you’ve read their post, understood it, and tried it, before even thinking about answering. Posting “I don’t understand that” after three minutes time is definitely inacceptable.

    If their answer solves your problem, make sure to express your gratitude. Even a little “Thank you” can make someone’s day better.

    If it doesn’t, answer their questions, supply them with the new errors and keep everything from (1) to (4) in mind. Also make sure to check for edits to their answers before you post your reply. Typos can and will happen. If there is such an edit and you have taken it into account, you can reflect that in your post, so that the poster can be sure you’ve done so. Since not everyone has enabled the automatic-thread-watching, it might be a good idea to tag them in your answer. But don’t tag anyone who hasn’t replied to your thread unless you’ve got a really good reason to do so!

    Doing posterity a service
    Sometimes you will find that you have solved the problem yourself, without requiring any help at all. In that case, please be so kind as to reply to your post with the appropriate solution, so that anyone else having the same problem later won’t have to ask it anew.

    Flagging the post as solved
    This should be self-explanatory. You can access the relevant menu via the edit-button.
     
    NathanWolf and Azubuso like this.
  2. Offline

    Code0

    Nice and helpful thread indeed.
     
  3. Offline

    Azubuso

    Could a mod sticky this maybe?
     
  4. Offline

    RawCode

    nobody read sticky threads.
    nobody use search.

    try to search with keywords from
    Oops, I didn't break your plugins - ambiguous getHealth()

    you will find zillion threads about this issue, all users who posted them just ignored stiky threads.
     
  5. Offline

    Azubuso

  6. See http://forums.bukkit.org/threads/why-i-hate-syntax-java.77169/

    Also, I have to agree that this would be helpful if people would read. But I don't think many of the people from the intended audience will.
     
    NathanWolf likes this.
  7. Offline

    Bammerbom

    Perfect tutorial
     
  8. Offline

    Necrodoom

    Have to disagree on this one. More often than not people forget useful data on the class that is not shown on the snippet, and people forgetting to register listeners and other things like this is a common problem.
     
    ZeusAllMighty11 likes this.
  9. Offline

    ZeusAllMighty11

    If there are multiple classes, it would be nice to see the source on Github so it's easier to read.
     
  10. Offline

    DxDy

    AdamQpzm

    That's funny, I always assumed the messed up intendation was a problem of my browser. In that case it's propably best to just use normal code tags? That's what I put in it for now. Also I added the hint that there are external snipped services for longer posts. If you've got any other tricks regarding the Xenforo-Syntax-Highlighting, let me know ;)

    Your hints at not reaching the "intended audicence" as you put it, occured to me to. But I think we have to differenciate here: There will always be those people that quite frankly don't care about a user-friendly presentation of their content, or general Netiquette. But there are also those that have never learned better. I believe this holds escpecially true since Bukkit has become increasingly popular among coding-beginners of a very young age.

    Necrodoom
    I think you have a point there, but I'm unsure regarding how to address it. I hoped to cover the situation with not registering listeners (as you're right in that it is a common problem) by hinting at "making sure that the code which doesn’t work is actually executed" in the before-posting section.

    I have added a further paragraph addressing the issue to the "Relevant code"-Section. Hopefully that will prevent the issues you mentioned :)

    Edit:
    ZeusAllMighty11
    Your comment goes in the same direction as the one by Necrodoom and is thus partially reflected in the changes I made there - namely using external services to paste code-. I incorporated the github-part of your comment in a further section that, in essence, tells people to post a repository link if their complete code is hosted there.
     
  11. DxDy Personally I normally opt for PHP - the indent problem does not occur and it looks better in my opinion :) Sure the highlighting is a bit off but honestly indentation is a whole lot more helpful than highlighting. Especially if the person knows what they're doing. :p
     
Thread Status:
Not open for further replies.

Share This Page