9

My personal preference is to the 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 some else's post though, if it's a small piece of code, I just select it and click on the {} button in the editor. The default behaviour of that button is to use 4 ...


4

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 else’s post, I apply a bit stricter rules. I use ``` for multi-line code as only the line before and after the code block gets modified in the diff view while ...


2

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 and hitting tab, just like you do in many code editors. Selecting a block of text and hitting tab to indent it, is so common that I am sure many of us will be ...


2

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 more confusing, but if we look at the way they format code, I think we can see that back tick and html are for inline code like this and the other are for ...


Only top voted, non community-wiki answers of a minimum length are eligible