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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-31-2013, 02:28 PM
|
#1
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
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 01:09 PM.
|
|
|
05-31-2013, 09:23 PM
|
#2
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
Quote:
Originally Posted by H_TeXMeX_H
For a bit of syntax highlighting consider the [ php] [ /php] tags.
|
|
|
|
06-02-2013, 08:58 AM
|
#3
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
I think that this thread is very useful on this forum, so it a sticky one now.
|
|
|
06-03-2013, 11:04 AM
|
#4
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
|
H_TeXMeX_H, thank's for posting this long overdue sticky
Quote:
Originally Posted by H_TeXMeX_H
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.
|
|
|
06-03-2013, 11:25 AM
|
#5
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Original Poster
|
Alright, I added that.
|
|
|
06-03-2013, 11:32 AM
|
#6
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
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.
|
|
|
06-03-2013, 12:05 PM
|
#7
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Original Poster
|
Quote:
Originally Posted by TobiSGD
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 12:07 PM.
|
|
|
06-03-2013, 12:14 PM
|
#8
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
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.
|
|
|
06-03-2013, 01:08 PM
|
#9
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Original Poster
|
Alright, fine, I'll take the PHP out.
|
|
|
06-03-2013, 01:52 PM
|
#10
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Thanks.
|
|
|
02-25-2017, 01:07 PM
|
#11
|
LQ Newbie
Registered: Feb 2017
Distribution: SLES, RHEL, OpenSUSE, CentOS
Posts: 13
Rep:
|
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-
And repeat that... lots of info to post
Do you mind long posts with much info to go through?
|
|
|
02-25-2017, 01:11 PM
|
#12
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,452
|
would be nice to read the thread you started to hide. Please open a new thread instead.
|
|
|
02-25-2017, 02:55 PM
|
#13
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,311
|
Quote:
Originally Posted by SeaPhor
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.
|
All times are GMT -5. The time now is 08:58 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|