The funniest part of this whole thing is people crying about the PHP tag when it was first introduced ... because it colored everything. People, and I won't mention any names, got pretty upset about people using the PHP syntax coloring. It's pretty hilarious now that they are trying to actually get it colored by default.
PS to you know who you are: No, I'm not talking about what you think I'm talking about, I'm actually talking about the PHP tags.
Quzah.
Hope is the first step on the road to disappointment.
Just a thought... I don't know if this is possible...
Can you rename a BB code tag?
If so rename the PHP tag CODE
rename the CODE tag PRE
real easy fix.... if it's possible.
@quzah Yeah, I know about the PHP tag, but I don't particularly like them since it's doing PHP coloring and not C++, so the results aren't going to be as accurate. (I also don't particularly like the choice of colors although I imagine that must be configurable somewhere.)
@CommonTater If we were going to use php tags, I'd simply change the board to treat [code] blocks as PHP highlightable code, rather than having folks use php tags manually. The value of automatic highlighting is to make it consistent and apply to older posts in addition to new posts. I don't see the value of the [pre] idea--the choice of whether code should be highlighted should belong to the reader, not the poster, unless the poster wants to do some kind of special highlighting.
With respect... if there's a ready-to-use answer on hand I don't see the problem. The other highlighter was rather, um, kludgey requiring browser refresh and redraws to make it show up... I'm thinking this might be a good time to just take the path of least resistance...
Exactly... that was why my (perhaps clusy) suggestion of simply renaming tags... I think we agree on this point.@CommonTater If we were going to use php tags, I'd simply change the board to treat [code] blocks as PHP highlightable code, rather than having folks use php tags manually.
Ummmm.... not sure what you mean or how you would do that. One might reasonably expect that highlighting should be the default unless the reader wants to turn it off in their settings... The pre idea was taken from the HTML PRE tag that allows preformatted text... adding that, by whatever name, gives the poster the choice to highlight or not...I don't see the value of the [pre] idea--the choice of whether code should be highlighted should belong to the reader, not the poster, unless the poster wants to do some kind of special highlighting.
Just thinking out loud... but if it's not too much trouble to rewire the code tags to act like php, how about we give it a try?
Last edited by CommonTater; 09-20-2011 at 09:50 PM.
Is there a way to add to this "to do" list? Such as along with code coloring, an auto format (e.g. indent) tool? I can't imagine this would be too hard to add to the parser, and it would save a lot of time trying to decipher some posts. Many times it is in fact that the OP doesn't know how to indent, however there are also many examples of the formatting being broken when the code is copied and pasted from the editor. "The whitespace disaster phenomenon". This could be resolved by auto-formatting, however I am not sure of the overhead this would create for the sites wrt post times and all that other stuff I am not familiar with.
How would that handle different indent styles? Or are you proposing that an indent style be mandated?Originally Posted by AndrewHunter
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
It would have the side effect of mandating an indent style, however if you can turn off the highlighting you could do the same with the indentation. I was looking at a way to avoid posts where the code winds up all across the board like this and this thread. That way the responders can focus more on the problem at hand; you have to admit that some posts are just down right unreadable.
As for which style to choose, I would imagine something that was close to "How to indent code" would be both easy to implement programatically and shouldn't be too much of a matter of debate. Both you and I, as well as many others, have reformatted posts prior to addressing issues; I wouldn't see why we wouldn't want to alleviate that problem.
EDIT: Note that the link is not my chosen indentation style, so I am not "playing favorites" here.
Hi Andrew... the only problem with your suggestion is that it really doesn't help people develop their own coding skills...
Sad fact... when things are done for people, they soon enough don't want to do it for themselves.
Me... I'd be happy just to see line numbers!
I agree, however I do not think it would rob them of learning how to indent; just not on this board. Either way, it was just a suggestion to alleviate some formatting issues. I can just as easily make a little app to do it for me if the popular opinion here is that no one sees an advantage to it.
BTW, Hi Tater!
Me too. There would no "user preferences" to consider, and we get to refer to line numbers without confusion.Originally Posted by CommonTater
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
As long as the line numbers were embedded with the formatting so we could still just do a direct copy and paste into an IDE. As for anything else, I don't mind either way; I will just add a formatting option to the highlighter I use and keep on doing what I have been.
The version they have (had?) in place now with [code] does line numbering, and you can even click-drag-copy-paste and it won't add the line numbers. It's pretty nice (except for having to shift+reload to get it to show up) except for the color choices.
Quzah.
Hope is the first step on the road to disappointment.