18

When editing a SO question or answer, a prominent {} button allows beginners to discover the possibility of formatting text as code. When some lines are selected, these lines are instantly formatted as code. When no lines are selected, placeholder text “enter code here” is inserted to make it clear where the code has to go.

However, inexperienced users may leave the “enter code here” placeholder text in their question, attracting negative comments for something that is not their fault but a usability bug.

While the placeholder text clearly helps understand the role of the {} button, the editor should check that this placeholder text, when automatically inserted, has been edited out before the question is posted.

The worst possible side-effect might be difficulty to post code that contains exactly the words “enter code here” when the user has clicked {} with no selection. This seems at first sight less likely than the error of forgetting to remove the placeholder.

(Or the placeholder text could remove itself more automatically, but that is so obvious that I assume it would already be done if it was easy.)

10
  • 3
    This is more a user error than a bug in my opinion- I just tested this myself, and the editor auto-highlights "enter cod here" when you click the button. So as long as you don't click out of that, it'll automatically replace it when you start typing or paste in your code.
    – Kendra
    Commented Jan 5, 2015 at 22:39
  • @Kendra “This is a user error” works as an answer to every usability bug. Although I concede that “The beginner user just should not click where the placeholder text can be interpreted as telling them to click before entering the code” is a nice instance for this bug. You should post it as an answer. Commented Jan 5, 2015 at 22:46
  • 1
    Re "answer to every usability bug", yeah, you got a point. Wasn't quite sure how to word it. As for an answer- I'm not sure I can flesh out a decent one more than simply what I commented right now, so if no one else takes it, I'll try to flesh it out later.
    – Kendra
    Commented Jan 5, 2015 at 22:49
  • 1
    How do you suggest it be "fixed"?
    – AstroCB
    Commented Jan 6, 2015 at 18:50
  • 1
    @Kendra: I see the “enter code here” quite often in posts. Even if it is a user error, I think that users should be assisted in avoiding such errors. If removing this text automatically is difficult then a confirmation message such as "Do you want to leave that text in your post?" might be an option.
    – honk
    Commented Jan 6, 2015 at 18:54
  • @honk I was more addressing the cause of the issue, not that it is an issue. I only really browse questions when I'm searching something. (Granted, that is often anymore.) Most of the time, those are older questions that have been edited a few times. I personally have not seen this, ever, but I didn't say it was not a problem.
    – Kendra
    Commented Jan 6, 2015 at 19:02
  • 1
    @Kendra: I wouldn't call it a problem. It's just something that could be improved. Currently, I'm reviewing posts in the Triage queue quite often. Maybe that's the reason why I see that text more often than you.
    – honk
    Commented Jan 6, 2015 at 19:17
  • @honk: I burn through my 20 Triage/day (and FP and LA) just about every day and I think I've seen this problem maaaybe thrice in 1400+ total reviews. So it's probably rare enough that subjective memory glitches account for a lot of the variation in observed incidence. Commented Jan 6, 2015 at 19:39
  • @NathanTuggy: Maybe I was just "lucky". I would estimate that I saw this text three times in the last week on the Triage queue only. But I have to admit that I didn't see it that often before.
    – honk
    Commented Jan 6, 2015 at 20:35
  • possible duplicate of Feedback Requested: Code Editor and Stack Snippets Commented Jul 28, 2015 at 18:13

1 Answer 1

-1

Image of what appears with the "code" button is clicked

This is what appears when you click the "Code Sample" button, both in questions and answers. As you can see, the phrase "enter code here" is auto-highlighted.

What I believe is happening, to get the result of users leaving the placeholder text in their code, is the user is clicking the button, clicking to a different screen to get their text (this de-selects the placeholder text) and clicking back over to paste in their code, without re-highlighting the placeholder text.

In other words, the system is working as intended. The users are simply not being attentive enough to realize they forgot to remove the placeholder text. This isn't a usability bug as it is not a mistake in the code, and automatically removing the text is more of a hand-holding step than anything. It doesn't take that much to edit out the "enter code here" text from a new users post, after all.

If this truly is a problem with new users, then yes something needs done to educate the new users, but that still does not qualify inattentive users as a bug, nor really give a great reason to automatically remove the phrase- There are other ways to teach new users.

16
  • 6
    Honestly, if that happens on a regular basis, I'd say it qualifies as a "usability bug".
    – Janis F
    Commented Jan 6, 2015 at 15:09
  • @Romiox A bug implies an error in the coding. To quote the bug tag itself: "...a reproducible problem on the site that you believe is due to a mistake, malfunction, or programming error." Which is not the same as new users forgetting to re-highlight the placeholder text and remove it. I can see it being a problem- But not a "bug" of in any real form.
    – Kendra
    Commented Jan 6, 2015 at 15:20
  • 4
    @Kendra he said USABILITY bug, which is not a "Bug" per say. Should this be fixed, yes. This could very easily fall into validation. It really bothers me when ppl refuse to fix usability/validation problems cause "its not a bug". Also this would take is "Looks like you meant to enter some code..." in a popup.
    – iamkrillin
    Commented Jan 6, 2015 at 18:42
  • @iamkrillin I was actually trying to look up a definition of "usability bug" and most of what I found was along the lines of "an issue with design that impedes, in some way, use of a site or application." Which this issue still is not.
    – Kendra
    Commented Jan 6, 2015 at 18:44
  • @iamkrillin As for the popup: The issue described in the OP is not "leaving the placeholder with no code" but instead "leaving the placeholder IN the code."
    – Kendra
    Commented Jan 6, 2015 at 18:45
  • @Kendra Same difference as far as I'm concerned.
    – iamkrillin
    Commented Jan 6, 2015 at 18:46
  • @iamkrillin I suppose we will have to agree to disagree on the definition. In all, we don't know if it will be fixed until a dev steps in and says so. I personally see far more pressing issues that can be worked on than "Oh, users are leaving 'enter your code' in their code!" But that could just be me.
    – Kendra
    Commented Jan 6, 2015 at 18:49
  • 1
    I agree with this; I don't know what other behavior you would expect other than just indenting blank space (which would be quite confusing to a new user who doesn't have experience with Markdown, I'd think).
    – AstroCB
    Commented Jan 6, 2015 at 18:50
  • 2
    It should be noted that switching windows does not (in the platforms and browsers I've used, at least) actually deselect any text. Nor does switching windows back to the browser, nor yet switching tabs. It's only when the user specifically clicks back on the page itself (in or out of the textbox) that any deselection happens, and while that's common enough, it's definitely a user error. Commented Jan 6, 2015 at 19:02
  • @AstroCB Straw man. The question explicitly says that it does not suggest replacing the placeholder text with nothing, and suggest two solutions. I'm not going to repeat them here since there was more room in the question. Commented Jan 6, 2015 at 19:02
  • @NathanTuggy I tested it before adding that to my post, and it did for me. Might just be a difference in setups in that case. Edit: Just tested it again to verify I didn't just double click on coming back, and it did indeed do what I posted for me.
    – Kendra
    Commented Jan 6, 2015 at 19:03
  • @Kendra Probably so. For me (in a Firefox-alike on Win8.1), clicking the tab from another window, or using Ctrl-PgUp/PgDn to switch tabs, or Alt-Tabbing around, or clicking the window button in the taskbar all work just fine without deselection of any kind. Commented Jan 6, 2015 at 19:06
  • 1
    @NathanTuggy When did clicking become a user error? And how is leaving inside the text a phrase that was not put in by the user not an editor bug? I know we have been trained by years of "enBrian Smithter name here” HTML forms, but this was never acceptable even if it was and is commonplace. Similarly, the SO HTML editor is different from every previous text editor the user has used before, and the user is supposed to recognize selections and know that they should remove text inserted automatically for them? Commented Jan 6, 2015 at 19:07
  • 1
    "Clicking" isn't. Clicking to focus the wrong element (or, more subtly, clicking to cancel a selection) sure is though, just like clicking the wrong link is, or using the wrong mouse button, or hitting Ctrl-8 instead of Ctrl-I like I just did. Understandable? Probably. Preventable? Maybe. User error? Definitely. Commented Jan 6, 2015 at 19:34
  • 1
    @PascalCuoq Yes, and those are viable solutions, but they were not the subject of this answer, which attacks the problem from a different side.
    – AstroCB
    Commented Jan 6, 2015 at 23:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .