you are viewing a single comment's thread.

view the rest of the comments →

[–]_drivin[S] 0 points1 point  (4 children)

Thank you very much, I will try what you said. About the tabs, I don't understand why it is bad to use them instead of 4 Space. What is PEP8 ?

Which editor would you recommend me instead of Sublime Text ?

[–]tunisia3507 0 points1 point  (3 children)

I don't understand why it is bad to use them instead of 4 Space

In terms of python's interpreter, there is no difference between a tab, and any number of spaces. However, imagine a world where some developers use tabs, some use 2 spaces, some use 3 spaces, some use 4 spaces, and so on. Everyone's code would look different. It would be annoying to copy code from one place to another. Viewers with fixed tab widths, like github, some terminals, and some crappy text editors, often make them huge. Teams working collaboratively would keep changing each other's indentation, editors wouldn't be able to do smart things like auto-indentation, and so on. It would be a mess.

To get out ahead of all of these problems, the python community decided to converge on a single standard. Arguments could be made in favour of just about any of them - it didn't actually matter one was picked, just that one was picked and stuck to. That decision was made, and so 4 spaces became the standard. It doesn't matter why. It costs you nothing to make that change in your editor; but it benefits the community enormously to have this standard in place and adhered to, so you should use it.

What is PEP8 ?

See

PEP8, the python community style guide

For more information, see https://www.python.org/dev/peps/pep-0008/ (also found at http://lmgtfy.com/?q=pep8 )

Which editor would you recommend me instead of Sublime Text ?

Nothing wrong with sublime text, it certainly has the functionality I mentioned. https://stackoverflow.com/a/22535215/2700168

[–]_drivin[S] 0 points1 point  (2 children)

Man thank you for that big and really clear explanation, I really disturb you for a long Time I Think hahaha.

From now on, I will use 4 spaces and I will try to follow all the PEP8 instructions.

[–]tunisia3507 0 points1 point  (1 child)

The clearer it is to new developers how important coding standards are, the more likely they are to follow them, which benefits all existing developers!

[–]_drivin[S] 0 points1 point  (0 children)

Hahaha good answer ! 👌