Mandatory onboarding training for code formatting?

Hi, I run https://discourse.bokeh.org and also frequent 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. ↩︎

2 Likes

Have you seen Unformatted Code Detector? This has helped with the same issue on some other communities.

3 Likes

Yes I would say it has had limited success at best, at least on https://discourse.bokeh.org. But AFAIK it was installed on the Python forum too (I am not an admin there).

2 Likes

I don’t think so, see Unformatted Code Detector - #4 by jeanas - Discourse Feedback - Discussions on Python.org 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.

1 Like

Actually, the unformatted code detector plugin is enabled on 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.

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

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

1 Like

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

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. :slight_smile:

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