Suggestion, prepare your code (within reason) before asking for help with it.

Sorry in advance for a long rant.

I am relatively new to this as I started this year, but already seen people asking questions that sounds relatively simple, or related to something I'we done. But when I see their code I can not figure out how I would go about it.
It looks like they, just copy-pasted the whole thing as is.
Preparing your code is an extra step, but a win-win thing.
It makes it easier for the people helping, which makes it more likely for you to get help.
This will make it easier for a potential reader of your question to notice whatever problem you're struggling with rather than all the fuzz around.
I'm guilty of this myself but certainly not the worst offender,
often I see people asking for help with walls of code that doesn't even run at all.

Basics
First and foremost, if you're going to post code, use CTRL+O on it to put it in a code block.
Secondly, if you're posting a whole sketch and not just a snippet..
Copy paste the code your'e intending to post into a brand new sketch and run it and see if that works. Personally if I can't copy paste a code block into a new sketch and run it (with whatever flaws it may have), it makes me think the poster is lazy which kills my motivation for helping.
Fixing a problem where the sketch does not run at all is a daunting task.

Beyond basics
Ask yourself, "What will someone reading this have to do before they can begin to deal with my issue?", if the answer is they have to do something which you could easily do yourself, then do it.
If your code relies on external data, and thus can't run try making it easy.
If your code is reliant on libraries, say which ones.
If your'e using images and your problem isn't regarding images, see if you can replace them with basic shapes.
If you need images, provide links to appropriate images so everyone looking doesn't need to search for them.

Advanced
Ask yourself "What parts of my sketch do I not have a problem with?"
and.. "Can I showcase my problem without relying on these parts?"
And make a new sketch specifically for posting on the forum.
When the issue is solved add the non-problematic parts back in.
This will make your problem seem less daunting.

if you really want to delve deep
Use best coding practices.
I never do this, but this is what professionals do and are most familiar with.
As professionals are most likely to know the solution to your problem, use "their language" if you want their help.

sidenote Sometimesyou can omit the process of someone having to open the IDE and copy-paste your code into it by using this website... https://www.openprocessing.org/
Sometimes, because it might not work for your code, and maybe not for all browsers(haven't checked this)

Comments

  • Nice idea.

    Things to add: use ctrl-t in the ide before posting.

    Make empty lines between functions or new sections even.

    Post the relevant line numbers of your question additionally to your code.

    When there is a problem describe what the code does now (falsely) and what's it supposed to do.

  • Can you add this to one of the sticky posts above?

  • I liked everything in your post. And the most important, by far, is that "advanced" suggestion. People just post hundreds of lines of code and expect us to read the entire thing and solve their problem, when most of the times the problem just lies in a few lines of code and that too just a silly mistake.

Sign In or Register to comment.