Game Development Community

Request: addition to the code block options

by Novack · in Site Feedback · 05/26/2009 (7:31 pm) · 9 replies

View^ Print^ ?^ Copy^

Please?

PS: also [b ] tags dont work inside code blocks.

#1
05/26/2009 (7:51 pm)
I'm glad that [b ] and especially [i ] don't work in the codeblocks. Yes it would be nifty to have, but how would you account for variables/arrays/iterators purposefully named i or b?
#2
05/26/2009 (7:54 pm)
Lol, you are right.
#3
10/17/2009 (4:33 pm)
Quote:but how would you account for variables/arrays/iterators purposefully named i or b?

Because they're not followed by
[/b]
See,
[i]
by itself should have no special meaning, as it has no closing tag.

And in the case where you want to mix tags with i or b iterators like say
[i]specialArray[i] = value;[/i]
you could have an escape character like
[i]specialArray \ [i] = value;[/i]
to differentiate.

Or to make things easier still, just use the HTML spec < > instead of the square brackets. Far less likely to encounter conflicts in code with those.

I used to make good use of bold and italics in code blocks to highlight specific changes/fixes that were otherwise difficult to spot. I was a bit miffed when this feature disappeared.
#4
10/18/2009 (6:00 am)
Good points. Highlighting within code blocks is definitively useful.
#5
11/10/2009 (1:58 am)
See.. I would have used bold here. Trying to spot all the changes from %this to %obj and %obj to %this is a PITA without that visual aid.
#6
11/10/2009 (12:48 pm)
i definitely used codeblock bolding back on the old site,
but in retrospect i think it's better not to,
because of the danger of the markup tags being mixed in with code.
ie, code snippets are better as close as possible to a plain flat file.

actually, codeblock markup on the GG site was why i personally switched my default integer variable name from "i" to "n". heh.
#7
11/10/2009 (2:56 pm)
Ok. So allow <html> style syntax. You're not very likely to have a Vector<?> of type "i" are you?
#8
11/10/2009 (3:03 pm)
i hear you, and you may be right,
i just feel nervous mixing anything that's not code in with code.
like, i want to be sure i can cut-and-paste from a post and the stuff compiles. .. which, yes, with proper rendering is possible, but suppose the rendering styles change again in the future, then that previously marked-up code may be uncompilable again.
#9
11/10/2009 (7:09 pm)
Valid concerns to be sure. Though for me, I'd rather have the option. Leave it to the authors discretion to use such tags or not. If it's a Resource or something like "here's a useful function I wrote", it probably should not be marked up in any way. If it's just a small "let me help you by pointing out a few errors" kind of thing then some markup may be warranted.

And should the web developers want to change what makes a valid markup tag at some point in the future, well.. you know what used to be allowed, and how it was supposed to be displayed. It's not difficult to write a filter to go through old content and clean it or convert it to new standards.