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

obnoxious color codes

Take this thread as an example. I want to comment about it on this board instead of hijacking the original thread.

How do all those obnoxious color codes get inserted into such posts? It looks like they were created by some other program then pasted into the post. That is not the only thread I have seen like that. As a moderator I don't have the time to edit out all that crap and insert proper, acceptable code tags.

Ancient Dragon
Retired & Loving It
Team Colleague
30,038 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,340
 

There's not really much we can do about it, though.

The only explanation I have is that maybe the users tried to manually color each line with the WYSIWYG editor, but didn't realize that [code=c] doesn't accept colors. Perhaps it could? That would solve *some* of the problems.

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

There is some poor-quality colorizer available to folks. It's been around for a while.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

I'm very confused - apparently I came to the thread too late after the weird coloring was fixed. Essentially joeprogrammer is correct in that color tags within [code=language] tags are ignored because that tag automatically colors code for you, hence its purpose.

cscgal
The Queen of DaniWeb
Administrator
19,420 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 
There's not really much we can do about it, though.

Actually there is a way.

The moderators have to just replace the[code=c] with [code] tags and it should turn out to be fine.

If you will again look at the first post of the thread under consideration, it was edited by me and now it looks relatively okay.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 732
 

The way to remove those color tags is to highlight the post (Ctrl-A) and click the weird A in the upper left corner of the edit box.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,474 posts since May 2006
Reputation Points: 3,342
Solved Threads: 938
 

I'm confused. Why are moderators editing the colors of other people's code to begin with?

cscgal
The Queen of DaniWeb
Administrator
19,420 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 
I'm confused. Why are moderators editing the colors of other people's code to begin with?

Because many users use color tags instead of using code tags. The original link to this thread which ~S.O.S.~ kindly corrected had both color tags and code tags, and the color tags were still visible making the code difficult to read.

I've seen some posts that contain hundreds of those color tags. I don't edit them out because it just takes too much time. I don't think I should have to spend a great deal of time deleting each one of those [ color=1234 ] and [ /color ] tags with a very high probability that I will delete something else I should not; I'm not that patient and I don't want that much torture. Which is why I started this thread -- the color tags appear as if they were machine/program generated.

Ancient Dragon
Retired & Loving It
Team Colleague
30,038 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,340
 
I'm confused. Why are moderators editing the colors of other people's code to begin with?


The only need to have manual colors for code is when a user needs to highlight a specific line (for example, "this is the line where the error occurs"). Otherwise the coloring should be the same on all posts.

Most users who post here are ignorant of either code tags and/or automatic coloring. They then either try to manually color the code without code tags (that's the worst, believe me!) or sometimes they add the colors inside a[code=language] tag, which was the problem here.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 
I'm very confused - apparently I came to the thread too late after the weird coloring was fixed.


For those who missed it - this is basically how it looked:

#include <iostream>
 using namespace std;

 int main() {
    cout << "cool" << endl;
    return 0;
 }


The deceptive thing about this is that the WYSIWYG editor actually colors the code, so if you don't preview your post, you won't realize that the color tags don't show up inside[code=language] tags. (see attachment)

Also, the thing that makes the colors look really funky is that the # symbol in C++ means the command is a preprocessor definition, which in DaniWeb's code coloring scheme turns the code all green. Ugh!

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

Yeah I've seen this especially on the vb.net and c# forums. They must use some other program to highlight it.

Code tags will always be a problem. In fact I haven't seen any improvement since the last time I brought up this issue.

A quick javascript (client side) hack dedicated just for just the software development forum may work... although a server side solution might be more practical. The parser wouldn't be 100% fool proof, otherwise it would max out on system resourses.

But that doesn't matter in the long run.

The more I think about it, the better it sounds. It just needs some beta testing, and now that tgreer's gone there's no one here to brainwash dani. ;)

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

On CBoard they used to have a code-checking script (I don't know if they still have it now) that would on C/C++ forums search for curly braces, and if they were present automatically insert code tags around the whole block of code.

This wouldn't solve the color problem, but it might fix the huge majority of posts we recieve here that lack the code tags.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 
On CBoard they used to have a code-checking script (I don't know if they still have it now) that would on C/C++ forums search for curly braces, and if they were present automatically insert code tags around the whole block of code.

Not quite. It just pops up a message.

Attachments Popup.jpg 31.83KB
Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 
Not quite. It just pops up a message.


Still, wouldn't that be a great way to improve the overall quality of postings in the software development forums? There's a lot of newbies who simply forget, even if they're aware of the need to use code tags.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 
Still, wouldn't that be a great way to improve the overall quality of postings in the software development forums? There's a lot of newbies who simply forget, even if they're aware of the need to use code tags.

I think it does well elseweb, but it still always comes down to the persistence of the poster, knowingly or unknowingly. And at times it also takes as much work with the admins. After the last upgrade, it took a while -- and some coaxing -- to get it back.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 
I'm confused. Why are moderators editing the colors of other people's code to begin with?

Oh, so you mean to say that if a post is multicolored, with all kinds of colored being used by beginners to express their thoughts or with the broken code tags, we should let it be?

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 732
 
I'm confused. Why are moderators editing the colors of other people's code to begin with?

What about this post ? What do you think should be done ? Left alone, yes ?

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 732
 

I guess in that situation I would remove the color code and wrap the code in [code=c].

cscgal
The Queen of DaniWeb
Administrator
19,420 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

Correct -- and thats what we mean when we say "Editing out the color tags out of user's post"....

There was a lot of debate whether moderators should touch anything other than code posted by moderators while some situations demand that the entire post be edited to maintain the forum dignity -- just wanted to make sure...

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 732
 
The more I think about it, the better it sounds. It just needs some beta testing, and now that tgreer's gone there's no one here to brainwash dani.

If you think your solution is viable: a massive, multi-language aware, client-side language parser/colorizer, and if you think I ever "brainwashed" Dani to do or not do anything, and if you think she doesn't still solicit my opinions and advice about certain aspects of the forum because of the mutual respect we hold for each other, despite our disagreements, then you are just as deluded and immature as you've always been.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You