# Mandatory onboarding training for code formatting?

**URL:** https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036
**Category:** Feature
**Created:** [November 9, 2022, 8:04pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036 "2022-11-09T20:04:04Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![BryanV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryanv/32/226479_2.png) [@BryanV](https://meta.discourse.org/u/BryanV)
#### Post date: [November 9, 2022, 8:04pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/1 "2022-11-09T20:04:05Z")

</div>

Hi, I run [https://discourse.bokeh.org](https://discourse.bokeh.org) and also frequent [https://discuss.python.org](https://discuss.python.org) often. In both places, there is a pretty terrible issue with new users not formatting code in their first posts. There are typically several posts _per day_ on the main Python forum where users need to be corrected. \[1\] This is huge, constant drain on many people’s time.

Would it be possible to have mandatory onboarding flows, before a new users is allowed to make a first post? I am thinking explicitly of a flow where the user is presented with how to accomplish code formatting, and then is tasked with manually reproducing 2-3 lines of formatted code. They have to complete this successfully before being allowed to post.

* * *

1. This is an especially pernicious problem for Python, since indentation is significant.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [November 9, 2022, 8:07pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/2 "2022-11-09T20:07:06Z")

</div>

Have you seen [Unformatted Code Detector](https://meta.discourse.org/t/unformatted-code-detector/112773)? This has helped with the same issue on some other communities.

---

<div class="post-metadata">

### Author: ![BryanV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryanv/32/226479_2.png) [@BryanV](https://meta.discourse.org/u/BryanV)
#### Post date: [November 9, 2022, 8:12pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/3 "2022-11-09T20:12:04Z")

</div>

Yes I would say it has had limited success at best, at least on [https://discourse.bokeh.org](https://discourse.bokeh.org/). But AFAIK it was [installed on the Python forum too](https://discuss.python.org/t/information-for-new-users/16688/39) (I am not an admin there).

---

<div class="post-metadata">

### Author: ![jeanas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeanas/32/281211_2.png) [@jeanas](https://meta.discourse.org/u/jeanas)
#### Post date: [November 9, 2022, 8:17pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/4 "2022-11-09T20:17:09Z")

</div>

> [@BryanV](#):
>
> But AFAIK it was [installed on the Python forum too](https://discuss.python.org/t/information-for-new-users/16688/39) (I am not an admin there).

I don’t think so, see [Unformatted Code Detector - #4 by jeanas - Discourse Feedback - Discussions on Python.org](https://discuss.python.org/t/unformatted-code-detector/16739/4?u=jeanas) for which I didn’t get any warning.

One thing that mandatory onboarding would help with is screenshots with code in them, although OCR could presumably be used to print a warning on such posts like the existing “Unformatted code detector” plugin.

I don’t follow Bokeh, so I can’t judge if the plugin is working well or not.

---

<div class="post-metadata">

### Author: ![jeanas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeanas/32/281211_2.png) [@jeanas](https://meta.discourse.org/u/jeanas)
#### Post date: [November 9, 2022, 9:40pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/5 "2022-11-09T21:40:53Z")

</div>

Actually, the unformatted code detector plugin _is_ enabled on [discuss.python.org](http://discuss.python.org). I looked at the Users category of that forum (I haven’t followed this category recently), and to be fair, it looks much better than it used to be, although there are still a few posts with unformatted code.

---

<div class="post-metadata">

### Author: ![BryanV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryanv/32/226479_2.png) [@BryanV](https://meta.discourse.org/u/BryanV)
#### Post date: [November 15, 2022, 5:26pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/6 "2022-11-15T17:26:41Z")

</div>

FWIW here is an example today with a _large_ block of code (that should pass any threshold) that the plugin did not catch:

> **[Array with elements in specific order](https://discuss.python.org/t/array-with-elements-in-specific-order/21086)**
>
> Can anyone help with this? I have an array called A whose first element a11 is from the list1, the elements a31, a51, a71, a91 are also from the list1. But the elements a21, a41, a61, a81 and a101 are from a different list, the list2. I don’t...

which then prompted an offshoot discussion about just this onboarding / code-formatting topic, which the OP seemed to take some offense to.

Is the plugin just broken, or needs an update? Regardless, I do still think a mandatory “format this code” challenge before being allowed to post is a valuable addition to “auto-detection”.

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [November 15, 2022, 10:12pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/7 "2022-11-15T22:12:51Z")

</div>

> [@BryanV](#):
>
> Is the plugin just broken, or needs an update?

I’ve just checked the Theme Component with its default parameters and the non formatted code of the example  
it seems to be working

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/e/9/ee9db35ab0a06d548dc8091271e227d8be3052cd.png)

---

<div class="post-metadata">

### Author: ![BryanV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryanv/32/226479_2.png) [@BryanV](https://meta.discourse.org/u/BryanV)
#### Post date: [November 16, 2022, 5:19pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/8 "2022-11-16T17:19:34Z")

</div>

It definitely didn’t prevent the 50+ lines of unformatted code in the linked post, which has now spiraled out into more contention at this point. 🙂

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [November 16, 2022, 6:44pm UTC](https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036/9 "2022-11-16T18:44:42Z")

</div>

should it be a bit more coercive ? maybe 🙄  
an easy first step could be a little tweak of the text of the button, maybe submit could be BEWARE !!! or something like that…
