Code Monkey home page Code Monkey logo

Comments (4)

ambv avatar ambv commented on May 17, 2024 13

No, tabs for indentation are the devil. Making this configurable would go against Black's philosophy.

from black.

BrettMoan avatar BrettMoan commented on May 17, 2024

Python is a language that is conscience of spaced alignment. requiring which requires consistency in the offset of the characters from the newlines.

tabs for indentation are the devil.

this is as ignorant as it is absurd

The "tab" key was named in the 1900s, and is based off of the definitions of words, at that time.

at that time
to tabulate was to make spaced words flat
while
to indent was to create two inequal sections on a sheet.
http://webstersdictionary1828.com

at that time, "to indent" text was "to tabulate"

Tab stops create alignment, originally for mathematical tables.

Python uses alignment for code blocks. tabs are the natural character for this purpose, not spaces.

Furthermore, even the modern definitions show that tabulation and indentation go hand in hand.

tabulate
(transitive) To arrange in tabular form; to arrange into a table.
(transitive) To set out as a list; to enumerate, to list.
https://en.wiktionary.org/wiki/tabulate

tabular (comparative more tabular, superlative most tabular)
having a flat, plane surface
organized as a table or list
calculated by means of a table
https://en.wiktionary.org/wiki/tabular

indent (plural indents)
A cut or notch in the margin of anything, or a recess like a notch.
https://en.wiktionary.org/wiki/indent

Tabs notch the text in an flat, organized and calculateble way.

Furthermore:
The fact that "line length" is configurable in Black's philosophy but characters for indentation is not, is intellectually inconsistent. Please consider becoming intellectually consistent in this use case.

from black.

zsol avatar zsol commented on May 17, 2024

@BrettMoan we appreciate your thorough comment but this will not be supported by Black.

from black.

ambv avatar ambv commented on May 17, 2024

@BrettMoan, whipping out Wiktionary feels rather condescending. I don't understand how you expected to change anybody's mind that way, let alone by starting with that I am ignorant and absurd.

What is ignorant and absurd is fighting against PEP 8, defined in 2001, eighteen years later. Tabs might be theoretically better but that ship has sailed a very long time ago.

Black's code style is opinionated and that is one of the opinions. Four spaces. Done. The goal behind it is to unify as much community around this as possible, especially programmers and teams who haven't form an opinion yet. I won't present tabs as an option because it is not a valid one.

The Python community moved on.

If your editor is configured to use tabs for Python indentation, that means you are unable to meaningfully contribute to any open source software, including Python itself. Some code editors and other tooling will be confused by tabs in Python indentation, leading to mixed spaces and tabs which is not supported on Python 3.

from black.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.