944,118 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Apr 23rd, 2006
0

code tags

Expand Post »
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???

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Apr 23rd, 2006
2

Re: code tags

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 ^^.
Team Colleague
Reputation Points: 1135
Solved Threads: 172
Super Senior Demiposter
Rashakil Fol is offline Offline
2,479 posts
since Jun 2005
Apr 23rd, 2006
0

Re: code tags

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.....
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Apr 23rd, 2006
2

Re: code 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
Team Colleague
Reputation Points: 1135
Solved Threads: 172
Super Senior Demiposter
Rashakil Fol is offline Offline
2,479 posts
since Jun 2005
Apr 23rd, 2006
0

Re: code tags

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?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Apr 23rd, 2006
0

Re: code tags

>so what does that tell ya?
Popular languages attract idiots like poo attracts flies?
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Apr 23rd, 2006
0

Re: code tags

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.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 163
The Queen of DaniWeb
cscgal is online now Online
13,646 posts
since Feb 2002
Apr 23rd, 2006
0

Re: 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!
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Apr 24th, 2006
0

Re: code tags

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

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Apr 24th, 2006
0

Re: code tags

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.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in DaniWeb Community Feedback Forum Timeline: Rogue Javascript
Next Thread in DaniWeb Community Feedback Forum Timeline: New font size





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC