Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the "town hall" (meta-discussion site) for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Comments on Code blocks need to be at least 80 characters wide

Post

Code blocks need to be at least 80 characters wide

+1
−0

80 characters is a standard width in programming, so lots of code is written to that size, e.g. Python and Shell according to Google's style guides.

However, Codidact code blocks are only about 72 characters wide. Here's a screenshot of a line of 73 characters that overflows:

screenshot of overflowing code in a post

This is inconvenient for coders, so it would be good to show more characters per line, whether that's by A) widening a post body or B) shrinking the font in a code block. It looks like CSS font-size: smaller; or font-size: small; would work for this, though these have subtly different meanings.

As a workaround, I've written a userstyle:

pre {
  font-size: smaller;
}

Here's what it looks like now:

screenshot of smaller code in a post so it no longer overflows

History

2 comment threads

Another way to add a few characters of width (3 comments)
This is screen and zoom dependent - the linked post fits fine on the screen I'm using right now. In m... (4 comments)
Another way to add a few characters of width
trichoplax‭ wrote about 2 months ago · edited about 2 months ago

I'd also like to see 80 characters visible on desktop (I understand that less will be visible in portrait mode on a phone). One way to widen the post body without widening the page as a whole is to put the voting buttons above the post rather than to the left of it. This approach is already taken on mobile, and I've suggested taken the same approach for desktop too: Mobile style voting buttons to match post width to preview width and reduce horizontal scrolling.

That would only increase the visible characters from 72 to 76 (at least on my machine - this may vary by a character or 2 depending on browser and operating system). I'd still like to see 80 characters available if possible. Mentioning this as a step in the right direction.

Moshi‭ wrote about 2 months ago

The most obvious waste of space is probably the sidebar. It doesn't extend to the bottom of the page, so there's a large area of blank space to the right as soon as you get past it.

trichoplax‭ wrote about 2 months ago

I wonder if the sidebar should be removable? Either collapsible per page or as a user setting.

I was also wondering if the empty space either side of the standard width could also be reclaimed on wide screens (perhaps as an opt in user setting).