PDA

View Full Version : [site suggestion] syntax highlighting hack/mod for BB



gibsosmat
11-07-2007, 07:55 AM
I think it will be better if the site has syntax highlighting mods for C,C++,C#..
that are available for vBulletin.. it makes the code posted by the users more readable..
currently this site has only PHP highlighting though nobody uses that..
I know it can be used for C. but it will be better if we have different for each code type

I found one here
Advanced Syntax Highlighting - BBCode [highlight] (http://www.vbulletin.org/forum/showthread.php?t=93071)


And optionally codefolds if available, if it is not too much of effort :D

comment on this feature

brewbuck
11-07-2007, 10:29 AM
Most of the code posted here is pretty unreadable with or without syntax highlighting. In fact, a lot of the code posted here won't even compile. And you know what syntax highlighting does to broken code, right?

All it takes is one missing */ somewhere and suddenly all your code is highlighted in "comment color."

I'm not sure it would be helpful.

dwks
11-07-2007, 12:35 PM
I think it would be helpful if it were optional. So, for long, complicated code, one could use syntax highlighting; but for something like this, you could opt for not using it:

// your syntax error is here:
if(!strcmp(name, "Joe"))) {

There have been lots of discussions about this, actually. Here's a recent one. http://cboard.cprogramming.com/showthread.php?t=88629

As the author of codeform, I of course like syntax highlighting. :)

Salem
11-07-2007, 12:42 PM
If it's coloured and badly formatted, then I guess I'll start referring to it as "Jackson Pollock" style :rolleyes:

gibsosmat
11-07-2007, 01:24 PM
Most of the code posted here is pretty unreadable with or without syntax highlighting. In fact, a lot of the code posted here won't even compile. And you know what syntax highlighting does to broken code, right?

All it takes is one missing */ somewhere and suddenly all your code is highlighted in "comment color."

I'm not sure it would be helpful.
I dont think that users who post codes leave their message without seeing how their message is..
not atleast when there is syntax highlighting.. it is more likely to happen with normal monospaced letters than with colored letters.


I think it would be helpful if it were optional. So, for long, complicated code, one could use syntax highlighting; but for something like this, you could opt for not using it:

// your syntax error is here:
if(!strcmp(name, "Joe"))) {There have been lots of discussions about this, actually. Here's a recent one. http://cboard.cprogramming.com/showthread.php?t=88629

As the author of codeform, I of course like syntax highlighting. :)
ya.. I know that.. I did use the search button provided by the BB. and endedup with lot many threads. finally I saw yours and some discussion on 2 different highlighters. I visited the home page of codeform and downloaded the source and made it.. and I found that I need a clipboard copy commandline.. those sources shipped along with the source are for windows.. I am on linux.. I again googled for command line util, and found that xclipboard is avilable. and then again.. I have to make it save to file go to command get the output into file or clipboard.. or make a command in the editor I am using..
even after all this, there is a lot of overhead thats going into database&bandwidth with that or any other userside developed round about way to color their code for better understand of the other users..
so I was thinking of asking the admins to just put up that mod. interested and known users use it and rest wont..
there isnt much that this Board will be loosing.. its just few more CPU cycles of the server..
so it sounds affordable and better way than other highlightings
Also there is high lighting for PHP.. I dont know why its still there but its there


If it's coloured and badly formatted, then I guess I'll start referring to it as "Jackson Pollock" style :rolleyes:

I totally agree with that.. well formatted code needs no highlighting..
but highlighting saves a lot of effort.. like 'printf' might get 'pritnf' and we dont notice it and sometimes double quotes ended with single quotes etc..
The bottom line is 'something is better than nothing', may be pollock's art, at least we have an art :)

dwks
11-07-2007, 01:49 PM
If you figure out a way to manipulate the clipboard under Linux like the Windows code does, let me know -- I'd be very interested in it myself, as I use Linux a lot more than Windows.

Here's what I think. Really long code is immensely easier to read if it's syntax highlighted. However, in certain situations it's best if the code in not syntax highlighted, as in the example I posted. So if CBoard does support syntax highlighting, it should at least not make it mandatory.

Of course, if you have some code that you really want highlighted you can use an external syntax highlighter to do the job for you. This has several disadvantages, however. It's difficult to edit the code once you've syntax-highlighted it -- you have to keep the original code, modify that, and re-highlight it. (Unless the syntax highlighter supports de-highlighting, but that's another story.) As you mentioned, it takes up a lot of space on the server to store all of those tags. And finally, everyone likely has their own favorite highlighting style, so you'll probably highlight your code your way. This could lead to confusion if the styles vary wildly, and readers might be annoyed if the style varies sufficiently from what they're used to. (Ever seen vim's syntax highlighting? . . .)

These two points are what make me believe that syntax highlighting should be supported by CBoard, but it should not be forced upon you. The best way to solve this, in my opinion, is to allow the web browser to use syntax highlighting (like DaniWeb does). You can toggle syntax highlighting if the code is really long, or turn it off if you choose. If it was done properly, you should even be able to choose which style the code is highlighted in.

But of course, until we convince some administrators, we're grasping at moonshine.

Sang-drax
11-09-2007, 12:19 PM
I'm not sure it would be helpful.
Of course it would be helpful!

brewbuck
11-09-2007, 01:14 PM
Of course it would be helpful!

Not if it was applied to everything. It would be a mess. I'd say half the posts here are by people who's code does not compile. When you apply syntax highlighting to syntactically broken code you end up with highlight soup.

laserlight
11-09-2007, 01:27 PM
When you apply syntax highlighting to syntactically broken code you end up with highlight soup.
The good part is that we can then ask them to look at the syntax highlighting and come back to us after they have fixed it, heheh.

gibsosmat
11-10-2007, 12:28 AM
If you figure out a way to manipulate the clipboard under Linux like the Windows code does, let me know -- I'd be very interested in it myself, as I use Linux a lot more than Windows.

Here's what I think. Really long code is immensely easier to read if it's syntax highlighted. However, in certain situations it's best if the code in not syntax highlighted, as in the example I posted. So if CBoard does support syntax highlighting, it should at least not make it mandatory.

Of course, if you have some code that you really want highlighted you can use an external syntax highlighter to do the job for you. This has several disadvantages, however. It's difficult to edit the code once you've syntax-highlighted it -- you have to keep the original code, modify that, and re-highlight it. (Unless the syntax highlighter supports de-highlighting, but that's another story.) As you mentioned, it takes up a lot of space on the server to store all of those tags. And finally, everyone likely has their own favorite highlighting style, so you'll probably highlight your code your way. This could lead to confusion if the styles vary wildly, and readers might be annoyed if the style varies sufficiently from what they're used to. (Ever seen vim's syntax highlighting? . . .)

These two points are what make me believe that syntax highlighting should be supported by CBoard, but it should not be forced upon you. The best way to solve this, in my opinion, is to allow the web browser to use syntax highlighting (like DaniWeb does). You can toggle syntax highlighting if the code is really long, or turn it off if you choose. If it was done properly, you should even be able to choose which style the code is highlighted in.

But of course, until we convince some administrators, we're grasping at moonshine.
I googled a lot for the clipboard program code on Linux. apparently there are 3 types of clipboards on linux provided by different daemons (I am not sure though, somebody on a forum said). to be frank those all asked me to go through that X Windows Communication standards.. I dont know abc of X, I tried a bit though.. but gave up for now.. coz I got my assignments to submit first then I will come back to my linux :D
I dont know bout daniweb.. but it sounds cool to let user choose the highlighting of the code..
if this board could put it up that will be the best to do.. if its not too much of work to get it..


Not if it was applied to everything. It would be a mess. I'd say half the posts here are by people who's code does not compile. When you apply syntax highlighting to syntactically broken code you end up with highlight soup.

ya.. it would be a mess.. but that clearly shows where the prob is.. if a person posts a code that is syntactically wrong how could it be working?
so the next post from other users will be saying you have syntax prob here.. :)
if the original thread starter takes care of it all then fine.. rest all will go smoothly.
I dont find anything we are missing here..
and if it is possible to put up something like the daniweb does then.. there wont be any prob at all..

what do you say guys?

whiteflags
11-10-2007, 02:52 AM
> ya.. it would be a mess.. but that clearly shows where the prob is.. if a person posts a code
> that is syntactically wrong how could it be working?

If a person posts code that is syntactically correct, how could it not be working?
I'm honestly thinking that you're overstating its effectiveness, but that's my opinion. Syntax highlighting has never helped me fix a syntactical issue, at least not like, "Wow! Am I ever glad that Visual Studio uses blue here!" And one could argue that syntactical problems are not the most important ones. I don't know why this continues to be an issue here.

gibsosmat
11-10-2007, 05:06 AM
If a person posts code that is syntactically correct, how could it not be working?
I'm honestly thinking that you're overstating its effectiveness, but that's my opinion.
I never said that syntactically correct code should work the way you wanted it to.. :confused:
my intention is not to say that syntax highlighters fix 90% of the probs posted here..
but they will help users a little in going through the posted code
and if this little comes with not much effort.. then its a good deal..



Syntax highlighting has never helped me fix a syntactical issue, at least not like, "Wow! Am I ever glad that Visual Studio uses blue here!" And one could argue that syntactical problems are not the most important ones.
ok, it never fixed your probs..might because you take care of that even before compiling..
but you never put it off coz it never helped you.. lol.. tell me if you really did

I don't know why this continues to be an issue here.
the issue is not about the posted code is syntactically correct or not..
its about how readable it is..
I say that with highlighting it will be little better than having nothing..

zacs7
11-10-2007, 05:45 AM
No, because most of the problems are logical problems, nothing to do with syntax. When it is, it's usually missing ';' or an odd number of brackets, I don't see how colour can solve either.

Consider the following,


if(foo = malloc(11 * sizeof(bar))) != NULL)


The colours didn't help pick up the missing bracket. Just as colour doesn't make code any easier to read, not to mention it could hinder colour blind users. I would say it's more useless or bad than is worth the effort :)

>I say that with highlighting it will be little better than having nothing..
If you love colour so much, I suggest codeform (http://cboard.cprogramming.com/showthread.php?p=627656), I don't know if dwks still has an online version running, you could always ask him, or you can use the
tags which already exist, so you could say that there is optional syntax highlighting ;)



if((foo = malloc(11 * sizeof(bar))) != NULL)

gibsosmat
11-10-2007, 06:13 AM
No, because most of the problems are logical problems, nothing to do with syntax. When it is, it's usually missing ';' or an odd number of brackets, I don't see how colour can solve either.

Consider the following,


if(foo = malloc(11 * sizeof(bar))) != NULL)
The colours didn't help pick up the missing bracket. Just as colour doesn't make code any easier to read, not to mention it could hinder colour blind users.
normal


if(foo = malloc(11 * sizeof(bar))) != NULL)
userside colored.. (most IDEs/editors do the same)

if(foo = malloc(11 * sizeof(bar))) != NULL)
site Inbuilt coloring

if(foo = malloc(11 * sizeof(bar))) != NULL)keeping lame ppl apart. all I am asking is to give us programming editor looks and not windows notepad
do ppl who think that code coloring is not at all needed OR have probs looking their code colors etc.. put off the syntax highlighting available on their editors/IDEs?

anyway.. is there any editor that colors brackets depending on their matchings? (something like k-colored graph, every adjacent braces have diff color & matching brace has the same color)
I never found one.. except IDE's that parse the code runtime and underline syntax probs.. if we could get that it will be too good :D

lol.. if nothing turns out thats what I want to do..
and these 'code' tags are also making the actual page awkward.. because they are not able to putup scroll bars in the code.. and forcing the whole forum page to put it :P

dwks
11-10-2007, 02:44 PM
I don't know if dwks still has an online version running
Yup, it's still there, though it's been moved. dwks.theprogrammingsite.com/myprogs/cfonline.htm

If you think that syntax highlighting doesn't affect how you read source code, try turning off your favorite editor's syntax highlighting. It's almost unconscious, but it really does make a huge difference.

Take some moderately complicated code from codeform.

/*! Binary searches through the existing variables in \a rt for the position
that the variable \a p should be in, putting the result in \a pos.
\param vars The existing variables to search through.
\param p The text representing the new variable to search for.
\param pos The variable to store the position found in. Set to (size_t)-1
if no match was found.
\return 1 if an exact match (to the shortest length) was found, 0
otherwise.
*/
int find_var_pos(struct rulevars_t *vars, const char *p, size_t *pos) {
size_t mid = (size_t)-1, first = 0, last = vars->number-1;
int v = 0;

*pos = (size_t)-1;

if(!vars->number) return 0;

while(first <= last && last != (size_t)-1) {
mid = (first + last) / 2;

v = strcmp(p, vars->data[mid]->from);

if(first == last && v) break;

if(v < 0) last = mid-1;
else if(v > 0) first = mid+1;
else {
*pos = mid;
first = mid+1;
}
}

if(*pos != (size_t)-1) return 1;

if(v < 0) *pos = mid;
else *pos = mid+1;

return 0;
}
Now I've highlighted it:

/*! Binary searches through the existing variables in \a rt for the position
that the variable \a p should be in, putting the result in \a pos.
\param vars The existing variables to search through.
\param p The text representing the new variable to search for.
\param pos The variable to store the position found in. Set to (size_t)-1
if no match was found.
\return 1 if an exact match (to the shortest length) was found, 0
otherwise.
*/
int find_var_pos(struct rulevars_t *vars, const char *p, size_t *pos) {
size_t mid = (size_t)-1, first = 0, last = vars->number-1;
int v = 0;

*pos = (size_t)-1;

if(!vars->number) return 0;

while(first <= last && last != (size_t)-1) {
mid = (first + last) / 2;

v = strcmp(p, vars->data[mid]->from);

if(first == last && v) break;

if(v < 0) last = mid-1;
else if(v > 0) first = mid+1;
else {
*pos = mid;
first = mid+1;
}
}

if(*pos != (size_t)-1) return 1;

if(v < 0) *pos = mid;
else *pos = mid+1;

return 0;
}
Come on. There is a difference.

And colour-blind people? Yes, it's true that reading coloured code could be difficult to read. I know someone who is colour-blind, and my printer is so bad, that I'm aware of the issues. So use syntax highlighting, but with bold, italic, and underlined text! It would still be much better than ordinary text.

If syntax-highlighting was done client-side, then a colour-blind user could choose to change all syntax-highlighted code to this style, or disable it completely if they wanted to.


anyway.. is there any editor that colors brackets depending on their matchings? (something like k-colored graph, every adjacent braces have diff color & matching brace has the same color)
I never found one.. except IDE's that parse the code runtime and underline syntax probs.. if we could get that it will be too good :D
I actually modified codeform once so that it would do this. Search around the board if you're interested. SlyMaelstrom was the one who requested it.

Ah, that thread was lost when CBoard crashed. I saved it, though. (Along with a few other threads (http://dwks.theprogrammingsite.com/myprogs/down/cbthread/index.htm).) Here it is: http://dwks.theprogrammingsite.com/myprogs/down/cbthread/codeform_632617.htm

whiteflags
11-10-2007, 08:11 PM
> Come on. There is a difference.
Yeah, but the difference is supporters of colored code tags, the people we don't know who start these topics, think that grabbing some code and pasting it into an editor to read is too much work for them, I guess. And people who care usually write something like codeform anyway and take care of it themselves. ;D The OP is welcome to his opinions but I just haven't seen the point.


> And colour-blind people? Yes, it's true that reading coloured code could be difficult to read.
My chemistry teacher was red-green color blind. :) But this isn't the kind of reason I took my stance on the issue. Although, like you said, most IDEs let you print black and white, with boldface and stuff. It looks really nice. I find it saves my color ink!

ssharish2005
11-11-2007, 09:46 AM
I can see many people here suggest having code highlights. But since I have been seeing this the code with no highlights i am pretty used to that. Perhaps for me it donst make any difference at all. I would be more happy with what we have.

And yes code highlights are usefully.


ssharish

dwks
11-14-2007, 01:33 PM
> Come on. There is a difference.
Yeah, but the difference is supporters of colored code tags, the people we don't know who start these topics, think that grabbing some code and pasting it into an editor to read is too much work for them, I guess. And people who care usually write something like codeform anyway and take care of it themselves. ;D The OP is welcome to his opinions but I just haven't seen the point.
This computer that I am working on right now is so restricted all I can run is a web browser. I can't run an editor or anything. (Of course, I could write an online web page which takes code, codeforms it, and sents back the codeformed document for viewing.)

Besides, a lot of the time it wouldn't be worth it to paste it into an editor. When there's only ten lines of code, and as you're typing your response you're continuously referencing the existing code, are you going to bother pasting the code into an editor?

Unless, of course, you write your response in your editor as well, which I've done before, for longish posts.

Here's basically what you're saying. "Yes, syntax highlighting is better, but if you really want it, paste the code into your editor. The board itself doesn't have to support this feature."

I say that

It's often not convenient to paste code into an editor.
It's not always possible to paste code into an editor -- for example, when you can't run an editor.
If syntax highlighting is better, as you seem to agree, why shouldn't the board support it?

gibsosmat
11-14-2007, 02:42 PM
think that grabbing some code and pasting it into an editor to read is too much work for them..
yes it is really.. count the click/movements/keystrokes you need to do?
and generally editors dont color until you save the file with proper extension or force every file that you open to be colored with one lang..
its likely that users get discouraged to go through the post..(atleast in my case, I dont reply long codes and wont like go through :D)
also improving readability will make the posters to reply the topic faster and respond to more threads..
If its not a pain why does every OS we use have quick launches and desktop shortcuts, etc? :p


It looks really nice. I find it saves my color ink!
ya.. that will be nice and cheaper.. but I dont understand what are you trying to save here?
are we using that black google to save power consumed by our screens? lol


i am pretty used to that. Perhaps for me it donst make any difference at all. I would be more happy with what we have.
thats right.. so if the board had the color highlighting you wouldnt have to get used to notepad views.. so its upto the board mods/admins if they want ppl to get used to what the board provides or provide what most users have on their system..



I say that
It's often not convenient to paste code into an editor.
It's not always possible to paste code into an editor -- for example, when you can't run an editor.
If syntax highlighting is better, as you seem to agree, why shouldn't the board support it?
with little edition from my side :D
users can read little faster and respond little more threads
most of the ppl who code will be having highlighting on their editors/IDE, they will feel little more comfortable.. they dont need to get used to anything relating to the look and feel of the code
and also its not something too difficult to put it up for a board..
if we observe the board itself has php coloring as the makers of the board put it for ease of php.. why not we put the same to help ppl using C/C++/C#IMHO I dont find any discussion or debate to be made on this topic.. as this move dosent hurt most of the ppl.. and it helps them..
as a bottom line.. this debate/discussion seems to be going on and on and also not for the first time..

I feel like createing a poll among users with the following options if the admins have no prob to abide by the voting
if anyone of you want to change the suggested poll you can make changes and post it your next post
the number inside the bracket will be the points that will be earned..
and in the end if the poll is positive we will have a syntax highlighting.. else we wont have it


Your comment on syntax highlighting/code highlighting on this Board

I need it (2)
It will useful or comfortable (1)
I dont have prob either with/without highlighting (0)
It will not be useful or uncomfortable (-1)
I hate it/ it annoys me (-2)



what is your opinion?

Perspective
11-14-2007, 02:52 PM
I think the obvious solution here is a firefox plug-in. You could type your code in the regular reply box, hit the menu option and it's code-formed.

That'd be a great feature to set your app apart from the competition too dwks.

gibsosmat
11-14-2007, 03:09 PM
I think the obvious solution here is a firefox plug-in. You could type your code in the regular reply box, hit the menu option and it's code-formed.

That'd be a great feature to set your app apart from the competition too dwks.
thats nice,
but what if he dosent use Firefox?
also we need to make something like that and finally its not efficient too..
so I am thinking of some low cost and efficient method.. referring to my earlier post



ya.. I know that.. I did use the search button provided by the BB. and endedup with lot many threads. finally I saw yours and some discussion on 2 different highlighters. I visited the home page of codeform and downloaded the source and made it.. and I found that I need a clipboard copy commandline.. those sources shipped along with the source are for windows.. I am on linux.. I again googled for command line util, and found that xclipboard is avilable. and then again.. I have to make it save to file go to command get the output into file or clipboard.. or make a command in the editor I am using..
even after all this, there is a lot of overhead thats going into database&bandwidth with that or any other userside developed round about way to color their code for better understand of the other users..
so I was thinking of asking the admins to just put up that mod. interested and known users use it and rest wont..
there isnt much that this Board will be loosing.. its just few more CPU cycles of the server..
so it sounds affordable and better way than other highlightings


I changed mypost a bit in the end take a look at the suggested poll

gibsosmat
11-14-2007, 03:33 PM
I actually modified codeform once so that it would do this. Search around the board if you're interested. SlyMaelstrom was the one who requested it.

Ah, that thread was lost when CBoard crashed. I saved it, though. (Along with a few other threads (http://dwks.theprogrammingsite.com/myprogs/down/cbthread/index.htm).) Here it is: http://dwks.theprogrammingsite.com/myprogs/down/cbthread/codeform_632617.htm

good job.. I just read it.. :D
seems like you have done a lot on this.. nice app :)

brewbuck
11-14-2007, 03:35 PM
If you think that syntax highlighting doesn't affect how you read source code, try turning off your favorite editor's syntax highlighting. It's almost unconscious, but it really does make a huge difference.

To clarify my own statements in this thread, I do NOT think that highlighting is useless. I use syntax coloring in my own environment. I mostly just like being able to see comments clearly.

I was making a more specific statement that highlighting might not be very useful in this forum. Just want to be clear.

Perspective
11-14-2007, 04:26 PM
>but what if he dosent use Firefox?

what? I don't understand... are you saying he doesn't browse the web? or maybe he uses Safari. Got it, we'll make a Safari plug-in too.

gibsosmat
11-14-2007, 04:56 PM
>but what if he dosent use Firefox?

what? I don't understand... are you saying he doesn't browse the web? or maybe he uses Safari. Got it, we'll make a Safari plug-in too.
ya.. that is what I meant..
if we want to do so.. then one for firefox, one for IE, one for safari, xyz browser etc..
its costly.. in terms of effort to put in..

dwks
11-14-2007, 06:42 PM
It's a good idea, but in my case it wouldn't work all of the time. A computer that I use to access CBoard much of the time is extremely restricted. I can only launch Internet Explorer (5.5, or if I'm lucky, 6). I can't open a text editor. I can't run a command prompt. I can't save web pages. I certainly can't install plugins. :)

FWIW, when I use my own computer, I usually use Iceweasel, Debian's version of Firefox. (The DFSG-compatible version.)


are we using that black google to save power consumed by our screens? lol
You mean blackle.com? :)



I feel like createing a poll among users with the following options if the admins have no prob to abide by the voting
It's already been done. http://cboard.cprogramming.com/showthread.php?t=88629
"For" syntax highlighting was more popular by a factor of 3.

I think it's generally accepted that syntax highlighting is a good idea -- it even seems to be a popular idea. (Either that, or the only people who read the threads entitled "syntax highlighting" are those who are in favour of it . . .)

brewbuck
11-14-2007, 08:39 PM
(Either that, or the only people who read the threads entitled "syntax highlighting" are those who are in favour of it . . .)

I think it is highly likely that that's the case.

Seriously, I'm not going to throw a fit if cboard gets syntax highlighting. All I'll say is... "You'll see." :)

dwks
11-14-2007, 09:53 PM
Actually, I think it would be very difficult to see if the code that is syntax highlighted is syntactically invalid. :) Which presumably is your point:

Most of the code posted here is pretty unreadable with or without syntax highlighting. In fact, a lot of the code posted here won't even compile. And you know what syntax highlighting does to broken code, right?

All it takes is one missing */ somewhere and suddenly all your code is highlighted in "comment color."
Have you ever used Dev-C++? It syntax highlights on a line-by-line basis (for strings, at least). This has several advantages for a text editor, not the least that you don't have to syntax highlight dozens of lines whenever the user types a double quote. But another side effect is that a missing double quote only messes up the remainder of the line.

Of course, this is meant to make it easier on your eyes when you're in the middle of typing out code. I don't think it should be used on a bulletin board where you're usually posting semi-complete code. It's just a possibility if strangely highlighted code becomes common.

What do I think? I'm not suggesting that all code should be syntax highlighted. I'm not even suggesting that code should be highlighted by default. I'm suggesting that the capability to highlight code is added, so that you can do it if you want to.

Syntax highlighting on the client side actually makes the most sense, because then the reader can choose whether code is highlighted or not. Not necessarily plugins, but a "toggle highlighting" or "select highlighting style" drop-down box would probably be optimal, in my opinion.

Something like Daniweb has! Except with multiple different styles . . . http://www.daniweb.com/forums/post467177-1.html

Not that I think Daniweb is better than CBoard . . . on the contrary . . . except for syntax highlighting!

whiteflags
11-14-2007, 10:42 PM
> are we using that black google to save power consumed by our screens? lol

Uh, no. In the comment you replied to I meant printer ink. Color toner. I hate the fact that toner these days lasts about 12 pages, and then it's over. True, you just need to go to the store and buy more ink, but I can think of better ways to spend like $25. If I want something to look nice, I print in color, but most of the time I don't. It has nothing to do with my screen.

Regardless, I've still stated my points and the only person who responded intelligently happens to be dwks. I thank him for his input on the issue.

dwks
11-14-2007, 10:53 PM
It looks really nice. I find it saves my color ink!
are we using that black google to save power consumed by our screens? lol

Uh, no. In the comment you replied to I meant printer ink. Color toner. I hate the fact that toner these days lasts about 12 pages, and then it's over. True, you just need to go to the store and buy more ink, but I can think of better ways to spend like $25. If I want something to look nice, I print in color, but most of the time I don't. It has nothing to do with my screen.
I think gibsosmat was wondering if you, a thrifty person who hates to buy colour ink, were also using blackle.com to cut down on your power bill. A veiled insult, or a retort at least . . .


Regardless, I've still stated my points and the only person who responded intelligently happens to be dwks. I thank him for his input on the issue.
You're welcome, and thank you . . .

zacs7
11-15-2007, 04:52 AM
Anyway dwks, that's an awesome idea! (Err, what idea?)

Turn codeform into a firefox plugin! Seriously... I reakon it'd be really thrifty, I'm not sure anything really exists that does that. Just make sure you release an Opera plugin too, I'm not a fan of firefox :)

gibsosmat
11-15-2007, 07:30 AM
... You mean blackle.com (http://blackle.com)? :) ..
ya.. that is what I meant :D


It's already been done. http://cboard.cprogramming.com/showthread.php?t=88629
"For" syntax highlighting was more popular by a factor of 3.

I think it's generally accepted that syntax highlighting is a good idea -- it even seems to be a popular idea. (Either that, or the only people who read the threads entitled "syntax highlighting" are those who are in favour of it . . .)

you did it once.. I can do it again.. and somebody else might do it once more..
we can also make it sticky with a request to mod, and decide the quorum (if needed) and polling time span..
IMHO all these are only possible if the admins/mods are willing to help us, and implement the coloring system if needed
so i didnt put up a poll.. instead I am asking admins if they are willing to implement color coding if the poll succeeds..



.. I'm not suggesting that all code should be syntax highlighted. I'm not even suggesting that code should be highlighted by default. I'm suggesting that the capability to highlight code is added, so that you can do it if you want to.
yeah.. this is what I am suggesting too..
like the code will be colored only if you specify the coloring mode
something like if you only put [code="C"] as the starting tag..
and the normal code will not be colored


a "toggle highlighting" or "select highlighting style" drop-down box would probably be optimal, in my opinion.
I would say this is the best in my opinion if the board could give..
considering the cost of it (effort, price if it is some paid mod, server load, bandwidth consumption.. etc)



Uh, no. In the comment you replied to I meant printer ink. Color toner. I hate the fact that toner these days lasts about 12 pages, and then it's over. True, you just need to go to the store and buy more ink, but I can think of better ways to spend like $25. If I want something to look nice, I print in color, but most of the time I don't. It has nothing to do with my screen.
ya.. I know that, I was just kidding if you want to be some sort of miser saving micro watts from you monitor.. (more info of power saving (http://blackle.com/about/))
its good to save ink.. even I save the color ink.. there is no point in printing all the pages of your code in color just for your project report.. (AFAIK nobody cares your code on paper, they would like to see it working)
but being a soft copy.. it is not a problem until the user has prob with color code..

Sang-drax
11-15-2007, 07:40 AM
Aren't most computer screens LCD screens nowadays? Power consumption for LCD screens is completely insensitive to color, because LCD screens change the color by blocking the backlight, which is always on.

Thantos
11-15-2007, 08:21 AM
Aren't most computer screens LCD screens nowadays?
If only. I think most new screens are LCD but I don't think the total population of monitors has shifted away from CRT yet.

If something like this was to be done then there is really only one proper way to do it: CSS. Instead of doing inline styles with defined colors you use class names (i.e. class="keyword", class="comment", etc). That allows the user to override the stylesheet with their own class definations so they get the colors how they want (the colors used in dwks's are really bad too me). You can then also use the print media stylesheet to turn off the coloring.

Perspective
11-15-2007, 10:37 AM
if we want to do so.. then one for firefox, one for IE, one for safari, xyz browser etc..


nah, I think we'd be pretty much covered with firefox and safari. :D

Thantos
11-15-2007, 02:01 PM
People use those two POS browsers? They are only a step above IE...

;)

CornedBee
11-15-2007, 02:32 PM
Trying to derail the thread by starting a browser war?

Thantos
11-15-2007, 03:58 PM
It'd be about as useful.

gibsosmat
11-15-2007, 05:11 PM
well in that case.. everyone make their own plugin for their browser :p
or join me in this campaign and vote for 'I need colored codes' :D

Before that..
Admins/Mods tell me if this is a fair poll and you will put up color coding system if this poll succeeds?

time for the poll 10 days..
Suggested poll
Your comment on colored syntax highlighting/code highlighting on this Board
I need it. (2pts)
It will be useful/comfortable for me.(1pts)
I dont have prob with/without highlighting. (0pts)
It will not be useful/comfortable for me. (-1pts)
I hate it. (OR) I have problem with that. (-2pts)

zacs7
11-16-2007, 01:33 AM
Er that's a retarded poll. Either you want highlighting or you don't their can't be in between.

In case you haven't noticed this board isn't a democracy -- because the community doesn't pay to have it run. In the end it's up to those who run and pay for these boards.

gibsosmat
11-16-2007, 05:59 AM
hmm.. may be there is no need of so many choices..
I just put it up so that ppl will choose what is appropriate for them..
if there were only 2, what would someone like who dont want color coding so much as the others want..
so to fulfill them I put it up..

ya.. I did notice it.. democracy will be something that involves us everywhere, here we are paying nothing for the boards expenses..
so I did ask the admins to consider the cost of putting up color coding


considering the cost of it (effort, price if it is some paid mod, server load, bandwidth consumption.. etc)
if they confirm that its difficult in the current scenario then, I will save my breath :)
there is no point discussing it again and again if they cant put it up for some administrative reasons..

I am thankful to this board with or without the code coloring..

its just a wish to have highlighting..
if it is fulfilled it will be fantastic, else its already fine the way it is :D
except few unlucky ppl rest all have color coding editors and god gave hands to work :p

dwks
11-17-2007, 05:16 PM
(the colors used in dwks's are really bad too me)
Mmm hmm, I sort of picked them at random, and I'm overly fond of blue . . . but you can easily use the Dev-C++ or SciTE styles, which is someone else's idea of nice colours, or create your own rules file based on these, incorporating your idea of nice colours. :)