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

Post History

60%
+1 −0
Q&A How to structure a sentence containing long code examples?

In my opinion, any answer looks messy. One "sentence" with capitals halfway through bugs me; so does a line starting without a capital. Personally, I would restructure the entire thing to avoid th...

posted 10y ago by Watercleave‭  ·  last activity 5y ago by System‭

Answer
#3: Attribution notice added by user avatar System‭ · 2019-12-08T04:06:37Z (about 5 years ago)
Source: https://writers.stackexchange.com/a/16514
License name: CC BY-SA 3.0
License URL: https://creativecommons.org/licenses/by-sa/3.0/
#2: Initial revision by user avatar Watercleave‭ · 2019-12-08T04:06:37Z (about 5 years ago)
In my opinion, any answer looks messy. One "sentence" with capitals halfway through bugs me; so does a line starting without a capital.

Personally, I would restructure the entire thing to avoid the issue entirely:

### Example 1

> Currently, line 57 of _camera.py_ looks like this:
> 
> camera.start_recording('foo.h264', quantization=25)
> 
> In this line, the parameter `quantization` needs to be replaced with `quality`, giving us this:
> 
> camera.start_recording('foo.h264', quality=25)

### Example 2

> Look at Figure 1 below. Our code currently contains line (1); we need to replace it with line (2).
> 
> (1) camera.start_recording('foo.h264', quantization=25)
>     
> (2) camera.start_recording('foo.h264', quality=25)
> 
> **_Figure 1_** - Two versions of line 57 of the code in camera.py

(Obviously I don't know your code file name, line numbers, or programming language. Substitute where necessary. "camera.py" can be replaced with Example 1 if you're taking that route.)

#1: Imported from external source by user avatar System‭ · 2015-03-17T21:05:41Z (almost 10 years ago)
Original score: 6