Skip to content
This repository was archived by the owner on Aug 21, 2018. It is now read-only.
This repository was archived by the owner on Aug 21, 2018. It is now read-only.

Standardize Python Indentation - Tabs or Spaces #7

Open

Description

@cmlccie

Several students are experiencing 'inconsistent indentation' errors when editing and then executing the sample files.

Current Formating: The sample files (today) are using tabs for indentation.

Problem: The default settings of the Notepad++ editor that many of them are using defaults to converting tabs-to-spaces. When they add new lines to the sample files, their editor is replacing their 'tabs' to spaces and causing the execution errors.

Recommendation: PEP 8 recommends using spaces as the 'leading practice', and recommends that "Tabs should be used solely to remain consistent with code that is already indented with tabs."

Either way (whether we go with tabs or spaces), I recommend that the sample-code files and the IDE settings (at least those in the dCloud environment) be set to use the same formatting. Additionally, with spaces being the 'leading practice', defaulting to this would likely provide greater 'compatibility' with IDEs on users' laptops.

Activity

  1. self-assigned this
    on May 11, 2017
  2. austinMarcos commented on May 11, 2017

    @austinMarcos
    Contributor

    In triage meeting today, decided that this requires further discussion to determine the standard that we want all authors to apply to code samples. Furthermore, will need to decide how we educate and enforce the standard. Our new curator, Diane, might be able to help monitor the usage of tab vs spaces.

  3. cmlccie commented on May 11, 2017

    @cmlccie
    ContributorAuthor

    That's great! I'm glad coding standards are being considered.

    Rather than creating something from scratch, and to align with the industry, I would recommend that we simply adopt the industry leading practices (with modification only if it is justifiably necessary). For Python, this would mean adopting PEP8 and possibly either PEP257 or the Google style-guide for docstrings convention.

    Another benefit of adopting these industry practices, is that monitoring for consistency also doesn't take too much work, as a code linter (like flake8 or the like) can be used to automate the testing of contributors code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions