20
votes
Accepted
What to do with <!-- language: bash --> edits?
Yes, syntax highlighting of anything more than a couple of lines is a readability improvement. While the software used to apply syntax highlighting isn't all that great, it has rendered obvious some ...
18
votes
What to do with <!-- language: bash --> edits?
Just look at the examples. Does it matter?
If you are used to read syntax highlighting in a specific language:
YES
The other way around, on e.g. a .desktop file, (default bash) highlighting can be ...
10
votes
Community consensus regarding using backticks or 4 spaces for code
My personal preference is to use the triple backtick as that's the most common way to set code blocks in Markdown outside of Stack Exchange. I find it much easier to use.
When I am editing someone ...
9
votes
Automatically wrapping lines in Ask Ubuntu
Click the gray circle with a question mark inside it in the upper right corner of the Ask Ubuntu markdown editor to show the link for advanced help (in red letters) which tells all the rules for ...
8
votes
Code Block Limit of 30000 characters
Unless a new code-block-specific limit has been introduced recently (and not talked about), the limit is for the whole post, not specifically for a code block. If you pasted code in and didn't hit the ...
8
votes
What to do with <!-- language: bash --> edits?
Here's just my 2-cents on this:
color highlighting improves clarity and readability of code, hence improves clarity and readability of the edited post, makes it easier to read (related post).
they're ...
7
votes
Accepted
How to properly add code in comment
In comments you are limited to just test test which is generated by the code:
`test test`
There is no way to get the larger code bar like in your example or in the line above this in a comment. ...
Thomas WardMod
- 76.3k
5
votes
Presentation of code should include explanation in a separate comment section
My two cents to just those two points you raised:
users may mistakenly take in code comments as part of the provided solution
The syntax highlighting prevents that very well, for example:
#!/bin/...
4
votes
Accepted
How do I use the grey formatting in a comment?
I was using the wrong character. I thought the directions said to use the apostrophe character ( ' ) but they said to use the backtick character ( ` ) which was a subtle difference that I wasn't ...
4
votes
What to do with <!-- language: bash --> edits?
I also came across edits of this type and treated them as follows:
Approve
if the edit actually improved the post by triggering correct syntax highlighting while it wasn't possible to just add a tag, ...
4
votes
Community consensus regarding using backticks or 4 spaces for code
Just like Dan, I don’t think we need a consensus. In your posts, use whatever you want (but keep the difference of in-line vs. block code formatting as Mark Kirby noted).
However, if I edit someone ...
3
votes
Community consensus regarding using backticks or 4 spaces for code
I don't think it makes any difference at all. I am very used to the 4-spaces indentation, my muscle memory works that way and there is a nifty userscript that means I can indent by just selecting text ...
3
votes
Community consensus regarding using backticks or 4 spaces for code
I actually know of five ways to format code on SE, not including the editor button (click edit to see):
back ticks
html
four spaces
blocks using back ticks
blocks using tilde
I know, that is even ...
2
votes
Accepted
How to write the grave accent to add code in the comment section?
As far as I can see, the ` is the top left standard key (to the left of the 1) on both US an UK keyboards.
Images from Wikipedia.
UK Keyboard:
US Keyboard:
1
vote
Presentation of code should include explanation in a separate comment section
I think people not explaining what code does is a much bigger problem on this site than code comments being unwieldy.
My first question about your feature request would be does it make it more ...
ZannaMod
- 71.2k
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
code-formatting × 16discussion × 7
support × 5
formatting × 5
bug × 4
comments × 3
feature-request × 2
editing × 2
asking-questions × 1
suggested-edits × 1
community × 1
markdown × 1
code × 1