Member Avatar for iamthwee

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???

Recommended Answers

All 69 Replies

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. </attempt 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 ^^.

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.....

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

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?

>so what does that tell ya?
Popular languages attract idiots like poo attracts flies?

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.

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!

Member Avatar for iamthwee

>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]

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.

Member Avatar for iamthwee

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:

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.

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.

Member Avatar for iamthwee

>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]

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?

Member Avatar for iamthwee

>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?

Member Avatar for iamthwee

I read that silly ;)

It's just that the cprogramming do it nicely, so I was wondering why not for daniweb?

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.

Member Avatar for iamthwee

Yeah, check out cprogramming.com. I know it only specialises in the subsets of C, but it will give you an idea. :!:


I don't mean to bicker, its just tgreer wasn't very nice when he/she said he would close this thread just because he felt there wasn't a viable solution.

If that's his attitude I wonder how anything gets solved. Tee he he.

[edit] they must use something cos I can't post code without code tags[/edit]
[edit]or they must have a system which ignore single lines[/edit]
[edit]I think it just searches for the curly brackets...I don't really no[/edit]
(I love you man)

Actually, I repeat the suggestion... I think the thread should be closed and all the posts after Dani's post #13 be deleted. Once an issue has been considered, and addressed, which this one has, then there is no reason for the thread to continue. All you get is useless posts like this one. :)

I know they have an announcement about it but I'm not familiar with anything they do server-side. Could someone who is a cprogramming frequent visitor please confirm?

Member Avatar for iamthwee

tgreer please, you don't know what you're talking about.

The cprogramming is a good example of what I'm talking about. Let's just wait until dani finds out more about this.

>cprogramming doesn't use a parser. They just tell people to use the code tags. Evidence, this thread:

That doesn't prove nothing. Go to that board and see how many thread you can find that are totally unformatted, posted by newbies. You'll be hard pressed to find many.

ThanQ

It's very probably that cprogramming just has a more efficient group of moderators, especially since they focus exclusively on programming. :)

I went to the cprogramming.com website and into the C++ forum. The third thread listed, http://cboard.cprogramming.com/showthread.php?t=78438, has multiple posts with code that isn't in [code] tags. Cleary, they face the same problem we do. They probably just have a more diligent moderation staff, in addition to perhaps a more experienced community of programmers who are more used to using [code] tags. Who knows ... but the point of the matter is, that it really just isn't feasable to do anything server side as far as parsing is concerned.

I am open to OTHER suggestions though. :) Please also note that this week will be one of the worst since a new school semester just began. Therefore, a lot of first year students are in the first and second weeks of beginner programming courses. If we can get through this week enforcing [code] tags, we can get through the rest of the year :)

Entia non sunt multiplicanda praeter necessitatem.

Occam's Razor applies to this discussion. Either cprogramming:

A. has written an advanced AI to parse each and every post, sensing the presence of code and automatically applying code tags, on an advanced high-speed server so that delays aren't noticed, and are using it on their website rather than making a fortune by selling this technology elsewhere...

or,

B. they moderate their posts and educate their users.

Now, which hypothesis do we eliminate?

iamthewee, I have nothing against you personally. As far as I know this is the first thread we've shared. I agree that I am irritated by posts without code tags, and aggresively moderate in those forums under my review.

But ignoring the explanations of experienced coders/forum operators, telling them they don't know what they're talking about, implying that we have an obligation to implement your suggestion etc. etc. is not the way to handle the issue.

I truly am open to suggestions about this, as it is an issue that affects me. Truly, if there is a magic bullet, I'd want to use it! But a code parser is not a workable solution, period.

So, I echo Dani: does anyone have OTHER suggestions?

Member Avatar for iamthwee

I went to the cprogramming.com website and into the C++ forum. The third thread listed, (http://cboard.cprogramming.com/showthread.php?t=78438)[http://cboard.cprogramming.com/showthread.php?t=78438], has multiple posts with code that isn't in [code] tags. Cleary, they face the same problem we do.

No! Those are only one liners. The system they use forces people to use code tags that contain curly brackets. Which is often the case when students post their entire program.

If you joined up and tried posting an entire program without code tags you'll know what I mean. You can't. It's nonsense to assume that they just have a better moderating team than you as to why hardly any non-formatted code exists there. The same noobs that post here, post there too, FACT.

I don't know if it's done on the client or server side.

But ignoring the explanations of experienced coders/forum operators, telling them they don't know what they're talking about, implying that we have an obligation to implement your suggestion etc. etc. is not the way to handle the issue.

You can do this. Trust me. And it won't take 10'000 lines of code. But it might only be for the main languages such as c/c++ or java. I admit doing it for all languages will be problematic.

When you've researched this and told me it's still impossible, then I'll reconsider my view-point. But I'm not wrong.

I tried to register on cpogramming but I never received my confirmation email to activate my account. I've waited an hour :( I even double checked my email address.

The system they use forces people to use code tags that contain curly brackets. Which is often the case when students post their entire program.

Well that would explain it ... it would be just a search for { or } within a post and if that is found without [code], then it would present the user with a message. That is viable ... but not so for DaniWeb, when curly brackets are used quite often when not posting code snippets. Additionally - it would only make sense for some of our programming languages, which really just adds confusion into the mix. I'm really not all too fond of such a rudimentary hack because it's not fool proof and I would rather do something 100% right or not at all.

Let's give my way a shot first (the wysiwyg editor watermark, etc) ... if it's STILL a serious problem, perhaps I'll do something like that temporarily.

Member Avatar for iamthwee

Oh for goodness sakes what you guys like;)

This is me trying to post this with no code tags see attachment.

int main
{
cout<<"hello";
}

And the message I get. Now I have opened your eyes as to what's happening around you please find out more about this. Daniweb can be a better place. That's all.

[edit] that's why I said it will only work well for the main languages such as java and c/c++. And even if it was only for these two main forums, it would still be better than what it is now. In the mean time let's give your watermark idea a shot[/edit]

Ok I'm out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.