# Forum: catching badly formatted code posts

**URL:** https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226
**Category:** Site Feedback
**Created:** [May 21, 2018, 8:16pm UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226 "2018-05-21T20:16:22Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [May 21, 2018, 8:16pm UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/1 "2018-05-21T20:16:22Z")

</div>

One major complaint for regulars on the old forum was the constant need to write back to new users and explain to them how to format their code. Regular responders wrote “please format your code” or shared links to the FAQ “How to format your code” roughly 4000 times in the past few years.

It might be nice to keep our eye on this conversation about a bad-code catching plugin for Discourse, possibly modeled on StackOverflow:

> **[\[Plugin\] Catch and educate users posting code without properly formatting it](https://meta.discourse.org/t/plugin-catch-and-educate-users-posting-code-without-properly-formatting-it/67958)**
>
> In this post @codinghorror horror mentioned that on StackOverflow there is some logic that catches users trying to post unformatted code (“there are a lot of unusual \[ and { characters per line, etc)”) and then block them from posting until they...

---

<div class="post-metadata">

### Author: ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)
#### Post date: [May 23, 2018, 6:38pm UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/2 "2018-05-23T18:38:05Z")

</div>

It would be very cool to detect this automatically.

Another thing that may help is adjusting the welcome message to make it less likely that the code gets shared unformatted.

In the openFrameworks forum I think the message looks like this:

* * *

Hi! Welcome to %{site\_name} — thanks for starting a new conversation!

To **get help faster** :

1. Think of a _useful title_. Describe the issue in one sentence. Avoid common words like “problem” or “help”.
2. Describe _what you are trying to do_.
3. Describe _what goes wrong_.
4. Include _code_ and _format_ it. Paste your code, select it and press the \</\> button in the toolbar to make it beautiful 🙂
5. Include a _screenshot_? Worth 1000 words sometimes.

This message will only appear for your first %{education\_posts\_text}!

* * *

The average user in both communities may differ and the message may need to be adjusted. But in general the idea is to make it easier to ask questions that are easier to answer and are more useful for others.

Here the source:

```auto
Hi! Welcome to %{site_name} — thanks for starting a new conversation!

To **get help faster** :

1. Think of a _useful title_. Describe the issue in one sentence. Avoid common words like "problem" or "help".
2. Describe _what you are trying to do_.
3. Describe _what goes wrong_.
4. Include _code_ and _format_ it. Paste your code, select it and press the </> button in the toolbar to make it beautiful :) 
5. Include a _screenshot_? Worth 1000 words sometimes.

This message will only appear for your first %{education_posts_text}!

```

---

<div class="post-metadata">

### Author: ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)
#### Post date: [May 24, 2018, 1:41am UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/3 "2018-05-24T01:41:29Z")

</div>

I agree we should edit the just-in-time message shown to users. One tiny thing: I’d go with bold instead of italics in the text. I’d couple this with links that explain more. Something like:

Include **code** in the form of an [MCVE](https://stackoverflow.com/help/mcve) and **format** it. See here for more info.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [May 24, 2018, 3:28am UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/4 "2018-05-24T03:28:32Z")

</div>

Great suggestions on the welcome message. I think looking at that might require an admin-level account – @fjenett

---

<div class="post-metadata">

### Author: ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)
#### Post date: [May 24, 2018, 4:08am UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/5 "2018-05-24T04:08:50Z")

</div>

Is it wise to encourage screenshots this way? I mean, at least it could be mentioned not to screenshot **error messages** but to paste them directly in the forum. Also, is it possible to add, beside bold, color text in the forum?

Kf

---

<div class="post-metadata">

### Author: ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)
#### Post date: [May 24, 2018, 4:53pm UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/6 "2018-05-24T16:53:07Z")

</div>

4 posts were split to a new topic: [Enabling Colored Text](https://discourse.processing.org/t/enabling-colored-text/343)

---

<div class="post-metadata">

### Author: ![fjenett](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fjenett/32/18_2.png) [@fjenett](https://discourse.processing.org/u/fjenett)
#### Post date: [May 24, 2018, 5:25am UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/8 "2018-05-24T05:25:48Z")

</div>

Hey, thanks for the suggestions. Will look into it this weekend.

---

<div class="post-metadata">

### Author: ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)
#### Post date: [May 24, 2018, 4:54pm UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/9 "2018-05-24T16:54:04Z")

</div>

2 posts were split to a new topic: [Preventing Users from Deleting Topics](https://discourse.processing.org/t/preventing-users-from-deleting-topics/344)

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 7, 2020, 9:10pm UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/10 "2020-03-07T21:10:15Z")

</div>

An unformatted code detection plugin still has never materialized, but the conversation continued. Somebody on the Discourse forums created a Clippy The Paperclip that follows around a user who is flagged for unformatted code. That wouldn’t work here, but it is funny.

> **[Catch and educate users posting code without properly formatting it](https://meta.discourse.org/t/catch-and-educate-users-posting-code-without-properly-formatting-it/67958/27)**
>
> So I just did this for my site mostly as a joke , but it works well and it is effective (thus far) It doesn’t automatically catch the offenders, but when I (or any of the leaders) see it we set a tag on the post of “formatcode” Then this happens...

---

<div class="post-metadata">

### Author: ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)
#### Post date: [March 7, 2020, 11:22pm UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/11 "2020-03-07T23:22:20Z")

</div>

> [@jeremydouglass](#):
>
> Clippy The Paperclip

That is awesome!  
😀

---

<div class="post-metadata">

### Author: ![anon94203042](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@anon94203042](https://discourse.processing.org/u/anon94203042)
#### Post date: [March 8, 2020, 12:09am UTC](https://discourse.processing.org/t/forum-catching-badly-formatted-code-posts/226/12 "2020-03-08T00:09:12Z")

</div>

That would definitely be a cool feature! But I don’t think there should be a penalty for bad formatting. We don’t want this site to be very restrictive to new users
