Thread: [site suggestion] syntax highlighting hack/mod for BB

  1. #16
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    > 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!

  2. #17
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    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

  3. #18
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Quote Originally Posted by citizen View Post
    > 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.

    [edit] 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?
    [/edit]
    Last edited by dwks; 11-14-2007 at 01:45 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #19
    Devil™
    Join Date
    Oct 2007
    Location
    IIT-Kharagpur, India
    Posts
    104
    Quote Originally Posted by citizen View Post
    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 )
    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?

    Quote Originally Posted by citizen View Post
    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

    Quote Originally Posted by ssharish2005 View Post
    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..

    Quote Originally Posted by dwks View Post
    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
    • 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
    Quote Originally Posted by Suggestion Poll
    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?
    Last edited by gibsosmat; 11-14-2007 at 03:02 PM.
    C's Motto: who cares what it means? I just compile it!!

  5. #20
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    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.

  6. #21
    Devil™
    Join Date
    Oct 2007
    Location
    IIT-Kharagpur, India
    Posts
    104
    Quote Originally Posted by Perspective View Post
    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

    Quote Originally Posted by gibsosmat View 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
    Last edited by gibsosmat; 11-14-2007 at 03:13 PM.
    C's Motto: who cares what it means? I just compile it!!

  7. #22
    Devil™
    Join Date
    Oct 2007
    Location
    IIT-Kharagpur, India
    Posts
    104
    Quote Originally Posted by dwks View Post
    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.) Here it is: http://dwks.theprogrammingsite.com/m...orm_632617.htm
    good job.. I just read it..
    seems like you have done a lot on this.. nice app
    C's Motto: who cares what it means? I just compile it!!

  8. #23
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by dwks View Post
    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.

  9. #24
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    >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.

  10. #25
    Devil™
    Join Date
    Oct 2007
    Location
    IIT-Kharagpur, India
    Posts
    104
    Quote Originally Posted by Perspective View Post
    >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..
    C's Motto: who cares what it means? I just compile it!!

  11. #26
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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 . . .)
    Last edited by dwks; 11-14-2007 at 06:48 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  12. #27
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by dwks View Post
    (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."

  13. #28
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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:
    Quote Originally Posted by brewbuck
    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!
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  14. #29
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    > 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.

  15. #30
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Quote Originally Posted by citizen View Post
    Quote Originally Posted by citizen
    Quote Originally Posted by gibsosmat
    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 . . .
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 07:33 AM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM