Questions tagged [code-formatting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21
votes
4answers
1k views

How should I include code samples in posts?

What are best practices for including sections of Mathematica code in posts? Mathematica differs from many programming languages because many of us use it in "REPL" (read-evaluate-print-line) mode, ...
12
votes
2answers
170 views

Can we have code auto-formatting and do we need to tweak what we had on the StackExchange tag?

This question is captured pretty well by its title, but for more background, on the mathematica on StackExchange we have pretty-printing on the code blocks (see here for some more explanation). I ...
15
votes
1answer
191 views

First-time posts with unformatted code should be automatically caught

tl;dr This is a feature request to enable automatically detecting unformatted code in first-time posts, and show a helpful message to the poster on how to fix it. According to the following meta post,...
13
votes
2answers
140 views

Should we encourage all users to post code in code-blocks instead of pictures?

On occasion, on SO and here, posters will post there code as pictures and not in code-blocks. As a group, should we encourage or discourage this practice?
4
votes
0answers
144 views

Post contains a code that is not properly formatted

I am trying to post this question on Mathematica StackExchange but I am getting an error that my code is not properly formatted. I double-checked every line for some time now, but I cannot find an ...
10
votes
2answers
165 views

Backquotes in titles

I'm not sure whether backquotes in titles are supposed to work, or whether they don't currently work, or whether they shouldn't be used. See this question for an example. I know that the math stuff ...
7
votes
0answers
154 views

\[DifferentialD] not displayed correctly in Mathematica StackExchange

\[DifferentialD] apparently does not have a Unicode representation, so I had to enter it directly in a reformatting of question 83672. However, I noticed that it is displayed in blue, as if it were ...
5
votes
1answer
210 views

What to do with brackets in function[]-style references?

Recently I encountered more and more situations where the poster/editor explicitly used function[] instead of function when referencing built-in functions (i.e. Dot[] instead of Dot). What is the ...
3
votes
1answer
159 views

Post without code supposed to “contain code that is not properly formatted”

I'm trying to post a question but keep getting the error Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button ...