2

Sometimes I want to pluralize a Python class name, but the plural "s" should not be monospace, since it's not code. For example this answer:

Screenshot of answer with the text "For more about Sessions"

The letters should line up.

17
  • 3
    "The letters should line up." How would you suggest it does?
    – Cerbrus
    Commented Jul 27, 2022 at 7:23
  • 3
    Looks nice to me Commented Jul 27, 2022 at 7:30
  • 2
    So...this is actually a more valid point than it might initially seem. The font-size of inline code blocks is 13px, while post body text is 15px. Adjusting the former to 15px does make it line up a bit better.
    – Ryan M Mod
    Commented Jul 27, 2022 at 7:54
  • But it still looks ugly to mix them, @RyanM.
    – Cody Gray Mod
    Commented Jul 27, 2022 at 8:07
  • 2
    I have never claimed to be a designer. I'm just pointing out the problem :-)
    – Ryan M Mod
    Commented Jul 27, 2022 at 8:09
  • 2
    The solution to this problem does not require a designer, @RyanM. It needs a doctor.
    – Cody Gray Mod
    Commented Jul 27, 2022 at 8:19
  • 2
    @CodyGray you sound like Steve Jobs. I talk like this, so I should be able to write like this.
    – user3064538
    Commented Jul 27, 2022 at 8:21
  • 2
    You talk with inline code formatting? Do you, like, switch to a monotone when reading text formatted in a monospace typeface? I guess that's kind of cool. Probably also annoying. What a coincidence. :-)
    – Cody Gray Mod
    Commented Jul 27, 2022 at 8:22
  • you know exactly what I mean. I mean when I talk I pluralize nouns that are code. When I write nouns that are code, I write them in monospace, but putting the plural in the monospace would be wrong because the "s" is not code.
    – user3064538
    Commented Jul 27, 2022 at 8:23
  • I did not know what you meant. Yes, of course, you grammatically inflect identifiers that happen to be used in code. So do I. But that brings us back to the point: when you read code aloud, you do not demarcate it in any special way. You assume that your listeners can figure out from context that "Session" is a class name. So, why would it be different when you write/type it? If you don't need some kind of special code formatting when you speak, why do you need it when you format text in an answer? It should be clear from context, without the need for an eyesore.
    – Cody Gray Mod
    Commented Jul 27, 2022 at 8:25
  • 2
    @CodyGray why do we ever monospace code? Whatever your answer is why I want to do it in line. The "eyesore" is the fault of the design, not my fault for mixing fonts. It's possible to make mixed monospace and regular fonts look nice, I will find you an example.
    – user3064538
    Commented Jul 27, 2022 at 8:26
  • 2
    @BorisVerkhovskiy "why do we ever monospace code? Whatever your answer is why I want to do it in line" but that's not really correct. Grammatically. If you want to talk about "sessions", then that's not the concept is not code. It seems you're linking to documentation about some thing called Session (I hope it's some sort of class) in which case you don't talk about multiple of them. The correct wording would be "To learn more about Session : <link to documentation on Session>. If you want to talk about multiples of Session, then it's probably "Session objects"
    – VLAZ
    Commented Jul 27, 2022 at 8:30
  • 2
    @VLAZ what if I want to say "you're going to get a bunch of RuntimeErrors"? I know I can rephrase anything to add a space after the code, but I want to phrase things the way I phrase them.
    – user3064538
    Commented Jul 27, 2022 at 8:41
  • 1
    "This will raise a RuntimeError multiple times" or "You will get multiple instances of RuntimeError with this code" Sure, you can also pluralise it but it's a bit awkward to work into written text anyway. It's not hard to reword slightly. Written text does not need to conform 1:1 with spoken word rules. Sometimes we avoid some spoken and/or informal rules. Similar to how for a Q&A on the site we should avoid writing things like "this code slaps" or "for loops are strong in this meta".
    – VLAZ
    Commented Jul 27, 2022 at 8:51
  • BTW you can also just say "you're going to get a bunch of runtime errors" - the term "runtime error" is already a thing already. You don't really need to use the class name. Assuming it's clear that it's going to be a RuntimeError or that the actual exception class doesn't matter since you're just referring to errors that all happen at runtime.
    – VLAZ
    Commented Jul 27, 2022 at 8:53

1 Answer 1

5

So the cause of this is that ...well, they are misaligned. By 2 pixels:

line showing that the body text is 2px taller than the code block

The fact that it's 2 pixels is unsurprising, given that the font-size of inline code blocks is 13px, while post body text is 15px.

Adjusting the font-size of code to 15px does in fact make it line up better:

more lined-up text

6
  • 4
    That gap in the word cannot be unseen though. This reminds me of that old saying we're not allowed to use anymore. Polishing a t... eapot.
    – Gimby
    Commented Jul 27, 2022 at 8:37
  • Yeah, it could probably use some other adjustments...but it looks less bad, at least.
    – Ryan M Mod
    Commented Jul 27, 2022 at 8:39
  • 1
    But then code blocks just get too large and bold due to the different font, so this isn't really a solution.
    – Cerbrus
    Commented Jul 27, 2022 at 11:30
  • 1
    I'd personally lean toward applying this to just inline code blocks, and leaving non-inline code blocks with the current, smaller font size.
    – Ryan M Mod
    Commented Jul 27, 2022 at 13:53
  • 3
    Text is typically aligned on the baseline. So if the bottom of the ses in Session don't line up with the bottom of the terminal s, then there's something wrong. Obviously, it's trivial to simply reword the sentence to avoid the problem altogether: "Read more about the Session object" ;-) Commented Jul 27, 2022 at 15:05
  • @HereticMonkey Ugh. Code markup inside a link. You do your chosen screen name justice.
    – Gimby
    Commented Jul 29, 2022 at 15:14

You must log in to answer this question.