Questions tagged [code]
Questions relating to code that appears in a question or answer, such as answers which are entirely code. Do not use this tag for questions about code formatting; use [code-formatting] instead - and NEVER EVER USE THIS TAG TO ASK A PROGRAMMING QUESTION ON META!.
144 questions
25
votes
0
answers
203
views
Can we remove the new code block headers?
Code blocks now have a header with a language tag and a Copy button. While this feature probably addresses a very old request, it poses multiple problems:
the copy button is only useful for very long ...
47
votes
2
answers
467
views
New code block design guesses incorrectly at what the language is, even when explicitly stated
(Cross-posted as a bug report to MSE which lists all affected languages found thus far. Please go there to see if a language you've observed being labeled incorrectly is included in the table)
I just ...
24
votes
4
answers
713
views
Is it link-only when there is a link and description but no code?
As one of your newest moderators, I've been handling a bunch of not-an-answer flags. One NAA flag was for this answer:
The flag comment said that the link was broken. When reviewing the flag, I:
...
2
votes
1
answer
253
views
Is it ever ok to put an image of code in a question? [duplicate]
I have been staunch in my opinion of Posting images of code
I will 100% of the time either downvote the question or flag to be closed.
My question is, am I being too rigid? We've given plenty of ...
-8
votes
1
answer
214
views
Unable to post code and error on Stack Overflow (while asking question) - {} not seen, whitespaces and Ctrl+K doesn't work
I wanted to post a question on Stack Overflow.
I tried posting a code with its error. But, it showed some indentation error in code.
I was not able to find any {} above to resolve the problem. ...
12
votes
0
answers
206
views
Why do we still have strange escape backslashes appearing in question code?
I was wondering why would users have that weird backslashes when pasting code. Now I noticed that this is a persisting issue1, 2, 3. Why hasn't this been solved yet? See here. I've edited several ...
-16
votes
2
answers
197
views
How should I write my question about margins not working?
I have a question about my Stack Overflow post: Why are margins not working in my HTML file and how can I fix that?
I have a problem with my HTML file, but I can't figure out how I should ask about it....
2
votes
1
answer
239
views
Code searching at the end of 2022
Tl;Dr:
As of November 2022, is Google still the best option to search for posts including specific code methods?
I'm trying to find questions with code generated by the Google Sheets Macro Recorder. ...
-17
votes
2
answers
287
views
Should I edit posts with improved style? [duplicate]
I edited this answer on Stack Overflow and improved its format, so it's easier to read and conforms to Python best style/format practices. Is it a good edit or not?
It used to look like this
return ...
3
votes
0
answers
123
views
Why are strange backslashes (escapes?) suddenly appearing in rendered code? [duplicate]
I've noticed that lately strange backslashes are appearing more and more frequently in edited code.
Here is another example. Is this a user failure or a bug in the site's code rendering?
39
votes
1
answer
897
views
Punctuation characters being escaped in code
For the past couple of days, it seems that when users paste code into their questions, but don't put it into a proper code block, many punctuation characters are being automatically escaped with ...
45
votes
6
answers
3k
views
Should we edit a question to transcribe code from an image to text?
Context: "How to call a method from a class referenced as a string?"
More general context: how do we educate occasional users, or new users, to the best practices to follow when posting a ...
20
votes
2
answers
2k
views
Answers with large amounts of code (whole scripts)
I answered a question (since closed: "This question needs debugging details. It is not currently accepting answers," and deleted) a little while ago, and it really is a good answer, because ...
-9
votes
2
answers
315
views
Piece-of-code-highlight/error highlight for Stack Overflow (and possibly others)
Similar questions
I have checked some previous questions/answers like this one: Highlight Line of Code
But I did not like the answer and this can be troublesome.
Proposal
Let's say I post a big (but ...
1
vote
0
answers
166
views
While editing a question, this piece of text causes the error: "contain code that is not properly formatted"
I am editing one of my questions on Stack Overflow.
It raises an error:
Your post appears to contain code that is not properly formatted as
code.
After some digging, I find it is about this text:
(Do ...