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.

Code:

/*! 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:

Code:

/*! 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.

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

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. [/edit]

[edit=2] Ah, that thread was lost when CBoard crashed. I saved it, though. (Along with a few other threads.) Here it is: http://dwks.theprogrammingsite.com/m...orm_632617.htm

[/edit]