papapoy.blogg.se

Notepad++ python spacing tab
Notepad++ python spacing tab







notepad++ python spacing tab

notepad++ python spacing tab

NOTEPAD++ PYTHON SPACING TAB CODE

One misstep and the code that's supposed to be executed in the outer loop is actually executed in the inner loop. When the script file becomes long enough, it's not always possible to correctly find out the previous level of indentation.

  • Going back to previous level: So, you've just completed your nested inner for loop and now you're left with a few lines of code in the outer loop.
  • Some Python developers follow their 'own standard' that's not the real convention.
  • Copying code is a nightmare: Have a big project to develop and you've found yourself stuck just because copying code that doesn't follow standard indentation will break even what's been working? We've all been through that.
  • So, I feel the developers had to compromise. What if we were forced to have exactly 4 spaces and nothing else per level of indentation? Wouldn't that frustrate newbies from even writing code because they'll have to type 4*n times spaces for n level of indentations? What if you miss by even one space? What was supposed to have been a programming language for beginners would have had become a nightmare for them.

    notepad++ python spacing tab

    If there's a consensus on an optimum no of spaces per level of indentation, why wasn't it enforced just like everything else? I may have an explanation. You can actually select your desired number of spaces and tabs for each level of indentation. While any sane developer wouldn't dare to enter this uncharted territory, how many sane people are actually there? When the whole point of forced indentation was better readability, did we just sacrifice readability along with maintainability by introducing mixture of spaces and tabs? This doesn't end here, yet. Nearly impossible to find out the characters used for indentation: So, Python allows mixing of tabs and spaces during indentation.Difficult to keep track of indentations if the programmer only gives one or two spaces per level of indentation: It's quite known in the Python development community that for good readability, the minimum spaces per level of indentation should be 4, but does everyone practice that? What was supposed to be the strong point of Python is reduced to nothingness.

    notepad++ python spacing tab

    For the uninitiated, let's go through them anyway: I believe most of you, who've gone through a Python script with a good number of nested loops already know what I'll be talking about. So, let's get to the details without any further ado! So, what's wrong with indentations? This is an article that does the exact opposite of what you proponents of the indentation feature might be expecting. Now before you scroll down believing this to be one of those juveniles crying over nothing significant, let me tell you that this isn't one of those typical 'Why Python Indentation Sucks' article that thrashes the language developers left and right for introducing an feature, without clearly explaining what's really wrong with it and whether the benefits really outweigh the flaws. Every programmer who's had experience with C/C++/Java (and many more) understands the pain one has to go through with forced Python Indentations!









    Notepad++ python spacing tab