Slashdot Mirror


The Evolution of Python 3

chromatic writes to tell us that O'Reilly has an interview with Guido van Rossum on the evolutionary process that gave us Python 3.0 and what is in store for the future. "I'd like to reiterate that at this point, it's a very personal choice to decide whether to use 3.0 or 2.6. You don't run the risk of being left behind by taking a conservative stance at this point. 2.6 will be just as well supported by the same group of core Python developers as 3.0. At the same time, we're also not sort of deemphasizing the importance and quality of 3.0. So if you are not held back by external requirements like dependencies on packages or third party software that hasn't been ported to 3.0 yet or working in an environment where everyone else is using another version. If you're learning Python for the first time, 3.0 is a great way to learn the language. There's a couple of things that trip over beginners have been removed."

6 of 215 comments (clear)

  1. Oh good. by powerlord · · Score: 4, Insightful

    There's a couple of things that trip over beginners have been removed.

    So whitespace block delineation is finally out, in favor of braces? :P

    --
    This space for rent. All reasonable inquiries will be entertained at proprietors discretion.
    1. Re:Oh good. by SatanicPuppy · · Score: 5, Insightful

      I'll preface this by saying that I program primarily in brace-based languages.

      Braces suck in the worst possible way as a method of delineation. Let me give an example:

      while(...){if(...){if(...){}elseif(...){}}}

      That's clearly the suck, so we break it out like:

      while(...){
          if(...){
                if(...){
                }elseif(...){}
          }
      }

      ...at which point we realize that the braces are basically useless, since the code is unreadable without the whitespace. Python just forces you to use a readable formatting, and it's not all that hard to get used to.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    2. Re:Oh good. by hwyhobo · · Score: 5, Insightful

      at which point we realize that the braces are basically useless, since the code is unreadable without the whitespace.

      No, it means the code is hard to read, but it still works. You can reformat that block, or you can change the spaces (tabs, number of spaces), and it will still work. In Python, it may look okay, and be readable, but it won't work.

      I guess it is a matter of priorities.

      BTW, I like Python (and have almost given up on Perl 6), but the white space thing drives me crazy.

      --
      End anonymous moderation and posting on /.
    3. Re:Oh good. by costas · · Score: 4, Insightful

      The whitespace issue is a red-herring: most people get used to it quickly and it's not as strict as it sounds (you can mix-and-match tabs and spaces, as long as you are consistent for each *block*; not even an entire .py file). There's two real-world problems with it: copy-and-paste and generating Python code. Both are much less common than looking at badly-formatted code that it takes a bit to mentally parse which brace-delineated languages have.

  2. Re:In all seriousness by horza · · Score: 4, Insightful

    I've edited Python in vi, Notepad, SciTE, Geany, and other editors without any problem. Never used emacs though. If whitespace is causing bugs in your team's code you need to (a) introduce process or (b) lose some dead weight from your team. For (a) you can standardise on editor and whether to use tabs or spaces, or you can get the coders to end a whitespace block with a comment, eg # endif. I've only been using Python a couple of years but my experience so far suggests the problem is with you and not the language.

    Phillip.

  3. Re:In all seriousness by SleepingWaterBear · · Score: 4, Insightful

    If he had said that it must be indented by exactly 1 tab or exactly 4 spaces or whatever other measure and everything else would throw a syntax error, it would have been fine. As it is I'd say about 15-20% of the time I spent doing Python was spent fixing these kinds of bugs.

    I have to assume that most of your time doing python has been spent copy/pasting code off the web. I've been coding python nearly daily for a couple years now. I've rarely made indentation errors, none in the last few months, and only once have I ever had an indentation error that took more than 10 seconds to debug. The thing is, most indentation errors are so visibly clear that it's really quite hard to make them.

    If you're actually having problems with multiple spaces looking like tabs, you can use the -t option to make it throw an error if you use a mixture of tabs and spaces, but it really shouldn't be that hard.