954,093 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Code tag checking script

Since this became a debate in the other thread, I thought it would have enough weight to become its own thread. Thus, I'm posting this here. If you want to whine about code tags, then take a looksie over here:
http://www.daniweb.com/forums/thread84443.html

Basically I'm asking for your opinion on a code tag checking script. At the moment, I can imagine it mainly in use for the C/C++ boards, because they seem to get the most number of posts/threads per day (maybe Java, too). One script is in effect at cprogramming.com, so if you're interested in finding out more about it, go take a look. All it does is display a nice error message to the user when they try to post code without code tags (see screenshot below).

This is more of a petition than a poll, but whatever. Let's see how many followers we can get. :-)

Attachments codescript.jpg 31.83KB
John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

What would be used to decide that there's code? The only script I've seen is for C/C++ and looks for {, which means if your post includes a brace but no code, you have to put code tags somewhere anyway... And what criterion would be used for other languages?

I guess what I would like to see, if a script is used like the one I described, is that it runs for a certain number of posts with code, then shuts itself off. Say after 4 times a member posts code the script goes away.

Or, for new members posting on a programming board, the first few posts get a short guideline spiel that mentions readability, proper question, enough information, and code tags.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943
 
What would be used to decide that there's code? The only script I've seen is for C/C++ and looks for {, which means if your post includes a brace but no code, you have to put code tags somewhere anyway...


I think that's the main one for C/C++, although I do believe there are one or two other triggers. I don't think it matters too much though, it's very rare for someone to use {} in ordinary text, and by that time they're usually experienced enough to know how to use code tags. I would think a disable script or some option in the user CP for experienced members would suffice.And what criterion would be used for other languages?
Well at the moment it would mainly be useful in the C/C++ boards, because they're the ones that get the most number of threads/day by far, and thus have the biggest problem with untagged code...I guess what I would like to see, if a script is used like the one I described, is that it runs for a certain number of posts with code, then shuts itself off. Say after 4 times a member posts code the script goes away.
Yeah, that sounds like a good idea. I don't think we need it turned on for everyone, all the time.Or, for new members posting on a programming board, the first few posts get a short guideline spiel that mentions readability, proper question, enough information, and code tags.
What if they ignore it? They seem to ignore all the other hints we put in place...

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 
What would be used to decide that there's code? The only script I've seen is for C/C++ and looks for {, which means if your post includes a brace but no code, you have to put code tags somewhere anyway...
I think that's the main one for C/C++, although I do believe there are one or two other triggers. I don't think it matters too much though, it's very rare for someone to use {} in ordinary text, and by that time they're usually experienced enough to know how to use code tags. I would think a disable script or some option in the user CP for experienced members would suffice.

Au contraire. I've used braces in a post quite often when describing code formatting. Although I do like the CP idea.And what criterion would be used for other languages?
Well at the moment it would mainly be useful in the C/C++ boards, because they're the ones that get the most number of threads/day by far, and thus have the biggest problem with untagged code...
But all languages have the problem. I dislike the concept of "ignore the others, they don't matter". Each language has moderators adding CODE tags (I hope :icon_wink:)Or, for new members posting on a programming board, the first few posts get a short guideline spiel that mentions readability, proper question, enough information, and code tags.
What if they ignore it? They seem to ignore all the other hints we put in place...
We ignore them.... If they ignore a specific 'intrusive' request to think about their post, maybe they aren't mature enough to be programming...

I was thinking something along the lines of when clicking SUBMIT, a 'pop-up' asks pertinent questions, like
1) is there enought information that your question is understandable?
2) If posting code. did you use CODE Tags?
3) ...etc...

and they can click CLOSE, EDIT, or a link.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943
 
Au contraire. I've used braces in a post quite often when describing code formatting. Although I do like the CP idea.


Come to think of it, I like your idea of having it automatically turn off after a set number of posts more and more. I think if the script were to check for braces, lack of code tags, and the user postcount being below say, 5, the amount of untagged code would dramatically decrease, while leaving the experienced users untouched.But all languages have the problem. I dislike the concept of "ignore the others, they don't matter". Each language has moderators adding CODE tags (I hope)
I'm not well-versed in the other languages to know enough about how difficult it would be to create a code tag-checking script for them, but I would assume for some languages it would be considerably harder than checking for some braces. Do you think it would be wise to resist a code tag-checking script for C/C++/Java simply because it wouldn't be fair to the other programming language moderators? :icon_wink:We ignore them.... If they ignore a specific 'intrusive' request to think about their post, maybe they aren't mature enough to be programming...

I was thinking something along the lines of when clicking SUBMIT, a 'pop-up' asks pertinent questions, like
1) is there enought information that your question is understandable?
2) If posting code. did you use CODE Tags?
3) ...etc...

and they can click CLOSE, EDIT, or a link.
I don't know... but I really don't like having popups in my face when I haven't done anything wrong. In my opinion, those types of reminders should only come up when you've missed something (of course, there will be the occasional time when a user gets the error message and really doesn't need code tags in their post... in such a [rare] case they'd just have to put code tags somewhere in their post).

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: