The reason code is usually limited to 80 characters is because old screens used to have only 80x20 characters. The reason screens were 80 characters wide was that typography rules say you should have about 66 letters per line for optimal readability, and with a bit of arithmetic on average word length (and maybe a fondness for round numbers), that corresponds to about 80 characters when counting spaces and punctuation.
What I’m trying to say is I agree text should not expand forever, but I do think “about 80 characters” works well for both text and code.
Also note that you could have wider text without justification as well as narrower text with justification.