Getting newer people to use code tags

Pages: 123
A lot of trouble with this, most of the new people dont understand the importance of code tags. I was thinking maybe a tooltip below the submit that said something like:
Tip* Please use code tags! they help make your code easier to read for others! These tags can be located on either the bottom of the screen or bottom right side under the image '<>'
For an easy visual example...
Since many people can read,
but viewing helps them grasp something much faster...

If you have a script or code you wish to share...
Type "["code"]" at the beginning of the code
Then type "["/code"]" at the end of the code.

fyi; - - - do not apply the quotation marks. :)

By doing this, it makes a world of difference.

For example...
Which looks better when someone is trying to help?

#include <string>
#include <stdlib.h>

using namespace std;

int main()
{
string id;

OR!!!

1
2
3
4
5
6
7
8
#include <string>
#include <stdlib.h>

using namespace std;

int main() 
{
    string id;
Last edited on
Something interesting would be like StackOverflow. What it does is sense if the user has input some code, and if so, it makes them put in code tags. We could have something like this except have a tooltip, and not be so forceful.
One of the first rules of UI design is that the user doesn't read squat.

Daniweb has had ongoing difficulties getting new posters (and some not-so new posters) to use the tags, despite having some very aggressive efforts to make people use them.

One solution is to have a "code tag moderator", who spends his life fixing people's code tags, but that doesn't usually work out very long.

If the forum script is complex enough, it could try to recognize unformated code and automatically tag it -- but this does produce some mistakes. However, most of the mistakes could be mitigated with some careful programming, I think -- so this is the option I would choose.

The only problems are: 1) not breaking older posts, and 2) time spent to make it work.
Duoas had a great idea, but i feel if you just put a little note under the submit button newer readers would at least see the tooltip(maybe in red or a color that stands out) and use the code tags.
Problem isn't whether they know about it. The problem is whether they care to do it. Some are lazy or just don't care and simply copy/paste the code with the question and leave it at that. You'd even have users misusing the tags (putting output in code tags, code in output tags, or mixing it with quote tags. The problem is the user, not the site. The user will use what the feel like using and ignore the rest (same is done with advice, as I'm sure you have noticed people will comment on one thing and seemingly ignore the rest of your comment like you had said nothing).

Example, the admin at Allegro.cc added a spoiler tag to hide things that could ruin either a game, movie, or such. He even said not to use them willy nilly, yet in one thread every post has one or more spoiler tags.
Last edited on by closed account z6A9GNh0
What about just having a javascript wrapper that says "There has been code detected in this post. Please add code tags. [OK, I will fix it] [I don't care]" meh.. :P
@strongdrink
I can take a pretty good guess at which option most new posters would pick. :-)
@iHutch yeah... but at least some of them would try.

Remember that there are 2 types of newbies -- noobs, and newbs.

EDIT:

But maybe this is just one of those ever existent problems that will bother us for the rest of our lives..
Last edited on
What about, maybe for the first three/five posts, a js notification box in windows style pops up and says you to use code tags when inserting code?
Javascript wouldn't work as a lot of people have JS disabled and have popup blockers on. This is an issue that has always been an issue on every site and it will always be a problem no matter how you address it. I saw a veteran user of a site use code tags to paste an article on the site. He only changed it after I told him that using quote tags would make it more readable.
BHXSpecter wrote:
This is an issue that has always been an issue

You say?
Like I said above, Daniweb has been very aggressively trying to solve this issue for ages, without success.

Things like popups and the like drive people away, even those who would use the code tags without being prompted.
[code] "Ignore this" [/code]
Still the main purpose is indentation, which a lot of times is missing or weird. (python ftw)

I found quite interesting that they use the wrong tags. Especially output, as it does preserve white space.
┬┐But how they know about it?

KISS, and don't bother the user.
You say?


No the internet says. You can go to almost any site and find that it is true, that it is an issue that has gone on and still goes on.

Duoas has said twice now.
Think he was jabbing at your choice of words ("this issue is an issue").
Last edited on
Yes :'D
As an alternative, people could refuse to help a poster that chose not to use code tags. If people only replied to such posts with "Please edit your post so that the code is safely nestled within the tags, then we will try to help answer your question." or something similar. And when (or if) such posters comply, they are rewarded with the constructive criticism they wanted.

Operant conditioning FTW
@atropos: We've tried the peer pressure method here for a while now, it has a predictable success rate. Some users stay and others get discouraged because between the tags and our particular opinions on the proper way to do things we end up looking like a site full of rule Nazi's. I think our current objective might be to retain more of those users who get discouraged.

Have we thought about just not dropping the white space from regular post submissions? It would be better if we could get users to use code tags but assuming that the ideal is impossible to obtain maybe we should try a different direction?
Pages: 123