LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-31-2013, 01:28 PM   #1
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
What information to include in a post and how to use code tags


As threads in the Programming forum differ from threads in other forums, here are some tips on what to include in a post.

1) Make sure to include in the title and/or post what programming language(s) you are dealing with.

2) Include a clearly worded description of the problem with some details, NOT just "it doesn't work".

3) Include an attempt at solving the problem, in code tags.

4) Include examples of desired input and output, also in code tags.

5) Include errors that you are getting, also in code tags.

Code tags are part of the BBcode markup language. They start with [code] and end with [/code]. They will look like:
Code:
tabs	and	spaces  	are	preserved	here
and your code will be much easier to read.
So again:
[code]
your code goes here
[/code]

An example:
Code:
#include <stdio.h>

int main (void)
{
	printf ("Hello World\n");
	return 0;
}
Here's without the tags:
#include <stdio.h>

int main (void)
{
printf ("Hello World\n");
return 0;
}
Which is easier to read ?
In Python, where indentation matters, nobody can run your code if it is not in code tags.

You can also access code tags by clicking the '#' button right above the text input box when you are typing a post (not yet available in Quick Reply mode, but the tags work).

6) Do NOT expect members here to do your homework for you. Do NOT just post the problem (#2), leave, and expect someone to post the solution by the time you return. Members here are discouraged from doing this, as it doesn't help anyone, and may even harm by preventing you from learning what you are supposed to learn. However, posting all of the above information (#1 through #5) will get you some help if you are having trouble.

Last edited by H_TeXMeX_H; 06-03-2013 at 12:09 PM.
 
Old 05-31-2013, 08:23 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by H_TeXMeX_H View Post
For a bit of syntax highlighting consider the [ php] [ /php] tags.
PHP Code:
Very Clever
 
Old 06-02-2013, 07:58 AM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I think that this thread is very useful on this forum, so it a sticky one now.
 
Old 06-03-2013, 10:04 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
H_TeXMeX_H, thank's for posting this long overdue sticky

Quote:
Originally Posted by H_TeXMeX_H View Post
2) Include a clearly worded description of the problem.
I would like to add that 'clearly worded' almost never includes the phrase "doesn't work". We all assume it doesn't work, otherwise why would you be asking? Details about the nature of the fault are required.
--- rod.
 
Old 06-03-2013, 10:25 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Alright, I added that.
 
Old 06-03-2013, 10:32 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I am not quite sure if we should encourage the usage of php-tags for code, it may be difficult or even impossible to read that code for color-blind people.
 
Old 06-03-2013, 11:05 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by TobiSGD View Post
I am not quite sure if we should encourage the usage of php-tags for code, it may be difficult or even impossible to read that code for color-blind people.
That's not true. Color-blind people have difficulty distinguishing between colors. It's not that certain colors are invisible to them, they just don't look the same.
http://en.wikipedia.org/wiki/Color_blind

If there were any concern, it would be about the background color, which could hide the letters in some people. And that varies from post to post, so it's more complicated.

A more pertinent concern would be that sometimes the php code causes formatting errors and the post may expand off the screen.

Last edited by H_TeXMeX_H; 06-03-2013 at 11:07 AM.
 
Old 06-03-2013, 11:14 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I do know how color-blindness works. My point was not that for color-blind people certain colors are invisible, but that those color possibly are not differentiable from the background, making them effectively invisible in the code. So possibly monochrome code-boxes are easier to read for them. Since I am not color-blind it is impossible for me to determine that, that is why I said: I am not quite sure.
 
Old 06-03-2013, 12:08 PM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Alright, fine, I'll take the PHP out.
 
Old 06-03-2013, 12:52 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Thanks.
 
Old 02-25-2017, 12:07 PM   #11
SeaPhor
LQ Newbie
 
Registered: Feb 2017
Distribution: SLES, RHEL, OpenSUSE, CentOS
Posts: 13

Rep: Reputation: Disabled
How large can my post be?

I have a long post, since I cannot use some of the data as an attachment, I'll have to paste the total output in-
Code:
Output long file
And repeat that... lots of info to post
Do you mind long posts with much info to go through?
 
Old 02-25-2017, 12:11 PM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,852

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
would be nice to read the thread you started to hide. Please open a new thread instead.
 
Old 02-25-2017, 01:55 PM   #13
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
Quote:
Originally Posted by SeaPhor View Post
Do you mind long posts with much info to go through?
It depends on the info, but in general, the shortest description necessary to describe your specific problem, the better. Asking members to review and understand a large code base to answer a question is not an acceptable use. Try to keep your question specific to a single issue and avoid broad generalities.

Remember that everyone here volunteers their time, so you help yourself by keeping your posts clear and brief and easily understood by those willing to help. When confronted with a confusing wall of text, many members will simply move on to another question.

Please review the Site FAQ for guidance on acceptable forum use, an in particular read the linked article, How To Ask Questions The Smart Way for guidance forming your questions.

Good luck, and welcome to LQ!
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Submitting using curl - include html tags wulfram Programming 3 06-24-2011 02:56 PM
tags for inline code fonts jlinkels LQ Suggestions & Feedback 0 02-04-2011 09:27 AM
LXer: MP3 And FLAC Metadata Information (ID3 Tags) In Nautilus List View LXer Syndicated Linux News 0 01-26-2010 11:50 PM
What are code tags? southsibling LQ Suggestions & Feedback 14 11-25-2008 09:08 AM
Allow newer users to post links so long as they're within code tags? Xert LQ Suggestions & Feedback 4 09-27-2008 01:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration