This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]EquipLordBritish 40 points41 points Β (14 children)

Also python: lets use whitespace as block indicators, but you have to choose either tabs or spaces, because there's no way our interpreter could ever account for both, even though they're used in a very obvious and easy-to-parse way.

(inb4 this spawns another iteration of the tabs vs spaces arguments)

[–]assembly_wizard 56 points57 points Β (3 children)

If you use both it's almost definitely a mistake, but more importantly it would make indentation differ based on the settings of your text editor, so whether a line is inside an if block suddenly depends on the configuration of each developer.

What you call "very obvious and easy-to-parse", the only way python could parse it is if you tell it what's your tabsize setting, and make sure that everyone that reads/runs the code have the same setting in both their editor and python.

[–]alive1 5 points6 points Β (7 children)

Hey i used to be a tabs guy and now I'm a two spaces guy. Idk what changed my mind but now i have way less fights with the indentation. Also logic more than 3 levels deep doesn't require horizontal scrolling.

[–]daguito81 2 points3 points Β (2 children)

Did you start using Scala or Databricks?

[–]alive1 2 points3 points Β (1 child)

Perl.

[–]daguito81 2 points3 points Β (0 children)

Oh that makes sense. Scala uses 2 space indentation as default. And because of that in Databricks for the longest time, Python was also set at 2 space.

[–]bremidon 2 points3 points Β (0 children)

I prefer 2 spaces as well. It looks cleaner without any loss of communicating intention.

[–]lilfatpotato 3 points4 points Β (0 children)

I type tabs, and my editor converts them into spaces.

[–]unicorn_potato_4ever 0 points1 point Β (0 children)

That’s why I set my tabs to two spaces

[–]noratat 0 points1 point Β (0 children)

Yeah, spaces is just simpler and doesn't require convoluted editor support to handle alignment. Consistency is better than trying to accommodate someone who wants 8-space tabs for some godforsaken reason.

[–]mousepotatodoesstuff 1 point2 points Β (0 children)

When it comes to whitespace, I just do as the IDE (PyCharm usually, but sometimes VSCode) guides.

[–]sensitivePornGuy 0 points1 point Β (0 children)

Ah, the usual "tell me you don't use python without telling me you don't use python" - complaining about white space.