Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Essay Against OOP
Message
From
27/07/2019 03:00:07
 
 
To
25/07/2019 16:52:22
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01669669
Message ID:
01669785
Views:
68
>>>Haven't checked on how Python interprets tabs... Tabstop size is a potential "sticking point" between different people.
>>One of the arguing points is deciding on tabs vs. space, as whitespace is significant in python.
>>If your project is coded with tabs, you only have to use an editor translating each tab into the wished for caracter offset.
>>Compiler does not care about visual offset, only about # of whitespace chars.
>
>So does the Python parser interpret tabs as being the same as space, or does it interpret using some arbitrary "step size" (e.g. usual case where tabs advance to next column of 8 characters width) or something that is user-specified (e.g. either a specific increment, or perhaps arbitrary set "tabstop" values which may not necessarily be at regular intervals). There's already enough comflict between "(leading) tabs only" vs " (leading) space only" as well as conflict between camps who advoicate different indentation step sizse -- even before Python.
>I'm of the camp thinks that what matters most is "be consistent" (i.e. avoid mixing two styles) and often prefer to keep customization of environment to a minimum if possible -- mostly for compatibility with other systems.

Be extra careful: religious topics are frowned upon here! ;-))
The ex cathedra answer is the PEP that decrees spaces are to be used in the standard library code at 4 per indentation level.

As there are enough discussons on Stackoverflow and elsewhere where benefits and drawbacks for each side are listed:
Personally I think the option in modern editors to change tab indentation for the "view" of code should be the deciding factor.

I realize that aiming for this benefit adds technical debt to your environment:
Your editor must allow changing the interpretation of tabs, should allow to display visible markers for tabs vs. spaces.
You should have a script checking leading white space homogenity before commiting to source control at least, perhaps at each save.

If for a project spaces are defined, IMO the best solution is to map tab keystrokes into the agreed upon # of spaces automatically right at typing time.

Mixing tabs and spaces (which can happen by mistake) is a recipe for disaster.
Previous
Reply
Map
View

Click here to load this message in the networking platform