Skip to main content

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!.

Filter by
Sorted by
Tagged with
20 votes
0 answers
133 views

A while ago (several weeks I think), code blocks in SO posts gained a corner "Copy" icon, which is fine, but the entire vertical span of that icon is now unused across the horizontal span of ...
einpoklum's user avatar
  • 139k
25 votes
0 answers
235 views

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 ...
chqrlie's user avatar
  • 153k
47 votes
2 answers
568 views

(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 ...
TylerH's user avatar
  • 21.3k
24 votes
4 answers
730 views

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: ...
Stephen Ostermiller's user avatar
2 votes
1 answer
271 views

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 ...
Zak's user avatar
  • 7,611
-8 votes
1 answer
222 views

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. ...
Rohini Stanly's user avatar
12 votes
0 answers
238 views

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 ...
jay.sf's user avatar
  • 76.8k
-16 votes
2 answers
202 views

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....
Orisphera's user avatar
2 votes
1 answer
258 views

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. ...
Wicket's user avatar
  • 39.7k
-17 votes
2 answers
292 views

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 ...
weAreStarsDust's user avatar
3 votes
0 answers
152 views

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?
jay.sf's user avatar
  • 76.8k
39 votes
1 answer
950 views

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 ...
Barmar's user avatar
  • 790k
45 votes
6 answers
3k views

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 ...
VonC's user avatar
  • 1.4m
20 votes
2 answers
2k views

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 ...
user avatar
-9 votes
2 answers
334 views

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 ...
Lucca Ferri's user avatar
  • 1,369
1 vote
0 answers
169 views

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 ...
AdmiralOrange's user avatar
11 votes
1 answer
473 views

I've already read main question on this topic, When should I make edits to code? and this one too, still I'm not sure what to do with this edit suggestion: https://stackoverflow.com/review/suggested-...
Ivan Shatsky's user avatar
  • 16.3k
77 votes
9 answers
6k views

Per another Meta it came to our attention that there was a user posting potentially malicious code. There's no real rule about that, but, for unrelated reasons of moderation, the account that posted ...
Machavity's user avatar
  • 31.8k
4 votes
1 answer
379 views

In this post: How to identify html tags in html string The language is not being recognized, the first string inside the quotes and the comments are all off. When I try to answer, the same strange ...
anastaciu's user avatar
  • 24.1k
1 vote
0 answers
45 views

For example, given the following code snippet, how does one edit the question or answer and open the existing example inside the code editor again? console.log('example') h1 { color: deeppink; }...
trusktr's user avatar
  • 46.1k
13 votes
1 answer
238 views

I just got the privilege to edit or review questions and answers. Now I'm faced with the question: what flag is the right one, when the question includes too much code? Surely Needs author edit, but ...
Oskar's user avatar
  • 1,488
8 votes
0 answers
186 views

Suppose I have a code block like this contrived pseudocode: ``` Here { is } my code ``` When I select the whole block including the backticks and then use try to blockquote it using the button or ...
Kyle Delaney's user avatar
  • 12.4k
2 votes
0 answers
83 views

I am gradually starting to learn all the publishing rules in Stack Overflow. I understood that it was necessary to publish as much explanation as possible by publishing this code without putting only ...
Lookitsgraphic's user avatar
30 votes
3 answers
498 views

I find myself typing this phrase multiple times a day. A shortcut that led directly to the FAQ explanation would be really helpful.
Jason's user avatar
  • 89.6k
2 votes
0 answers
112 views

From the licensing page: Content contributed on or after 2018-05-02 (UTC) is distributed under the terms of CC BY-SA 4.0. When I looked on the Creative-Commons page describing the license, I found ...
dan1st's user avatar
  • 17.3k
13 votes
2 answers
1k views

I have been using code fences to highlight my code in SO ```javascript ``` Recently I have noted that my code is being edited and the below syntax is being used <!-- lang-js --> I have seen ...
Owen Kelvin's user avatar
  • 15.2k
5 votes
0 answers
245 views

Why are tabs replaced by spaces in the output when I type them inside of code fences? Here I used tabs: int func() { somecode; } But you see spaces.
Gordem's user avatar
  • 115
-37 votes
1 answer
219 views

I'm new to programming and have been using stackOverflow and github only for the last 5 days. I have a couple of observations. Would it be worthwhile if, SO/gitHub adminstrators enforce strict code ...
Harvey's user avatar
  • 23
-20 votes
2 answers
206 views

When a user is asking a question SO has many ways of making sure the question is at high quality, SO has many guides and rules to make a good question and they are doing the job well. I would like to ...
Yonlif's user avatar
  • 1,802
2 votes
0 answers
139 views

Related - but not a duplicate: Please remove scrollbar-width: thin from code blocks AND fix the missing ends In Firefox: if (at the very least) the last character before a code block and the first ...
Wai Ha Lee's user avatar
  • 8,872
-1 votes
1 answer
219 views

No matter how much we discourage it, posters frequently write questions with all the code in an image that they link to. I personally don't think this should be a reason to close the questions -- if ...
Barmar's user avatar
  • 790k
30 votes
0 answers
522 views

Horizontal scrolling of code blocks is a thing to say the least. foo bar baz buzz foo bar baz buzz foo bar baz buzz foo bar baz buzz foo bar baz buzz foo bar baz buzz foo bar baz buzz foo bar baz ...
GSerg's user avatar
  • 79k
1 vote
0 answers
89 views

When using the code format sometimes the color isn't correct. For example, in this question the word CPerson Blue is blue instead of Black: And the set is Blue, and get is Black: This is a screenshot ...
Raful Chizkiyahu's user avatar
5 votes
0 answers
141 views

For a while I have been contributing to Stack Overflow with PowerShell questions and answers. In here I am seeing a lot of questions with code examples that could be automatically resolved (or ...
iRon's user avatar
  • 24.8k
22 votes
0 answers
141 views

As far as I am aware, if someone asks a question and pastes a link to websites like JSFiddle, JSBin, or CodePen, they get prompted to put code in the question itself. Lately I've been seeing links to ...
user avatar
1 vote
0 answers
59 views

When a post that contains code is edited and I click on the "An edit has been made to this post" link above it, I can see the edited post, but the code will not be highlighted unless I refresh the ...
Djaouad's user avatar
  • 22.8k
3 votes
0 answers
107 views

I have tried everything from using '```python' to indenting myself. The code which I want to upload does get highlighted in grey when I use the above methods but the syntax doesn't get highlighted. ...
heisenberg_0120's user avatar
1 vote
2 answers
241 views

In https://stackoverflow.com/a/56874892/1491895, @Dharman posted the following comment: It is a very bad idea to use die(mysqli_error($conn)); in your code, because it could potentially leak ...
Barmar's user avatar
  • 790k
2 votes
1 answer
86 views

I have a piece of code after a list in a question. It is not getting syntax highlighted, even if I use SO code block, or indent it myself. If I move it before the list, it works as expected. Also, ...
software_writer's user avatar
30 votes
2 answers
1k views

I've been following this "When should code formatting be used for non-code text? " post for guidance on removing backticks when reviewing suggested edits as well as when forming my own questions and ...
CryptoFool's user avatar
  • 23.4k
5 votes
3 answers
254 views

During answering this question another answer was posted and when I studied it, I saw that the user has deleted some lines of code so the code may properly work. Are we allowed to change the given ...
weegee's user avatar
  • 3,447
12 votes
2 answers
206 views

This is related to Should I review questions with images of code as "looks ok" or "requires editing"?, but for Low Quality Posts, which I consider a different situation than Triage....
Picachieu's user avatar
  • 3,830
-7 votes
1 answer
136 views

Has it ever been considered to colorize the code in a post which is tagged with asp.net, asp.net-mvc, etc. like the tag c#? (Sorry if this is posted earlier, but I couldn't find anything about this.)
ibubi's user avatar
  • 2,549
40 votes
3 answers
1k views

As you hopefully know, in a few weeks, EU Parliament will vote for new copyright laws. These new laws/directives (especially its most controversial component, Article 13) (Julia Reda shared the ...
Ben's user avatar
  • 3,528
17 votes
1 answer
528 views

I am a little confused with the new update of Stack Overflow, particularly on using the regular JavaScript/CSS/HTML code snippets we used to have to write our questions. Now the new update made it ...
MoSwilam's user avatar
  • 964
10 votes
3 answers
239 views

For instance, I am Dutch and most of the time is I use Dutch words to declare variables. for smaller lines of code it's easy to translate, but is it something you should always do? Is the question ...
Martijn van Amsterdam's user avatar
-10 votes
1 answer
128 views

When I have a time, I really like to help people on Stack Overflow. Questions I'm reading are mostly created by new users or others that did not ask much questions in a past. Those questions are ...
Dawid Zbiński's user avatar
-3 votes
3 answers
1k views

This question keeps coming up every here at meta and it gets positive responses. Yet it has not been implemented yet. Why?! Using a phone and copy pasting a code block is a true nightmare! Sometimes ...
Andreas's user avatar
  • 24k
2 votes
1 answer
567 views

Is there a preferred style on this site, where to put explanations of the code one posted? Should it be done like this: Some explanation above if (x != y) //do something or like this: if (x !=...
some_user's user avatar
  • 179
-8 votes
1 answer
115 views

I just observed that when I post a comment containing a piece of code, the code is not colored as it is in answers and questions. Here is a screenshot: In the above screenshot, I just posted a ...
M. Nouman Iqbal's user avatar