Skip to content
The Chat Archive
Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written) OpenAssistant Conversations (oasst2)

What guidelines should I follow when given the task of reviewing code, and making…

In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
  1. User

    What guidelines should I follow when given the task of reviewing code, and making necessary optimisations

  2. Assistant

    The guidelines may vary depending on your language, but here are a few general rules:

    • Ensure the code works. Not just that it doesn't crash, but that it does what people want. This can be done with tests.
    • Make sure the code is self explaining. Someone should be able to tell what it does by reading it over. This also means names should make sense.
    • Make sure there is good documentation. There should be docstrings for functions and classes. In many IDEs, these will popup whenever someone hovers over a function, and they will also be used in documentation generators like Sphinx.
    • Use linters. These tools will automatically tell you if the formatting is right, if things are too complex, etc.
    • Make sure the code isn't too complex. Some linters will measure complexity, but if there are massive functions with many branches, breaking it up into multiple functions that are easier to understand should help with maintenance.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.