JavaRanch Home
 
 
This page:         last edited 28 June 2006         What's Changed?         Edit

Use Code Tags   

One of the most important tactics for getting answers to your questions effectively is making your post easy to read. And one of the most important practices to make your post more easy to read is to put code tags around your code examples.

It's really easy: just put [code] tags around your code, such as in

[code]
System.out.println("Hello world.");
[/code]

Or just use the appropriate "instant UBB code" button below the edit area.

That way, the formatting of your code will be preserved, and people who read your post don't need to waste valuable brain cycles on deciphering it - they can use them instead to formulate the answer to your question! Taking the time to ensure that your code is presented properly shows that you respect everyone's time enough to ShowSomeEffort when posting your question.

(If you remember this after already having posted some code, you can edit your post by clicking on the pen-and-paper icon at its right top.)

It is also a good idea to disable smilies when posting code. This is especially true when posting code containing XML markup (or JSP custom tags) that utilize the : (colon) character as a namespace separator. The 'disable smilies' checkbox is near the bottom of the page when creating topics or replies, so you may not have noticed it.

See http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page for more info on how to format your posts.

Finally, note that most people won't even try to read your code if you post more than about 15 lines. Remember that before you post your entire program and say "what's wrong with this?" Better you try to isolate the parts where the problem is and just post that.

Also take a look on our other tips on HowToAskQuestionsOnJavaRanch!


JavaRanchAbout us — Copyright © 1998-2009 Paul Wheaton