code tags
Ok how many ppl here get ticked off when newbies persistantly post their code without code tags. Raise your hand? Yes I thought so.
Anyhoo, I've been speaking with dani about this however, she has been unable to provide a solution for this. Everyone say 'awww'.
Ok, so I was wondering, since there are a lot of clever ppl here, myself being the cleverest :cheesy:, this could be the thread to remedy this problem.
Any ideas... ppl? Thinking of a php parser to force ppl to use code tags when code is written, but there are so many languages on this board. Hmm???
[IMG]http://img476.imageshack.us/img476/5171/cut20ln.png[/IMG]
Piworld ™
[Tis simple as Pie]
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
I say it's their loss if they don't post using code tags, so who cares?
(Of course, it's Dani's loss, too, in that case, so I guess Dani would.)
I personally care more about the large margins given when code tags are used. type="derail conversation">
((call/cc call/cc) (lambda (f)
(display "Worst infinite loop, ever!")
(newline)
(f f)))
This is what i'm talking about, above and below ^^.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 176
That's a prefect solution. There are a ton of langauges, but let's face it, there are BASICALLY 2 kinds. Basic, real. Basic is a fairly simple, and easy to figure out language, if, end if, etc. Then the real style (you know, C, C++, Perl, Java, Javascript, etc) with the cool braces and brackets. So, you just look for a list of programming syntax in their post, and either ask them to use code tags, or automagically add them.
Another solution, since some people have a hard time figuring out how to stick stuff between code tags, is to have Dani modify vbullettin, and have a link or another button for "post code", which loads a new window with a textbox, where they paste the code, and it adds it to the post with the tags.....
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
User-interface-wise, I think it'd be best to detect code, and if the message has no code tags at all (and if code is detected), then ask the user if they'd like code tags (automagically added) and then have a neat little interface where they could drag and drop code tags around to the appropriate place if the detector got the boundaries wrong.
Of course, I'm dreaming a bit here, as it'd be annoying to implement this with a language as crufty as PHP, messing with code that already works, with very little to gain.
And I guess the people sophisticated enough to use a REAL real programming language are probably sophisticated enough to use code tags already, right? :p
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 176
well, I've seen WAY too many posts in the C/C++ and Perl forums with no code tags...... so what does that tell ya?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
>so what does that tell ya?
Popular languages attract idiots like poo attracts flies?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
She's baaaaaaaack :)
Parsing every single post that runs through the system is just way too resource intensive - and inefficient - for a forum community.
With the upgrade to vB 3.5, the default editor for new members has been set to the WYSIWYG editor (the standard and wysiwyg editor modes can be toggled via the icon in the upper right of the editor). When in the software and web development forums, the editor area displays a watermark reminding people to use code tags.
cscgal
The Queen of DaniWeb
19,420 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
you could add some javascript to do it...
hell, if you know where to add it, (ya know, on the post submit) I'll code the javascript for you!
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
>When in the software and web development forums, the editor area displays a watermark reminding people to use code tags.
Well is it working. Clearly not. ;)
>User-interface-wise, I think it'd be best to detect code, and if the message has no code tags at all (and if code is detected), then ask the user if they'd like code tags (automagically added) and then have a neat little interface where they could drag and drop code tags around to the appropriate place if the detector got the boundaries wrong.
This is genius. Please make something like this Dani.
Prettie please. I bet you can't do it. (Tries to use reverse psychology)
[IMG]http://img476.imageshack.us/img476/5171/cut20ln.png[/IMG]
Piworld ™
[Tis simple as Pie]
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
This isn't feasible. I'm an experienced JavaScript coder, and the overhead just to include a script that could parse every post and detect code (and code fragments) would be astronomical!
The place to do it, if it all, would be server-side, in PHP. But we're a forum, not a code-parsing service. I think you're seriously underestimating what it would take to "detect code". And it would never be 100% accurate, so could potentially cause more problems than it would solve.
I would politely suggest that this thread be closed, or at the very least, to stop pestering Dani to implement a feature that isn't feasible.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Javascript is probably a bad idea.
I'd say it'd have to be done with php, never used it before tho so I'm not sure what's involved. Heh heh.
>I think you're seriously underestimating what it would take to "detect code".
So, you just look for a list of programming syntax in their post, and either ask them to use code tags, or automagically add them. Or automatically spit out a message, please enclose code with
[kode][/kode] tags. How hard can it be?
>I would politely suggest that this thread be closed, or at the very least, to stop pestering Dani to implement a feature that isn't feasible.
No thanQ. The situation has not been resolved so why should this thread be closed? Dani is here to serve the community, that includes me and everyone else who has to read unformatted code. Something needs to be dun about it. FACT. If you're too scared to admit this then close the thread.
:lol:
[IMG]http://img476.imageshack.us/img476/5171/cut20ln.png[/IMG]
Piworld ™
[Tis simple as Pie]
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Scared? What possible confluence of events would cause me to be scared by this thread?
I'd say it'd have to be done with php, never used it before tho so I'm not sure what's involved. Heh heh.
Right. I, on the other hand, do. So does Dani. We've both expressed how difficult this would be. It might even neccesitate another dedicated server. So, you just look for a list of programming syntax in their post...
Oh, that's all. Just look for programming syntax! Why didn't I think of that? Again... it's a nice idea, but totally impractical, case closed.
Situation? Resolved? So you've escalated your idea to a "situation that needs resolving"? Interesting. May I suggest another viewpoint? You made a suggestion, it was considered, found to be not-workable, and thus rejected. Thanks for the suggestion, let's close the thread, folks.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Unfortunately, I'm afraid that tgreer is right on this one. The resources and the overhead to parse every thread that passes through the system and determine whether it contains code is simply not feasable. It would be really bad enough to do a search on every post for a particular array of words. But all of the keywords within code snippets are regular words that one uses in everyday language ... if, for, next, else, etc. Therefore, some EXTREME pattern matching and regex would be needed, and the overhead in doing so just isn't something that's realistic. And that's if this were limited to just one language! The ability to detect multiple languages just adds to the problem. What's more, this algorithm is certainly not fail-safe (in fact, it's a rather rudimentary method of detecting code) and it would most likely cause more problems than it would solve if it constantly went off at the wrong times or didn't go off at the right times.
What you're proposing is really very similar to creating artificial intelligence to run on each post and detect when someone is posting a homework question and when someone is posting a legitimate question - it's just not the right solution to the problem. In fact, the people who don't use [code] tags are almost always students, as the more experienced programmers are smarter than that :)
The root of the problem is in the hands of our moderators. I think that the better way is to "train" the users and perhaps recruit some more moderators if the current moderation staff is overwhelmed trying to answer questions and handle other issues within the forums (such as homework questions and not using code tags when appropriate).
The watermark thing just went into effect over the weekend as the default editor for new members, so let's give it a little bit of time and see how it goes. (If you're not sure what I'm talking about, click the A/A icon in the upper right of the text editor to see the watermark.) I will also do my best to put in an extra hour or so daily reviewing all new posts in the software development forums and adding code tags manually. Over time, people will see that all posts have code tags so they'll be inclined to use them too.
I do understand everyone's frustration ... but the suggestion proposed is really just too resource heavy and inefficient for a forum. The complexity of the algorithm makes it really not feasable client-side (JavaScript, which is executed by the user's browser, slows down page loading time and should be reserved for simple things that are incapable of being done server-side), and to do so server-side would require writing what amounts to a complex multi-language code parser ... and to run such a resource-heavy parser on every single post that goes through the system to weed out some members who don't follow the rules to begin with just doesn't make sense.
cscgal
The Queen of DaniWeb
19,420 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
>The watermark thing just went into effect over the weekend as the default editor for new members, so let's give it a little bit of time and see how it goes. (If you're not sure what I'm talking about, click the A/A icon in the upper right of the text editor to see the watermark.) I will also do my best to put in an extra hour or so daily reviewing all new posts in the software development forums and adding code tags manually. Over time, people will see that all posts have code tags so they'll be inclined to use them too.
Oh ok, kewl. I'm sorrie if I'm pestering you dani but you know how I am.
What's up with tgreer by the way. He/she seems a little flustered. Aww.
I know some boards use parsers but they don't have as many languages as you do! If worse comes to worse can't you just make parsers for c/c++ and the java boards. They get the most traffic rite?
I think this is an important issue. And I think it needs to be addressed. Just out of interest how do the other forums deal with this?
[IMG]http://img476.imageshack.us/img476/5171/cut20ln.png[/IMG]
Piworld ™
[Tis simple as Pie]
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
iamthewee: the issue has been addressed. I addressed it. Dani addressed it. What's up with me is your attitude, and insistence that "something be done!", particularly in the face of rational reasons why what you ask cannot be done.
But by all means, keep the suggestions coming.
P.S. If you have an issue with a person, it is best to address that person. Asking Dani "what's up with tgreer" is about as rational as asking her to implement 10,000+ lines of code to insert code tags. :)
P.P.S. If you're going to quote someone, please use the quote tags. Dani, what would be cool is implementing PHP code to sense quotes and automagically insert quote tags. Get right on that, would you?
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
>But by all means, keep the suggestions coming.
So what then? Can't we just have parsers for the c/c++ and java boards? Or shall we just keep on using what we have now. And just ignore it?
How do the other forums deal with this anyway? Can't you get ideas from them?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
I read that silly ;)
It's just that the cprogramming do it nicely, so I was wondering why not for daniweb?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Bickering isn't going to get anyone anywhere. A parser just really isn't a realistic solution. Step one is to show the watermark reminding people to use [code] tags to all users in the forum right in the area where they type. Step two is for me to put some extra effort in daily to be on a lookout for code tags. Step three is to recruit new moderators if the current team has their hands full.
I don't know of any other large programming forums which use such parsers. I couldn't imagine how they would. But I will investigate to see what they do do, although I suspect it is nothing more than what we're doing.
cscgal
The Queen of DaniWeb
19,420 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37