Fellow member @SteveC has been doing diligent work editing questions and answers to put the names of Dungeons & Dragons terms into code text: from Toughness to Toughness
, as an example. Is there a practical benefit on the site in doing so, or is it just an aesthetic preference?
7 Answers
Code formatting should never be used for non-code markup.
Semantic markup (like code tags) was not added just to make HTML pages pretty, it was added to make the structural meaning of parts of the page comprehensible to software so that it can be rendered correctly. Misusing it can have unexpected consequences, especially for users who use accessibility software to render the page. For example, visually impaired users might hear code tags spelled out, instead of given spoken emphasis as intended.
Code formatting means code (more generally speaking, a copy-and-paste text target), and is not for giving visual emphasis to stuff that isn't code. To give words emphasis (for technical terms or otherwise) that is correct regardless of how the user is rendering the page, we are obligated to use bold and italic, which are provided by semantic HTML precisely to produce an emphasis effect in all contexts.
-
\$\begingroup\$ As of the date for this comment the link in this answer goes to a page that doesn't make any mention to visually impaired users hearing media spelled out. Remove or replace? \$\endgroup\$ Commented Mar 6, 2021 at 14:48
I feel that other formatting would be more appropriate than code tags. It's highly unusual for that formatting style to be used for every book title and game term, and some users may not appreciate their questions and answers being edited to include a non-standard formatting type.
It doesn't adhere to the HTML5 specification for the 'code' element, which specifies that it is used to represent a "fragment of computer code", including a string that a computer would recognize such as a filename or program name.
I also feel that in the current design, it breaks the flow of text and makes the proper nouns stand out too much, when simple capitals or italics would suffice.
The following are more standard:
- For D&D spells, lowercase italics: summon monster i
- For book titles, italics: Eberron Campaign Setting
- For proper nouns including D&D magic items and feats, plain capitals: Hand of Vecna, Power Attack, Argonessen, Dragonborn, Monte Cook
-
7\$\begingroup\$ The code tags kinda feel like GM-read-aloud text to me. :) \$\endgroup\$– Alex PCommented May 25, 2012 at 0:24
-
6\$\begingroup\$ It reminds me of the Orz from Star Control II. Do you know? Orz can
dance
very well. Now you are ahappy camper
and Orz can makeheavy space
ships fordancing
. \$\endgroup\$ Commented May 25, 2012 at 1:55 -
6\$\begingroup\$ This is a good point. Messing with the tags messes with the page's HTML semantics. That might actually be a problem for site visitors who use accessibility technology in order read the page. \$\endgroup\$ Commented Jun 1, 2012 at 1:03
I prefer putting special terms in bold font, but can live with the code formatting.
I think SteveC's format for DDI links is sub-optimal though and have been pondering mentioning it. I find having the ddi link sitting all by itself in brackets after each linked term interrupts the text.
-
1\$\begingroup\$ yeah I'd rather just link them. Assume if its a link to a 4e concept its probably DDI \$\endgroup\$ Commented May 8, 2012 at 13:57
-
1\$\begingroup\$ I'm good with the code formatting as well as it gives us a specific standard text for RPG/system terms. \$\endgroup\$ Commented May 8, 2012 at 14:01
-
1\$\begingroup\$ Also, by making the special term the link itself, it no longer needs any other formatting. If every special term links to the page talking about it, they stand out enough. \$\endgroup\$– dlras2Commented May 9, 2012 at 22:53
Code has just few valid aplications for RPG, it should not be used for others:
- proper code in a programming language
- by extent command code for a plugin/program/page such as anydice
- pseudocode isn't proper code but highly relies on code structuring
Examples
An example for proper code using BASIC. This is a non-aborting loop that just continiues to print the line 10 onto the screen until the program is manually halted:
10 print this SPAM was made using 2 lines of program code
20 goto 10
An example for command code, using the cmd of your PC to access the system32 folder in windows and then listing the contents:
C:
cd windows\system32\
dir
An example of pseudocode, using the TDE rules for HP at 5 or lower. The formating chosen here is "LSL Style":
if (5>=HP>=0)
{
Dying = FALSE;
if ("Iron Will" == TRUE)
{Unconscious = FALSE;}
else
{Roll = 1d20;
if (Roll<=CONstitution)
{Unconscious = FALSE;}
else
{Unconscious = TRUE;}
}
}
else if (0>HP)
{
Unconscious = TRUE;
Dying = TRUE;
}
-
3
-
\$\begingroup\$ It may be best to avoid code tags even for code whenever possible since they break screen readers. \$\endgroup\$ Commented Jun 17, 2020 at 4:57
It has the practical benefit of making keywords standing out.
The way this has been done does not meet my personal aesthetic preference.
Also, it's difficult to define a rule when doing this kind of review.
How Deep?
Which are the terms to be formatted?
If a system has a clear definition for attack, should the word attack
be formatted? Should it be formatted when appearing as a noun, as verb or both?
How Far?
Should every keyword and definition in a post be formatted? Some technical answers and questions could become a clutter of formatted keywords that really defeats the purpose of formatting them in first place.
Should someone format only the terms relevant to the question title? The, who defines how distant from the original topic a term is?
Should the formatting being used only on the term's first occurrence in the text or every time the term is used?
Yes. Years ago my D&D group got into a stupid argument over the interpretation of a rule. Shocking, I know. IIRC the debate was whether or not Fireball would clear out a mage's Mirror Images. The text we got hung up on was:
Any successful attack against an image destroys it.
Basically we weren't sure if "attack" was a game term or not. A successfully cast fireball attacks an image. But no attack roll is made, so no game term attack has ever taken place.
I would argue that there should be syntax to indicate what is and isn't meant as a game term. Of the available syntax, code makes sense to me. I also wouldn't want to imply that bold or italics couldn't be used elsewhere because they were reserved for game terms. I see no other use for code text, so why not use it in this way?
That said, most of the time applying code is just being pedantic. I wouldn't use it everywhere, only when it resolves ambiguity.
-
3\$\begingroup\$ If the rulebooks themselves aren't even clear about what is and isn't a technical term, how then would we decide which terms get technical-term-markup? \$\endgroup\$ Commented Dec 11, 2012 at 17:35
-
1\$\begingroup\$ @SevenSidedDie the source text in my example is vague. That doesn't mean I'd like to be vague when I ask a question. If I want to know about game-term-attack I wouldn't want someone to think I was talking about colloquial-attack. \$\endgroup\$– valadilCommented Dec 11, 2012 at 18:40
As mentioned in certain comments, there is a practical benefit to putting things in code text: It changes the appearence of the text. Since a largely text-based site is a visual medium, any form of unusual formatting can be used to highlight or draw attention to important phrases and terms. Of course that's useful!
Yes, it could potentially be overused or used poorly, but you could say the same thing about exclamation marks. Are they useful?
Anyway, highlighting is not the purpose the code text boxes were introduced for, but neither was the stack overflow QA site format designed for questions about role-playing games. In both cases, the new use to which they have been put works for us. What's the problem?
-
4\$\begingroup\$ Depends on how you feel about the editing tally and the reputation that arises from it. I could easily go back through the archives and change the spelling of words and the use of punctuation to match U.S. English rather than U.K. English; it would suit my aesthetic sense just fine. But I don't think I'd consider those "useful" edits; I wanted to poll the community and see whether this falls into that category or not. \$\endgroup\$– JadascCommented May 24, 2012 at 21:28
-
\$\begingroup\$ @Jadasc Ah, I see - I misinterpreted your question as being whether code text was useful at all, but it was about whether editing code text into existing answers was useful. I shall think about it, and change my answer. \$\endgroup\$– GMJoeCommented May 25, 2012 at 2:16
-
\$\begingroup\$ @ Jadasc So, to clarify, would you say that your question is about whether there's a benefit to using a single standard of formatting? Or is it about whether this particular element should be included in an existing implicit standard? \$\endgroup\$– GMJoeCommented May 25, 2012 at 6:04
-
\$\begingroup\$ If I understand you correctly, the second. The page where one accepts or rejects suggested edits asks you to accept those edits that are correct and reject those that are wrong. I was looking for a consensus as to whether this is a type of correct edit or not -- it doesn't change the content at all; just reformat it in a way that's arguably more pleasing. If it were an answer or a question, I'd vote it down. However, that's not available to me on edits — it's either accept or reject. \$\endgroup\$– JadascCommented May 25, 2012 at 11:45
-
\$\begingroup\$ @Jadasc My version of the accept/reject screen has an "improve" button (maybe that's just a mod thing?) that'd allow you to pick out the bits you like on the fly. \$\endgroup\$– AceCalhoon ModCommented May 25, 2012 at 13:20
-
\$\begingroup\$ @Jadasc Ah... In that case, I don't really have an opinion on the matter. The way I see it, if an individual answer or question is made more readable by the addition of code formatting, than that's a good thing - but if there's no effect (such as when the code formatting is just replacing existing bold formatting) then it probably shouldn't be approved. To put it another way, I can't honestly say whether code format is better or worse than the obvious alternatives. \$\endgroup\$– GMJoeCommented May 28, 2012 at 8:12
-
5\$\begingroup\$ Screen-readers will also render code-text as code, which is undesireable. Abusing the semantics of semantic HTML tags (and the code ticks do generate HTML
<code>
tags) is considered harmful. Bold, italics, and Title Case are three valid choices before we need to go abusing semantic HTML tags. \$\endgroup\$ Commented Dec 11, 2012 at 17:31 -
\$\begingroup\$ @SevenSidedDie Hmm, that is undesirable. Nevertheless, it doesn't make code text useless, just less useful (and not as good an option as some alternatives), so I'll leave my answer as-is. \$\endgroup\$– GMJoeCommented Dec 12, 2012 at 5:35
this
is no different in effect than doing this or this, then I'd call it an aesthetic choice. \$\endgroup\$irritated
(situational aspect!) with your question. Alternatively, I am irritated. But I am definitely not irritated. \$\endgroup\$