Slashdot Mirror


Interview With Python Creator Guido Van Rossum (techrocket.com)

The online programming school Tech Rocket just published a new interview with Guido van Rossum, the creator of Python. "Looking back I don't think I ever really doubted Python, and I always had fun," he tells the site. "I had a lot of doubts about myself, but Python's ever-increasing success, and encouragement from people to whom I looked up (even Larry Wall!), made me forget that."

He describes what it's like being Python's Benevolent Dictator for Life, and says that the most astonishing thing he's seen built with Python is "probaby the Dropbox server. Two million lines of code and counting, and it serves hundreds of millions of users." And he leaves aspiring programmers with this advice. "Don't do something you don't enjoy just because it looks lucrative -- that's where the competition will be fiercest, and because you don't enjoy it, you'll lose out to others who are more motivated."

222 comments

  1. Why in the heck should a file server need 2M lines by Anonymous Coward · · Score: 0, Interesting

    of code? Seriously, WTF.

  2. Only One Question by bretts · · Score: 1

    Why isn't Python as cool as Perl? Now that Perl is no longer trendy, we're guerrillas using Perl to reform a web wasted by the financial ambitions of Silicon Valley dweebs.... when will Python catch up?

    1. Re: Only One Question by __aaclcg7560 · · Score: 4, Informative

      Works as long as what you make in that language won't get too big.

      Two million lines of code for DropBox is pretty impressive for a script kiddie language.

    2. Re: Only One Question by Anonymous Coward · · Score: 5, Interesting

      Works as long as what you make in that language won't get too big.

      I think that's true of all languages.

      My impression (having written O(10k) line Python programs for fun) is that it's quite capable of implementing the kind of O(1m) line COBOL, PL/1 & C systems I worked on in the 80s and 90s - probably in a tenth of the size too. It's also infinitely better for "Rapid Application Development" (is RAD still a thing?) than the 4GLs and BASIC variants we used back then.

      Python is one of the few bright spots in the evolution of programming languages over the past 30 years. Too bad van Rossum fucked up the transition to version 3.

    3. Re: Only One Question by __aaclcg7560 · · Score: 1

      Too bad van Rossum fucked up the transition to version 3.

      If you're still running Python 2 code, you should into the mirror see where the problem lies. Python 3 is working just fine these days.

    4. Re: Only One Question by speedplane · · Score: 3, Interesting

      If you're still running Python 2 code, you should into the mirror see where the problem lies.

      The problem lies far beyond the mirror. It lies in the dozens of libraries that I rely on that have not upgraded to Python 3 (despite pleas to the original authors). It relies on the hundreds of hours of porting, testing, and double checking that I will need to do to move my code over to Python 3. The improvements in Python 3 are real, but they are not worth the enormous burden imposed on everyone to get their code to be Python 3 compliant.

      --
      Fast Federal Court and I.T.C. updates
    5. Re: Only One Question by Anonymous Coward · · Score: 0

      > as what you make in that language won't get too big.

      like eve:online?

      okay, bad example.

    6. Re: Only One Question by Anonymous Coward · · Score: 0

      Give us a list of these libraries. It shouldn't be hard for you to do. After all, there are 'dozens' of them, allagedly!

    7. Re: Only One Question by __aaclcg7560 · · Score: 5, Informative

      Here's a list. Only 30 out of the top 360 packages aren't ready for Python 3.

      http://py3readiness.org/

    8. Re: Only One Question by Anonymous Coward · · Score: 0

      Next time, please quote the parent in full. Otherwise those of us reading your post with 3+ filter, will miss your sarcasm and think that you are the one that is trolling.

    9. Re: Only One Question by Anonymous Coward · · Score: 1

      Most of python's value is not in the popular stuff. All languages have that. Its the obscure random shit that there ain't good alternatives to elsewhere. A lot of that stuff isn't ported.

      Also, sometimes it a pain to update on of your dependencies, even if they all support python 3, when then leads to the whole project being stuck in python 2.7 land.

    10. Re: Only One Question by Anonymous Coward · · Score: 0

      The downside of not reinventing the wheel; you get stuck in library hell.
      Even if there is an update for the library you will still have to go through your testing since behavior that the library author doesn't care about might have changed.
      Since you didn't do the update yourself you also can't limit your tests to the few things that should matter.

    11. Re: Only One Question by Anonymous Coward · · Score: 0

      If you're still running Python 2 code, you should into the mirror see where the problem lies. Python 3 is working just fine these days.

      What problem? People don't switch precisely because there is no problem with Python 2. Python 3 provides little of value, but introduces a lot of gratuitous incompatibilities.

      If Guido wants people to switch, he needs to add something of value to Python 3: much improved performance and getting rid of the GIL might be good things to do.

      I'm more likely to switch to Swift than to Python 3.

    12. Re: Only One Question by MichaelSmith · · Score: 2

      Hey I could do that in C with ten million lines of code!

    13. Re: Only One Question by Cyberax · · Score: 1

      Why? Python 2 is clearly superior to Python 3. There's no bullshitty "unicode strings" nonsense in it and it's also very stable.

      Why "unicode" strings in Python are nonsense? Simple - they are useless for pretty much anything that deals with the real world. Read and weep: https://lwn.net/Articles/68335...

    14. Re: Only One Question by Anonymous Coward · · Score: 0

      Any transition takes work. When it's something as fundamental as a programming language. When the people need to upgrade are a wide unco-ordinated group of people rather than a single entity it takes time to get the ball rolling and get everyone to upgrade. It's no different to a thousand other transitions. IPv6 for example. And with the six module and 2to3 tool it isn't something that's even that hard.

    15. Re: Only One Question by silentcoder · · Score: 1

      On the other hand - have you seen the extreme hackyness of encryption libraries in python2 - and how clean their code is in the python3 versions ? The 2.x versions are filled with horrible work-arounds to deal with python 2's lack of a proper byte-type - trying to mash things into the string type without having overflow errors. More than a few resort to rewriting every character using hex-codes on-read and then storing the hex-codes as strings - which needs (expensive) back-and-forth conversion on every access.

      In python3 - they just used the Byte type out of the box and require no hacks to make it work.

      Sure python3 broke compatibility, that's what happens with a major version number. It's worth it though because the vast majority of changes actually fixed long-running serious issues, like the ones that plagued encryption libraries.

      --
      Unicode killed the ASCII-art *
    16. Re: Only One Question by Anonymous Coward · · Score: 0

      whenever i run into python 2 code that doesn't work in python 3, i get it working in 1 minute after running 2to3

    17. Re: Only One Question by silentcoder · · Score: 1

      http://www.diveintopython3.net...

      That alone makes it worth-while, at least if you give a damn about securite. Go look at any encryption library for python2 - it's a horrible ugly mess of trying to work around the limitations of python2 strings. Python3 provides the bytes type as part of the string overhaul - which makes encryption code massively cleaner and run a *lot* faster.

      --
      Unicode killed the ASCII-art *
    18. Re: Only One Question by MightyYar · · Score: 2

      This has improved quite a bit recently. I still write all my stuff to run on both 2.7 or 3.x, but more and more I'm able to use 3 exclusively. Yeah, there are a few try: blocks and imports at the top of all my files, but it's not so burdensome. It's not like they are forked - 2.7 can be made to behave very similarly to 3.x. Just run your tests in both versions.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    19. Re: Only One Question by Anonymous Coward · · Score: 0

      Python is used by academic labs to scratch their itch.

      The guy who wrote the library is gone. His project failed, his wife left home, his house was auctioned off and he isn't going to port it the python3.

    20. Re: Only One Question by Anonymous Coward · · Score: 1

      Only 30 out of the top 360 packages aren't ready for Python 3.

      Murphy's Law.

      So of the eleven packages you used to make your app six are covered.

      Three are just abandonware that got as far as having a package in pypy.

      The two key ones you built the logic around throw a wobbly.

      One has a hack for an edge case you have. The issues list on GitHub is longer than Martin Luther's Thesis and reads like hate-mail to an ex-boyfriend.

        The other solves a real problem but was made by a non-developer. She has since graduated and that was just her master's thesis in a field completely unrelated to computers. Now she only speaks the jargon of her PHD field and not any normal human language known.

    21. Re: Only One Question by DrXym · · Score: 1

      If you're still running Python 2 code, you should into the mirror see where the problem lies. Python 3 is working just fine these days.

      The problem was Python 2 was never end of lifed so nobody felt any urgency in moving. Even worse, major features were backported and kludge libraries like Six appeared to paper over the cracks. The python community managed to split itself in half and confuse the hell out of everyone who ever tried to run a .py script and discovered they had the wrong Python runtime.

      The correct option would have been to give a definite end of life Python 2.x, e.g. 5 years of maintenance and bug fixes before it gets shoved in the attic. Make it clear that 2.x is toast and people would have been sufficiently motivated to move to 3.x.

    22. Re: Only One Question by Anonymous Coward · · Score: 0

      Dust 514 had potential. Too bad it died a sad death.

    23. Re: Only One Question by Anonymous Coward · · Score: 0

      Seriously, just changing the default methods on dicts to views is great. Yes, I can use d.viewitems() in 2.7, but d.items() is what you 'want' to type, and views are just the 'right' thing to use.

    24. Re: Only One Question by speedplane · · Score: 1

      Only 30 out of the top 360 packages aren't ready for Python 3.

      My main project relies on about 50 different libraries. I just looked through the first ten of them, and only was on your top 360 list. Even determining which libraries I need to update will be a project.

      --
      Fast Federal Court and I.T.C. updates
    25. Re: Only One Question by speedplane · · Score: 1

      Any transition takes work. ... it isn't something that's even that hard.

      Think about everything that could have been accomplished if the community had not needed to focus on 2to3. We could have had a functioning JIT by now.

      --
      Fast Federal Court and I.T.C. updates
    26. Re: Only One Question by spitzak · · Score: 1

      Ding ding ding! Somebody has actually identified the reason you cannot migrate from 2 to 3.

      In 2 you can read arbitrary bytes into a string without throwing an exception. Only if you try to convert to a Unicode string would an exception be thrown, and you can do lots of stuff with strings without converting them to Unicode (such as read and write the to files and examine the bytes).

      In 3 reading into a string can throw an exception if the stream of bytes has an encoding error. The "solution" is that you have to read into a bytes array. But almost certainly what you want to do with the data is pass it to another function that takes a string, and that will throw the exception (either for the wrong data type or because it tried to convert the bytes to a string). You have to rewrite every single function you will call to take a bytes array, rewriting every single thing they call, etc. This is not possible for any reasonable sized software project. It also is really annoying in that 99.99% of the time the data is a "string" in that it is valid UTF-8, and you have thrown away any easy methods of looking at them or comparing them to quoted string constants.

      The "string" should have remained a byte array so it could be used for arbitrary bytes, and indexing returns the bytes. "decoding" to Unicode should have been done with iterators, which have the advantage that you can choose the iterator to handle errors in different ways, and to do Unicode normalization if wanted. The "unicode" strings (which are arrays of 16 or 32-bit items) could remain for back-compatibility but deprecated.

      Something about Unicode turns otherwise intelligent people into idiot savants, where they will figure out obscenely complex "solutions" for a problem (encoding errors) that should be no more difficult than figuring out how to make your word processor not crash on misspelled words.

    27. Re: Only One Question by HiThere · · Score: 1

      Yes, but it would have been extremely useful if the new version of the language had a way to invoke the old version of the language built-in. Forwards compatibility is impossible, but backwards compatibility isn't. (Yes, that's a bit more extreme than backwards compatibility usually means, but then so is the change.)

      What I'm asking for isn't quite impossible. I'm asking for the new version to allow separate "compilation" in the old language, but to the new binary format. Python, after all, *IS* a compiler, it just compiles to a virtual machine that runs the code.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    28. Re: Only One Question by BurningFeetMan · · Score: 1

      What complaints do you have on 3 that deter you from its usage?

  3. Re:Why in the heck should a file server need 2M li by Anonymous Coward · · Score: 0, Flamebait

    Because it's written in Python.

  4. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 5, Insightful

    Because he understands the problem Dropbox is trying to solve better than you do.

  5. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    So he created Python AND Dropbox? I don't think so.

  6. Damn! by sycodon · · Score: 2, Funny

    I was expecting an interview with John Cleese.

    --
    When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
    1. Re:Damn! by destinyland · · Score: 2

      He's said that he named the language "Python" partly because he was a big fan of Monty Python's Flying Circus.

    2. Re:Damn! by Anonymous Coward · · Score: 0

      The rationale and logic of Monty Python is also reflected in the Python language....

  7. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    When we replaced our PHP inventory system with one written in Python, it only requires 11 lines of Python on average versus PHP. 2M sounds like they're doing something wrong.

  8. I'd rather by Anonymous Coward · · Score: 1

    "He describes what it's like being Python's Benevolent Dictator for Life"

    I'd rather be Python's Benevolent Dictator for the School of Sillywalks for Life.

  9. Re:Why in the heck should a file server need 2M li by sycodon · · Score: 2

    He meant to say 2 million functions in one line of code.

    --
    When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
  10. Re:Why in the heck should a file server need 2M li by Anonymous Coward · · Score: 2, Informative

    It's the "serves hundreds of millions of users" part. I know "web scale" is an overly used buzzword but it is in fact very difficult to serve huge numbers of users. There's also collaboration tools, an API for other developers to integrate Dropbox into their own software, etc.

  11. Re:Interpreted languages should cease by Anonymous Coward · · Score: 3, Funny

    You had me up till you said Java.

  12. Re:Interpreted languages should cease by __aaclcg7560 · · Score: 4, Informative

    Learn how to use a compiled language like Java.

    If you have a need for speed, compile Python code to C binary with Cython.

    http://cython.org/

  13. Re: Why in the heck should a file server need 2M by slazzy · · Score: 3, Informative

    "seen built" didn't say he built it himself.

    --
    Website Just Down For Me? Find out
  14. Re:Interpreted languages should cease by Anonymous Coward · · Score: 2, Funny

    Java is a horrible language to use compared to Python. At least say something smart sounding like Go or Haskell.

  15. Re:Interpreted languages should cease by Anonymous Coward · · Score: 1

    Learn how to use a compiled language like Java. It's far more flexible in what it can do and it runs a lot faster.

    There are lots of excellent compiled, statically typed languages. Java isn't one of them: it's a programming language design disaster.

  16. Re:Interpreted languages should cease by TheCreeep · · Score: 1

    No, no, no! Not that compiled-to-machine-code crap!
    The guy clearly said people need something lean and fast. Like the java virtual machine, for which you compile to BYTE CODE!!!1!

  17. Re:Interpreted languages should cease by inode_buddha · · Score: 1

    I wanna see facebook rewritten in perl. I bet it would be faster. No, I'm not a sadomasochist, why do you ask?

    --
    C|N>K
  18. Php is a disaster by Anonymous Coward · · Score: 0

    Well php is a programming language disaster. Java is just too verbose. Python uses invisible whitespace for closures and JavaScript has an addon jump table for functions and class methods.
    Perl is just right except for the multiple ways of returning an error. Is it undefined? Or zero? Or a null?
    Ruby has the strangest use for the pipe character. Haskell decides to monadify your code like monogamous monks. No extraneous print statements for you.
    Decorators anyone? When has preprocessor code suddenly become a valid addition to a language spec?
    Rant over. Let's stick to visual basic.

    1. Re:Php is a disaster by darkain · · Score: 1

      i still use qbasic, you insensitive clod!

    2. Re: Php is a disaster by Anonymous Coward · · Score: 1

      The guy in the test lab at work uses gwbasic.

    3. Re: Php is a disaster by Z00L00K · · Score: 1

      I can agree that php is a disaster. But visual basic is bad, and so is vbscript.

      Java isn't verbose compared to many other languages. Ever tried to do anything in Cobol?

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    4. Re: Php is a disaster by MichaelSmith · · Score: 2

      Its funny. I have heard Java described as the new Cobol. Its not so much that the java language is verbose. Its more that its ecosystem of APIs is verbose in the way you go about using them, and the scalabilty of the language seems to cause software architectures to grow out of control.

    5. Re:Php is a disaster by gustygolf · · Score: 2

      Perl is just right except for the multiple ways of returning an error. Is it undefined? Or zero? Or a null?

      There's no null in Perl (5). Well, 'undef' is technically a null, but that's covered by your 'undefined'.

      Both zero and undefined are false when evaluated in a boolean manner. So return either. It doesn't really matter most of the time.

      I prefer to return an empty list: just a plain return; does that.

      --
      "Slow Down Cowboy! It's been 58 minutes since you last successfully posted a comment" -- slashdot, driving users away.
    6. Re:Php is a disaster by dgatwood · · Score: 1

      Well php is a programming language disaster.

      Not really. It's basically just interpreted C with classes, plus sigils ($), minus the need for variable declarations (but with C typecasting).

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

  19. Re:Interpreted languages should cease by __aaclcg7560 · · Score: 3, Interesting

    Like the java virtual machine, for which you compile to BYTE CODE!!!1!

    Serpent, maybe?

    Serpent is a real-time scripting language inspired by Python but completely reimplemented to support real-time garbage collection and multiple instances of the virtual machines running on independent threads.

    https://sourceforge.net/projects/serpent/

  20. Re:Why in the heck should a file server need 2M li by 93+Escort+Wagon · · Score: 4, Insightful

    He meant to say 2 million functions in one line of code.

    We're talking about python, not perl.

    --
    #DeleteChrome
  21. He Didn't Ask the Big Question by speedplane · · Score: 5, Interesting

    I know this article was focused on Guido's softer side, but would have liked them to mention the elephant in the room: the move from Python 2 to 3. This been a huge resource drain on the entire community and many (including me) remain unconvinced that it was the right decision. It would have been nice if the topic was broached.

    --
    Fast Federal Court and I.T.C. updates
    1. Re:He Didn't Ask the Big Question by plopez · · Score: 1

      You obviously don't know what a "fluff piece" is or a "fluffer".

      --
      putting the 'B' in LGBTQ+
    2. Re:He Didn't Ask the Big Question by TheGratefulNet · · Score: 0

      yup, python 2 and 3 are a nightmare, having to worry about 2 systems that are close enough and yet not really compatible. AT THE SAME TIME! has there ever been another language that had 2 variants present at the same time, were both kept up and used? I've seen languages transition (and i know perl will be listed as an example with perl 4 and 5 being 'out there' at the same time and also incompatible for the most part). I never liked perl, btw, so I never counted it as a serious language; and yes, I realize that in days of old, perl was *the* sysadmin tool of its day, but its syntax still made me sick to my stomach)

      so, the 2 versions of python is a huge problem.

      and the fact that spaces are what they are in python, also a huge problem. just wait for the marketing guy to post 'helpful source' of python examples to his webserver and see the spaces get messed up; and the users will have no idea what the TRUE intenting is supposed to be! you can take every single space out of a C program (outside of quotes, of course) and reindent with no loss. pure wisdom! can't even think of doing that with python.

      guido, you are a smart man, to be sure; but you are not perfect. why didn't you listen to 'us' and fix the spaces thing? would it really have caused you physical pain?

      huge problem with the language. I do like python (much of it) but I'll never say the idea of spaces-being-significant was ever anything but a STOOPID idea. guido's ego would not let him ever admit it and that's his one main flaw. he will not ever admit that, on this one issue, he was 100% dead wrong.

      and yes, at least twice I've had to fish python code from a text box that a marketing puke posted and yes, it was never possible to know what the blocks were supposed to be indented under. it 'compiled and ran' no matter what we did, but there was no hint as to what the real indentation should have been and its quite wrong to have the user 'figure it out' from posted source that should Just Plain Work(tm).

      --

      --
      "It is now safe to switch off your computer."
    3. Re:He Didn't Ask the Big Question by Anonymous Coward · · Score: 0

      hahaha... I take it you have never used PHP. Now that is an effing nightmare of a language.

      What I do in python is create "fake curly brackets" in comments, and then make sure those match.

    4. Re:He Didn't Ask the Big Question by Anonymous Coward · · Score: 0

      you can take every single space out of a C program (outside of quotes, of course)

      if(0);else printf("moron\n");

    5. Re: He Didn't Ask the Big Question by Anonymous Coward · · Score: 0

      You literally just proved his point. Then called him a moron after you showed he was right and you were wrong.

      So fucking sad.

    6. Re: He Didn't Ask the Big Question by spitzak · · Score: 1

      There is a space between "else" and "printf" that can't be removed.

  22. Would've been better in Perl by bretts · · Score: 2, Informative

    QED. Search your feelings, Luke. You will see that Perl is the path to enlightenment.

  23. Python community so much nicer than Rust's? by Anonymous Coward · · Score: 2, Interesting

    What I'm most curious about is why the Python community is so much nicer to deal with than the Rust programming language's community.

    I've seen so much help and compassion from the Python community. I'm not just talking about questions that I've asked, but questions and problems that I've witnessed other people ask about. The Python community is always so supportive, and in all of the right ways. They aren't smug or holier-than-thou. They don't tell you "you're doing things wrong". They may ask for more information, but then they always provide a helpful response without resorting to snark or a bad attitude. They're friendly and pleasant people to deal with.

    Then there's the Rust community. In my opinion and experience, it's so much worse than the Python community to deal with. The smugness is pretty extreme from them. They will often tell you that you're "doing it wrong", even when you're doing something a certain way for a very good reason that they just don't/can't comprehend. It's almost like they're more concerned with their own feelings than with helping somebody who is in needed. And you'd better hope that you don't say the wrong thing at a site like Hacker News or reddit, because the Rust downvote squads will take you out quite rapidly! The last thing they want to hear is legitimate criticism of Rust. All of the emphasis that the Rust community places on the Rust Code of Conduct and the Rust Moderation Team apparently doesn't do any good, because the Rust community is not one that I like to deal with!

    Maybe it's a maturity/age thing that causes the Python community to be so much nicer to deal with? The Python community members are generally older and more experienced. The Rust community members are typically much younger, with some of them not even being out of high school yet. Maybe the Python community is better to deal with because the Python community members have more professional real-world experience, while Rust community members often have none at all? The Python community members are more laid back and confident with providing help, while the more immature Rust community members are on a quest to inflate their sense of self worth?

    1. Re:Python community so much nicer than Rust's? by Anonymous Coward · · Score: 0

      I'd noticed this as well, but much more Python vs Ruby - I haven't had much to do with Rust. The Ruby side seems to be concentrated around Rails, but smug-hipsteritis is noticeable throughout the Ruby communities.

      Python's communities just seem to be a bunch of nice people trying to help. Even when you get a "that's not Pythonic!" response, it usually comes with an explaination of style, a link to a PEP or a note that this is the responders' personal preference, rather than an arrogant "Don't do that, and if you don't know why I won't tell you". Many discussions of Python, Perl or other languages would have Ruby proponents descending on it in droves just to say "Ruby can do that too!".

      It's been a few years since I delved into anything to do with Ruby, so it's possible that the bad elements have moved on (to Rust perhaps?). The creator of Ruby seems an agreeable enough guy, it was a shame the community around it had a toxic feel.

    2. Re:Python community so much nicer than Rust's? by Anonymous Coward · · Score: 0

      One interesting thing about Ruby is that some of prominent members of its community jumped ship to Rust, I think when it became clear that the Ruby hype was really starting to die down. Now these people have become well-known within the Rust community. Rust is in many ways the second coming of the Ruby hype, with some of the same people involved.

    3. Re:Python community so much nicer than Rust's? by im_thatoneguy · · Score: 5, Insightful

      What I'm most curious about is why the Python community is so much nicer to deal with than the Rust programming language's community.

      In my limited experience in the VFX world it's because people using Python are focused on actually creating usable products that solve people's problems. And I use the word "people" not "developers" in this instance because a lot of them are "non-programmers" solving problems that they themselves face. Python is a tool to them to make their lives better.

    4. Re:Python community so much nicer than Rust's? by LesFerg · · Score: 1

      What I'm most curious about is why the Python community is so much nicer to deal with than the Rust programming language's community.

      Damn, and I had just decided to start learning Rust as a non .Net, outside-of-work, new experience. So by the time I get enough idea of what I am doing to need to ask for help, you think I will feel neglected?

      I always did enjoy Python tho, maybe I should just go back to that for my non .Net fun.

      --
      If I had a DeLorean... I would probably only drive it from time to time.
    5. Re:Python community so much nicer than Rust's? by allcoolnameswheretak · · Score: 1

      A big part of it probably comes down to age. Python is 25 years old now. A large part of its users will be an older, calmer and wiser audience. Rust is a relatively new language, so its userbase will consist of many younger, more hot-headed "avant-gardists" types.

    6. Re:Python community so much nicer than Rust's? by 110010001000 · · Score: 1

      Python is actually used by real adult people to do actual work. Rust is just a plaything for hipsters. It isn't used in the industry.

    7. Re:Python community so much nicer than Rust's? by Viol8 · · Score: 1

      You have to be reasonably good at programming to use python effectively. Yes, you might be able to write a hello world program in 2 lines but its not a beginners language and neither are the concepts it uses so I doubt these "non-programmers" you mention are any such thing. Sure, they might not do programming as a *profession* but they obviously have previous programming experience.

    8. Re:Python community so much nicer than Rust's? by Anonymous Coward · · Score: 0

      That depends on the programmer, I think. I find things like Python and Common Lisp much easier than wrestling with the nuances of Java, Ruby, or C++, and perhaps equivalently hackish to C, but much slower in any given application. So if you're doing some things, you have no choice but to go down low. Lisp may let you wrestle it into shape, but Python will never compete with an optimized C program. Either way, it will be much harder to write the optimized version (IMHO). If you're talking about writing "hello world" level programs then that belongs more to a discussion about pedagogy than here.

      Afterthought: You must be right, though, because people keep using Java for whatever reason.

    9. Re:Python community so much nicer than Rust's? by Anonymous Coward · · Score: 0

      At least they're communicative. You get nothing more than RTFM from the R "community"

    10. Re:Python community so much nicer than Rust's? by DrXym · · Score: 2
      Except of course Rust *is* being used in the industry. A case in point is Dropbox which is moving from Python to Rust on its servers and migrating from Amazon cloud services while its at it. Presumably they got fed up with Python's performance, wanted something faster yet still safe and decided that Rust was a good fit.

      Rust certainly isn't a defacto choice when thinking of how to implement a solution at this time, but it has some characteristics that do make it a very attractive consideration. I think it would be a good fit for embedded solutions, IoT, drones, rocketry, industrial control systems and basically anything else that needs to be extremely reliable and performant. On the flip side Rust exacts an upfront development penalty in blood for this reliability because any violations of its strict lifecycle / ownership rules will generate compile errors.

    11. Re:Python community so much nicer than Rust's? by Anonymous Coward · · Score: 0

      They are non-programmers who are trained in programming to do their "real" job (generally scientists and engineers). Their out look is different (more pragmatic and more likely to be write once code to solve a specific problem).

    12. Re:Python community so much nicer than Rust's? by hondo77 · · Score: 2

      I've seen so much help and compassion from the Python community.

      The compassion comes from the shared suffering. :-)

      --
      I live ze unknown. I love ze unknown. I am ze unknown.
    13. Re:Python community so much nicer than Rust's? by HiThere · · Score: 1

      Well, that makes sense, and explains the attention that numPy gets (also Cython), but I have a hard time believing that it's THAT large a percentage of the developer community.

      My guess is that it's largely age related, which some large effect coming from "leading from the top". Guido is rather easy-going, and he doesn't encourage others to be harsh or abrupt.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    14. Re:Python community so much nicer than Rust's? by Half-pint+HAL · · Score: 1

      You have to be reasonably good at programming to use python effectively. Yes, you might be able to write a hello world program in 2 lines but its not a beginners language and neither are the concepts it uses

      In what way? It's quite popular as a beginners' language and is used in quite a few schools. The main problem I see with it as a beginner language is that most curricula have a rather set idea of what is an "elementary" programming structure. Python's iteration over lists by member doesn't match with the assumption in many curricula that iteration is performed by index, for example. Or another example: the Scottish curriculum mentions arrays specifically, so you either have a choice of A) using Python non-Pythonically and fake it so that you always use a list like it was an array (and teach bad Python); B) use Python's lists and call them arrays (and teach bad general programming) or C) import an array class (and then have to faff around with methods rather than the Python built-ins, even if only having a constructor).

      The other thing that seems to make Python difficult as a beginner language is... (wait for it)... (you knew someone was going to talk about it)... (come on, have you not guessed yet?)... semantic whitespace!. I haven't done a great deal of Python teaching yet (trainee teacher, I had one placement in a school using it), but the kids I saw using it really struggled with seeing code flow. Indents and dedents were seemingly at random. Trying to explain the concept of a "block" without some kind of clear visual enclosure is actually pretty hard.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  24. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    That doesn't make any sense.

  25. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    Wrong : because he's an old-school thinker : more lines = more impressive.
    He could as well have argued that his Python language served more cat pictures than any other language.

  26. What the fuck? Python 3 was very well done. by Anonymous Coward · · Score: 2, Interesting

    Too bad van Rossum fucked up the transition to version 3.

    Actually, Guido didn't "fuck up" the transition to Python 3. It was done almost perfectly.

    People using Python 2 haven't been affected by it much. They can upgrade whenever they want, and Python 2 has still seen excellent support from the Python maintainers.

    Meanwhile, Python 3 has been able to resolve some serious problems with Python 2, providing a much richer and more useful language. Developers have been moving to Python 3 at their own pace, which is exactly how it should be!

    Now that Python 3 has proven itself, it's seeing widespread adoption within the Python community. It's what almost everyone is using for new code.

    If you want to see an example of a real fuck up, look at Perl 6. That's a real disaster! Here we are, over 15 years later, and there's still so little to show. Rakudo is an awful joke. Even the Perl 6 logo is goddamn childish.

    Another example of a really fucked up programming language is Rust. They kept promising Rust 1.0, and then it kept getting pushed back again and again. But while this was happening the language was changing significantly almost every day. So code you wrote on a Monday often wouldn't compile at all by the following Wednesday, and would need significant reworking by the following Friday! The first impression a lot of people got about Rust was a lack of stability and having to rewrite their code every week. Even the 1.0 release was pathetic. Despite being "stable" releases, it took them up until Rust 1.6 to get their libcore stable!

    1. Re:What the fuck? Python 3 was very well done. by hankwang · · Score: 2

      "Now that Python 3 has proven itself, it's seeing widespread adoption within the Python community. It's what almost everyone is using for new code."

      Maybe I should look into Python 3 again, then. A few years ago, I was rather turned of by the deprecation of the % interpolation operator on strings, since 75% of what I do with Python involves number crunching and then writing those numbers in ascii as "%.4g\t%.4g\t%.4g\n" strings. The other 25% involves string processing of ascii with an occasional utf8 or latin1 character. All the obligatory encoding and decoding drove me crazy.

      Just a week ago, I wrote a small (300 lines) Python/scipy program for a (windows-using, non-python-using) coworker and told him to install PythonWin to run it. Big mistake: he installed 3.4 while I developed for 2.7 and it was error messages all over the place. At least the incompatibility is so gross that you notice it immediately if you use the wrong version. I imagine that there will be similar, though more subtle, issues if I use 3.4 and want it to run with someone who uses 3.2 in some LTS linux distro. Or the other way around. I guess that's the price of using a llanguage that is under active development.

    2. Re:What the fuck? Python 3 was very well done. by Anonymous Coward · · Score: 0

      Even the 1.0 release [of Rust] was pathetic. Despite being "stable" releases, it took them up until Rust 1.6 to get their libcore stable!

      -1 Troll. For those not closely following its development, "stable" in Rust means "interface doesn't change, ever", not "fit for production use".

    3. Re:What the fuck? Python 3 was very well done. by LesFerg · · Score: 1

      Actually, Guido didn't "fuck up" the transition to Python 3. It was done almost perfectly.

      So why are they releasing updates to version 3.4.x after releasing updates to 3.5.x?
      Are developers now splitting into those who use the 3.4 branch and those who use 3.5? That is, all those who are not still using 2.7 something?
      How perfect is it exactly?

      --
      If I had a DeLorean... I would probably only drive it from time to time.
    4. Re:What the fuck? Python 3 was very well done. by silentcoder · · Score: 2

      % interpolator is still there and still works - it is not recommended since the .format method is much more powerful and well worth the transition, but the old way should keep working (at least in part to make porting code like yours easier and allow a piece-by-piece port).

      Probably the single incompatibility that causes by far the most problems is actually the deprecation of the print statement, but one could argue it should never have existed. Print has always behaved like a function, it should have been one all along.

      The second biggest incompatibility is that most sub-indexing methods (like Dict.keys()) are now iterators. This is a hugely useful change since the vast majority of calls to them are in for loops and using iterators are far more memory efficient in that event. But it can cause some issues if you have code like this:

      x = {'a': 'b'}
      y = x.keys()

      In python 2 y would have the value ['a'] but in python3 it would be a function object because x.keys was an iterator. The quick fix is:
      y = list(x.keys()) which will convert the iterator to a list correctly.

      Fix those and almost every other change is transparent and you are unlikely to encounter them (I speak having ported a number of python2 projects to python3). Unless you're doing something like encryption which is full of work-arounds for python2's terrible string/bytes model, you probably won't even see the rest.

      --
      Unicode killed the ASCII-art *
    5. Re:What the fuck? Python 3 was very well done. by Anonymous Coward · · Score: 0

      But it can cause some issues if you have code like this:

      x = {'a': 'b'}
      y = x.keys()

      In python 2 y would have the value ['a'] but in python3 it would be a function object because x.keys was an iterator. The quick fix is:
      y = list(x.keys()) which will convert the iterator to a list correctly.

      And the 2to3 utility will make that change for you.

    6. Re:What the fuck? Python 3 was very well done. by hankwang · · Score: 1

      I just read that the string % operator is no longer deprecated or scheduled for removal, as of Python 3.3:

      http://stackoverflow.com/quest...

      And yes, .format() is more flexible, but it requires much more typing for my typical case of printing 5-10 float values on a line and I wouldn't say that the end result looks more clear either.

      None of the error messages on my 300-line script was about the issues that you mention, except maybe that xrange() doesn't exist anymore because range() itself is an iterator in Py3. It was mostly about stuff that changed names or moved to different modules. I suppose that migrating is easier if you use a migration tool, but this run-py2-code-on-py3 incident was not really planned...

    7. Re: What the fuck? Python 3 was very well done. by Anonymous Coward · · Score: 0

      So they moved the goalpost and changed the meaning of the word stable then? Is that what you are saying?

      When I hear the word stable(in software land) I think production ready.

    8. Re:What the fuck? Python 3 was very well done. by mattventura · · Score: 1

      The version incompatibilities are more of a Windows thing, since *nixes use the #! convention to allow a script to specify an interpreter. If it needs python 2, it can specify python2, and the same for python 3.

    9. Re:What the fuck? Python 3 was very well done. by tepples · · Score: 1

      So why are they releasing updates to version 3.4.x after releasing updates to 3.5.x?

      For two reasons. First, to make life easier for maintainers of long-term-supported GNU/Linux distributions. Second, because minor versions of Python historically break binary compatibility with extensions, and most users of Python for Windows have no way to recompile extensions that include native code for a new minor version.

    10. Re:What the fuck? Python 3 was very well done. by LesFerg · · Score: 1

      If 2.5 can't even be kept backwards compatible with 2.4, how do they expect people to believe that switching from 2.7 to 3.x is a single easy conversion?

      --
      If I had a DeLorean... I would probably only drive it from time to time.
    11. Re:What the fuck? Python 3 was very well done. by LesFerg · · Score: 1

      oops, that was 3.5 & 3.4... typing too fast.

      --
      If I had a DeLorean... I would probably only drive it from time to time.
    12. Re:What the fuck? Python 3 was very well done. by Half-pint+HAL · · Score: 1

      Print has always behaved like a function, it should have been one all along.

      As a side note, I really wish Python-speak didn't refer to procedures as functions....

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    13. Re: What the fuck? Python 3 was very well done. by silentcoder · · Score: 1

      Thats an inheritance from C.

      --
      Unicode killed the ASCII-art *
    14. Re: What the fuck? Python 3 was very well done. by Half-pint+HAL · · Score: 1

      You can't inherit from C -- it has no objects! (sorry)

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  27. Python by Anonymous Coward · · Score: 0

    Man I hate Python with a passion

  28. Re:Interpreted languages should cease by Anonymous Coward · · Score: 0

    people need something lean and fast. Like the java virtual machine, for which you compile to BYTE CODE!!!1!

    Like C object code, or LLVM object code, or WebAssembly object code, or JIT compiled Java code...

    Even ASM.js is faster than Cython output.

  29. Where's the rabbit by Anonymous Coward · · Score: 0

    He is a good programmer. People like that are real programmers not only got crazy about the C standards stuff... But because created a computer language (good useful one, not only bonkers). I think this guy should be taken and tortured with a plastic back until he tell us the secrets behind Apple. Trust me guys, it's reading a porn mag.

  30. Re:Interpreted languages should cease by Anonymous Coward · · Score: 0

    It can probably be made as a one-liner.

  31. Funnily by Greyfox · · Score: 3, Insightful

    I was just talking to an old Co-Worker from a C++ company I worked at a few years back. He asked "So what are you doing lately" and I told him I'm working on my thesis, which is titled "Ruby's a Terrible Programming Language, And You're A Terrible Programmer For Liking It". Then I cited a number of my complaints -- being able to add arbitrary functions to a live object, never knowing where to look for the interface definition of parameter objects, need to extensively test all execution paths of production code (Which no one ever does,) odd syntactic quirks and changes in syntax between language versions. He laughed and said he had exactly the same complaints about Python. You see, Object Oriented Programming was invented to reduce maintenance costs for completed projects, because that's where 90% of your expenses with the project will be. Ruby, at least, and apparently Python as well according to my friend's complaints, were invented to make the cheap part of the development process "easier", while at the same time letting the language fanboys pat themselves on the back about what clever programmers they are. This is exactly the opposite of software "engineering".

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    1. Re:Funnily by MichaelSmith · · Score: 1

      Yeah I am a python programmer and the only thing I would add is that javascript is worse because it doesn't have a compiled format. Source code is directly included. If I include module B after module A, it can rename parts of A to its heart's content.

    2. Re:Funnily by Anonymous Coward · · Score: 0

      Ruby, at least, and apparently Python as well according to my friend's complaints, were invented to make the cheap part of the development process "easier", while at the same time letting the language fanboys pat themselves on the back about what clever programmers they are. This is exactly the opposite of software "engineering".

      You, and I'll bet your friend, clearly are not qualified to comment on Python, yet you seem very willing to not only dismiss it but make sneering comments about the people who made Python.

      It is a popular language. Are all the Python users wrong to like it? Are you sure?

      I attended several presentations about scientists adopting Python and abandoning dead-end legacy languages. Python, purely on a practical level, is a great tool for getting science done. Should NASA stop using Python? Are you sure?

      I know multiple languages, and for general-purpose development I get more done, faster, and with fewer lines of code when I use Python.

      I share your distaste for Ruby. Things like the difference between the .. and ... notations drove me crazy. Python, while not perfect, is cleaner and more regular than most. It has no sigils, has nothing like the .. and ... mess, and only calls functions when you stick parentheses after a function reference. It is soothing rather than maddening.

      Python isn't perfect, but then nothing is. It is, however, very good. You don't have to like it, but you are wrong to sneer at it.

    3. Re:Funnily by nnull · · Score: 2

      If python is good enough for the NSA and NASA, I'm pretty sure it's good enough for me.

    4. Re:Funnily by MichaelSmith · · Score: 1

      Its funny. I am doing work now in python which I was doing in fortran in 1986.

    5. Re:Funnily by vtcodger · · Score: 1

      Maybe it's just me, but my feeling is that objects are like salt. A little can do wonders for a bland food product. Too many can be worse than none at all. Having all file type objects behave the save and provide the same interface makes Python very easy to use -- when dealing with filish sorts of things. Defining new object types with new (often poorly described) interfaces just adds another layer of obscurity to the coding process.

      BTW, it seems to me that one of Python's virtues is that it supports a variety of programming styles -- procedural, object oriented, functional -- pretty well.

      But what do I know? I'm old. And no longer smart. And I was never a very good programmer anyway.

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
    6. Re:Funnily by MichaelSmith · · Score: 2

      Why can you not test all execution paths in Ruby?

      You never can. Its the big failing of automatic unit tests. With strong typing your compiler can help with static analysis. But with weak typing you rely on unit tests to detect regression but because of the proliferation of code paths, you can't do that either.

    7. Re:Funnily by MichaelSmith · · Score: 1

      Having all file type objects behave the save

      I couldn't agree more!

    8. Re:Funnily by Anonymous Coward · · Score: 0

      Pretty much.
      At my university I switched from bash and a host of other crap like awk and whatever else to python.
      It's also easier and faster to quickly write something in python to test it out than to use C or something.
      Maybe long term maintenance and testing are harder but that's not a problem I've encountered.

    9. Re:Funnily by Anonymous Coward · · Score: 0, Troll

      Bunch of bullshit from someone who thinks he's too elite and smart for these languages. Let me out elite and outsmart you and throw some actual computer science at you. All these languages are Turing complete and in all Turing complete programming languages you can make anything from a total mess to smart and efficient code. And the biggest mess can be made in the lower level languages. In computer science, abstraction is progress. You are no longer writing in assembler are you? So using something like Python over C++ (lol) is indeed in most cases better software engineering, making software easier to maintain, especially as the project grows. 1 million lines of Python is easier to grasp than 3 million lines of C++, if you manage to look through the fast layers of nuts and bolts anyway. People who are snubbing modern languages are usually just people scared of change. It means an erosion of their old knowledge. And then they get nasty and start kicking against 'fanboys'. If you're scared, ok, but it makes you look very sad and lousy human beings if you try to revert that by damaging others while hilariously advertising yourself as the truly elite, which you are not. Go and collect some garbage and prevent memory leaks or overflows, while the rest of us actually build stuff. Like for instance all the stuff that made up websites over the past 20 years. Like slashdot. Maybe you should try to reimplement it all with compiled C++, the most crappy lower-lever language out there.

    10. Re:Funnily by Bongo · · Score: 1

      Interesting, and I always like hearing what people have learn from real and long experience. But I think there's a certain amount of begging the question. If you believe things should be more disciplined in an engineering sense, then sure, any or many problems which come up, can be seen to be due to lack of good engineering. Alternatively, someone could believe that problems came up due to a lack of good intuition about the nature of the project.

      But whilst some languages can look more disciplined, it is harder to say anything about which languages are better for working more intuitively. I'm no programmer, but what few books I read about programming, or how to program, or how to think about programming, sound like they are searching for a "logical answer" to the issue, yet what they come up with often reads as just a bunch of rules of thumb learnt from experience in certain contexts with certain kinds of projects.

      Which is fine, but the moment one starts pretending that these rules of thumb are a discipline like engineering, the moment in a sense, it seems to me, one misses the point. Take the whole thing about "design patterns": that idea came from Alexander's A Pattern Language, which was some guy taking tours of Italian towns and trying to come up with some rules of thumb for why some of the piazzas felt so nice. They are hints, intuitive reflections, artistic observations, and not "engineering".

      Likewise, given projects can become so large, there might be more of a case for saying that, management rules about how to organise people and collaborate, have much more to do with the nature of the project than "engineering". A language might not be better for a project because it is more "engineering" like, but because it makes it easier for managers to control what people are doing, for example.

      If there is one thing that strikes me as hard about code, even in the paltry little script stuff I do for work, it is that the hard thing about code is in how to organise it. I mean one can organise it, but it is easy to organise it wrong.

    11. Re:Funnily by Anonymous Coward · · Score: 0

      That would be considered a pro to some.

      Being able to overwrite a function to hook into it, ie below, is quite powerful

      ```javascript
      (function(send){
          XMLHttpRequest.prototype.send = function(data){
              console.log("I'm watching you!");

              send.call(this, data);
          };
      })(XMLHttpRequest.prototype.send);
      ```

    12. Re:Funnily by Anonymous Coward · · Score: 0

      If python is evil enough for the NSA and hackish enough for NASA, I'm pretty sure it's good enough for me.

      ftfy

    13. Re:Funnily by Jahta · · Score: 1

      I was just talking to an old Co-Worker from a C++ company I worked at a few years back. He asked "So what are you doing lately" and I told him I'm working on my thesis, which is titled "Ruby's a Terrible Programming Language, And You're A Terrible Programmer For Liking It". Then I cited a number of my complaints -- being able to add arbitrary functions to a live object, never knowing where to look for the interface definition of parameter objects, need to extensively test all execution paths of production code (Which no one ever does,) odd syntactic quirks and changes in syntax between language versions. He laughed and said he had exactly the same complaints about Python. You see, Object Oriented Programming was invented to reduce maintenance costs for completed projects, because that's where 90% of your expenses with the project will be. Ruby, at least, and apparently Python as well according to my friend's complaints, were invented to make the cheap part of the development process "easier", while at the same time letting the language fanboys pat themselves on the back about what clever programmers they are. This is exactly the opposite of software "engineering".

      Well you can write terrible code in any language; C/C++ projects are no different. The "engineering" part is between the keyboard and the chair; a fool with a tool is still a fool. That's why testing matters and, with modern automated testing, full test coverage is not difficult.

      Python is a well structured, expressive, language that is suitable for many types of application. You don't even have to write OOP code if you don't want to; though if you do, Python has good OOP support. OOP is not a magic fix for maintenance costs. Well structured code (OOP or not) is what makes maintenance easy.

    14. Re:Funnily by Anonymous Coward · · Score: 0

      Then I cited a number of my complaints -- being able to add arbitrary functions to a live object

      I don't like or use Ruby, but would you care to elaborate? Why is it such a bad idea? Isn't just that the point of dynamic languages, that you're able to morph and adjust at runtime?

      Of course, that makes static analysis downright impossible, but that's like complaining that you can't use a motorcycle to transport a refrigerator.

      As to syntactic "quirks", every language except lisp has them; that's one of the perks of being a "language designer": you're able to force your pet peeves and anal retentiveness down everybody's throat. (I can easily imagine Larry Wall pushing a grunt of pleasure everytime I'm forced to use a chain of if-elsif where a switch block would have been so much nicer).

    15. Re:Funnily by speedplane · · Score: 1

      It ... only calls functions when you stick parentheses after a function reference.

      Python police: Pyhton's @property decorator allows you to call a function merely by referencing a variable.

      --
      Fast Federal Court and I.T.C. updates
    16. Re:Funnily by HiThere · · Score: 1

      Well, computers are faster now.

      FWIW, modern Fortran is an excellent language that doesn't get enough respect. But that isn't enough to make me use it. Partially because, since it doesn't get enough respect, most libraries that I would need are foreign function calls.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    17. Re:Funnily by MichaelSmith · · Score: 1

      I honestly don't understand what the advantages of weak typing are

      It saves a bucket load of interface definitions and references, which arguably makes the code cleaner. When things are kept simple, duck typing works quote well but if you get into interfaces with dozens of methods it is possible to lose track. APIs which have been translated from java are easy to spot in python for their "everything in the box" approach.

    18. Re:Funnily by silentcoder · · Score: 1

      @property only works for class methods, not all functions.

      In which case it creates a dynamic class property that can be treated like a variable (you can even create variants that can be assigned values).

      But it does not apply to pure functions. The class method type is a descendant of the function type, but it's not the same type.

      --
      Unicode killed the ASCII-art *
    19. Re:Funnily by MichaelSmith · · Score: 1

      Its more that the rich feature set of java gives developers a way to create needlessly complex architectures. Of course it shouldn't happen that way but I have seen a few really bad examples.

  32. Python by Anonymous Coward · · Score: 0

    Man I passion a Python with hate

  33. Re:Python by MichaelSmith · · Score: 1

    Why?

  34. Re: Interpreted languages should cease by Z00L00K · · Score: 1

    I would say the opposite - interpreted languages like python are a huge problem when it comes to maintenance in the long run. I have seen many systems rendering headaches that would be figured out during compile time in a non-script language.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
  35. Comment removed by account_deleted · · Score: 4, Insightful

    Comment removed based on user account deletion

  36. Re: Why in the heck should a file server need 2M l by vtcodger · · Score: 2

    Why 2M lines? At a guess, core functionality is a few thousand lines or maybe a few tens of thousands of lines. Plus a LOT of management software -- report generators, collecting garbage at the application level, etc, etc,etc, . And it has to talk to its users through HTML which has a lot of virtues, but is extraordinarily klunky at times. It does probably email. And it replicates ftp sorta? It distributes work over a vast complex of servers. It presumably does billing, and payments, and all that stuff -- 500 million users is a few more than I'd entrust Intuit's off the shelf software to do. (Actually, 1 account may be more than I'd trust to Intuit). And it tries to be secure which means you can multiply the complexity of even the simplest undertaking by a factor of about seven.

    But you're right. 2M lines is a lot of code.

    --
    You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
  37. Re:Why in the heck should a file server need 2M li by vtcodger · · Score: 1

    > We're talking about python, not perl.

    Same language pretty much. The difference being that if you have to look at your code six weeks later, you have some chance of being able to figure out what the Python code does.

    --
    You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
  38. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    Linux has ~10M lines of code and it's one fo the most used piece of software in the world. File management is a tiny portion of those lines with the file system called ext4 being just 30K lines. To say you need 2M lines of code to implement a Dropbox-like service properly (including the frontend and similar) is lying to oneself about how efficiently it was made.

  39. I hate Python by Anonymous Coward · · Score: 0

    I know I'm probably going to be modded a troll, but this post is serious.
    I really do hate Python. From the stupidity that was "twisted" to insanity that whitespace should be used to define code blocks.
    I have yet to look at a Python App I have to extend / modify / maintain etc and think to myself "ya know what, Python is an alright choice for this".

    I've used C / C++ , Java, Go, Javascript, Clojure, Perl, PHP, Lua, even Ada and Pascal. I've still never had the same gut churning reaction to code that I get everytime I know I'm going to be dealing with Python.

    What the heck is the attraction? I have never seen anything written in Python that would not have been more concise, performed better and been far more maintainable in pretty much any other language save perhaps Perl.

    Please clue me in. My 20+ years experience is sadly lacking in any Python enthusiasm.
      captcha: syntax

    1. Re:I hate Python by dbrueck · · Score: 1

      I'll bite, though I wish you hadn't posted anonymously. :)

      1) I don't think Twisted is that relevant because it's judging a language based on a library that some third party wrote. And Twisted was insane in part because of the callback-oriented approach to asynchronous programming it took (these days you can use e.g. gevent, which is awesome).

      2) The whole whitespace issue is pretty simple, actually. In all the languages you cited (C, C++, Java, etc.) there's a problem in that in reality there are *two* systems for denoting blocks, and the programmer (and IDE, if used) keeps them in sync. The first is the *actual* system, which are things like the { } tokens in C. The second is the whitespace - you'd be rightfully skewered if you tried to write code without "proper" formatting because it'd be an unreadable mess. The problem is that the language parser cares only about the first one, while the human - intentionally or not - generally leans more heavily on the second one, most of the time.

      Instead of removing the redundancy and having both the machine and the human rely on a single means of denoting blocks, we instead went with the bandaid solution of making the tools help point out errors like this:

      while (x < 100);
      doSomething();

      Python took a different approach and made the language use the same code block delimiter that humans use for both pseudocode and real code: the whitespace. Some people simply don't like that, and that's fine, but for me it makes great sense and I'm pretty skeptical of people who are rabidly against it, since they undoubtedly rely on whitespace all the time, even if it's subconscious.

      3) I use Python a ton, and it's because it's concise while readable, in part due to the language design and in part due to the rich set of built in data types and standard libraries. For any non-trivial task, an equivalent C program (and I love C, BTW) is often 5x or more LOC. That's totally fine because C is great at what it's for, but it's also really great to write 20% of the code to do stuff in Python. A core part of Python's philosophy is to keep in mind that code is read far more times than it is written, so readability is hugely important (for example, the colon at the end of e.g. an 'if' statement wouldn't really be necessary, but Guido et al actually did some code readability tests and found that it improved readability, so he put it in).

      Obviously you can write ugly code in any language, and Python is no exception, but I've found that Python makes it easy to write readable code.

      4) Performance is often a bit of a red herring. Yes, Python itself is quite slow, but in day-to-day work there's often very little code that actually needs high performance. I've worked at several companies with large Python systems and for most parts of the system, if something takes 1ms vs 0.05ms, it just doesn't matter, but the cost of building, testing, and maintaining that component does matter. A lot. Further, huge parts of most Python programs are actually running C code because so much happens in libraries. Doing file I/O? Networking? All of that is really in C. Number crunching, image manipulation, crypto, etc. etc. - it's all C routines in a pretty Python interface.

      Beyond that, in cases where you really do have some chunk of code that has to be blazingly fast, you can easily write it in C and call it from Python (see ctypes, libffi, cython, and so on). Python is by no means a perfect fit for every problem, and it does have its warts, but it's a really terrific fit for a huge set of problems, and a good fit for many more. (and on the performance front I didn't even touch on pypy, which is a drop-in replacement for a large and growing set of Python programs - basically a no-effort perf boost)

      5) The kicker for me actually has to do with your question of "What the heck is the attraction". Developing in Python is just more fun. It's kind of silly, on some level, but you might be surprised by how much that matters. I

    2. Re: I hate Python by Anonymous Coward · · Score: 0

      Thanks for the insights. Liked reading the post even though I have a different assessment.

  40. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    Only if you use perls bells and whistles all at the same time.
    If you use it like c (and the is easy because the syntax is very c like) and comment the odd bits like pattern matching which generally needs a comment in whatever language. Then it is pretty readable and eliminates an awful lot of boiler plate.

    I'm currently generating pdfs from a sqlite db in a couple of hundred lines of code, all readable because I use sensible function names that describe what is happening.

    I find closures and functors much more akin to goto abuse when trying to follow old code.

  41. Re:Interpreted languages should cease by Anonymous Coward · · Score: 0

    Is there somewhere I can learn how to write fast Haskell?
    Because all my attempts end up being extremely slow and spending all their time allocating and freeing memory.

  42. Don't take advice from the successful. Just don't by Anonymous Coward · · Score: 1

    The cognitive biases invoking when the successful examine the reasons for their success are so huge you'd be better off tossing a coin.

    "Don't do something you don't enjoy just because it looks lucrative -- that's where the competition will be fiercest, and because you don't enjoy it, you'll lose out to others who are more motivated."

    Sounds logical, but it's completely wrong. Enjoyable work is overcrowded; lucrative but boring work is so fantastically well avoided by people (because it's boring, and because of nonsense soundbites like the above) that people can sew markets up for years with a product it took them six months to write.

    Van Rossum with his sample size of 1 has pursued an enjoyable thing and made a success of it. I can list 99 people who have pursued an enjoyable thing and predictably made no money from it because lots of other people are pursuing similar things. But people who look for opportunities and work towards them without regard for how much "fun" it is seldom even fail.

    "Where there's muck, there's brass" as they used to say in England. Dirty jobs (which to us means boring jobs) pay extremely well, and they are reliable.

  43. Re: Why in the heck should a file server need 2M l by silentcoder · · Score: 1

    His dayjob is as a senior engineer at dropbox - he did in fact build quite a lot of dropbox.

    --
    Unicode killed the ASCII-art *
  44. Re:Interpreted languages should cease by Wootery · · Score: 1

    Which uses more memory: a small Python program, or a small Java program?

    Also, performance isn't always important. If your program is IO-bound, you might see no real improvement moving from Python to Java, or even to C.

  45. Re: Why in the heck should a file server need 2M l by silentcoder · · Score: 3, Informative

    I can easily see half that change coming just from gaining access to Jinja2. I've worked extensively with a huge array of templating languages in recent years, and while they all have basically the same syntax none of them are anywhere near the sheer unadulterated power that Jinja2 offers.
    It took me a while to figure out just what it was that Jinja2 had that they all lacked and which made such a massive difference. I finally nailed it down. All of them have, right in the beginning of the manual guides on how to write helper functions to extend the language. Jinja2 barely mentions that. The reason is simple: it hardly ever needs them. This is because Jinja2 exposes any data you pass to it as the original python object - with all that object's methods available inside the template.
    That's extremely useful. The problem with the "helper methods" approach is that you're screwed whenever the thing running the template is not code you have access to (or can afford to alter). In a corporate environment you may be using a tool like consul-template which you really don't want to maintain a local derivative off, so you can't use any functions in your templates that their derivative of golang-template did not already include. With Jinja2 even with somebody else's code you still have access to every method the data type object exposes.
    So if you have to get the overlap of two lists in your template from two disparate upstream data sources you don't have to hope the template language includes the right list operators, you just use the built-in methods of the list objects directly.

    Have you seen what a list-overlap seeker written in pure golang-template looks like ? It's a hellish maze of deeply nested loops and if statements and the output enmeshed inside all that gunk because golang lacks a sufficient set method to create new variables that can let you pre-construct your new list before looping over it.

    I had to do just that recently, the golang template was well over 500 lines of unreadable and barely navigatable junk - I did the same thing in less than 5 lines of Jinja2.

    So I can easily imagine that for a web app that's highly template driven you could end up with a huge amount of code that exists within the templates (or as helper-functions to the template library) which you can throw away if you redo it in python.

    --
    Unicode killed the ASCII-art *
  46. Re: Why in the heck should a file server need 2M l by silentcoder · · Score: 5, Interesting

    I suspect a lot of that code lies in redundancy and load-sharing systems. Python is notoriously bad at multithreading (so much so that most python coders prefer a library called multiprocess that fakes multithreading by spawning new python processses entirely) - so load-balancing, load-sharing and redundancy under heavy use are problems python is particularly bad at (not the language so much as the architecture of the implementation to be fair).

    So it's likely a great deal of the code is dedicated to solutions to those difficult problems. It also rather depends on how you count it. Other things that could contribute large amounts of code:
    - They likely use a custom application server (in order to implement all that redundancy and load-sharing)
    - There's likely a significant amount of debug logs in there, and extensive logging throughout (you need that if you're going to keep something like this maintained and find/fix problems quickly).

    Finally - the comparison is not actually very fair. The Kernel is written in C - a language designed for brevity, while python is much more verbose. Python is not a language that encourages lots of one-liners, except where they can be used to avoid deep nesting (which is actively discouraged) or in purely functional calls (which are available but only encouraged for specific use-case determined algorithms where the non-functional version would actually be harder to read).

    So the exact same algorithm is likely to use more lines in python than in C - and be a lot easier to read. I was not surprised to learn from this interview that a lot of his own early work was in Pascal and Algol - you can see a lot of the Wirth philosophy in Python. Python in a very real sense struck a perfect balance between readable verbosity and cruft. Java is too far to the other side, you need about 100 lines just to show a simple "exit on click" button on the screen and almost none of them have anything to do with the task at hand. The same thing in TCL/TK will take one line, in python it's about 3 lines (depending what GUI library you use).
    I recently developed a fairly comprehensive GUI library in python. I was building an RPG in Pygame (need to pick that up again sometime) and pygame has no gui elements and none of the libraries are maintained, so I wrote my own. Python made this ridiculously easy for the most part. Hell at one point I actually wrote a recursive object (that is to say - an class in which one of the methods would instantiate another instance of the same class it's a method off). The class was a box containing a list of items you can select (used for things like the inventory) but when you need to add something to a box like that (say in the game editor - adding treaures into a chest) it instantiates another instance of itself, with different parameters to show you the list of possible things you can add.
    That took no clever trickery whatsoever, the method just instantiated the class and operated on the object, python handled all the recursion magic entirely transparently.

    That gave me (as a long time python developer) an entirely new respect for just how powerful the language really is. I also strongly suspect that in most languages that activity would have been far more complex, many languages don't even allow recursive classes after all.

    --
    Unicode killed the ASCII-art *
  47. Re: Why in the heck should a file server need 2M l by Richard_at_work · · Score: 2

    He joined Dropbox quite late on, they had a fully developed syncing platform for years before he joined.

    He might have advanced that platform on, but its difficult to claim that he "built quite a lot of Dropbox". From what I gather, his main work is around optimising their python runtimes, compilers and interpreters.

  48. Re:Python by silentcoder · · Score: 1

    Considering that it was a purely emotional expression with no attempt at rationalization it may have no rationally explainable reason at all. He could literally just be a guy who found Monty Python terribly unfunny and annoying (it's theoretically possible for such a person to exist) and thus got pissed off by all the MP references in the sample code and tutorials.

    --
    Unicode killed the ASCII-art *
  49. Re:Interpreted languages should cease by tdelaney · · Score: 1

    That would be pypy.

  50. Re:Interpreted languages should cease by Big+Hairy+Ian · · Score: 1

    Learn how to use a compiled language like Java.

    Java doesn't compile to machine code it compiles to pseudo code which is then interpreted (Not quite as slow) at runtime. If you want a proper compiler try any C, C++ etc.

    --

    Build a Man a Fire, and He'll Be Warm for a Day. Set a Man on Fire, and He'll Be Warm for the Rest of His Life.

  51. Re:Interpreted languages should cease by allcoolnameswheretak · · Score: 1

    Java also compiles critical paths to machine code. It's called HotSpot just-in-time compilation. That's the reason why Java can achieve performance comparable to C++ in some use cases.

  52. Re:Interpreted languages should cease by Anonymous Coward · · Score: 0

    Like the java virtual machine, for which you compile to BYTE CODE!!!1!

    Well, there's Iron Python, which compiles to .NET, and Jython, which compiles to Java. If you want to modify your code a little, there's Cython, which compiles to machine code. In addition, if you need CPython compatibility for libraries, PyPy can run 5-10x faster and has Py3 support now.

    The vast majority of people use CPython, which is the *reference implementation*. Those are not made to be fast, they are made to be a reference.

  53. Re:Don't take advice from the successful. Just don by Gavagai80 · · Score: 2

    The best advice is to find work you enjoy doing that others don't enjoy doing, which is also desired by clients. At any rate, I pursued an enjoyable thing and made a success of it so your sample size is up to 2 now.

    --
    This space intentionally left blank
  54. "syntax error: go to hell and hunt for it" by Pseudonymous+Powers · · Score: 5, Funny

    Interview With Python Creator Guido Van Rossum

    Well, I tried to read it, since I'm a huge fan of Python. But one of the paragraphs was indented in a slightly different way than all the others, so I couldn't.

    1. Re:"syntax error: go to hell and hunt for it" by Anonymous Coward · · Score: 0

      What does Helen Hunt know about Python syntax errors??

  55. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    As opposed to a new-school thinker: newer = more impressive?

  56. Thanks by Anonymous Coward · · Score: 0

    Thanks Guido, for the steaming pile of hot garbage that is Python. You can take your whitespace scoping and stick it.

  57. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    Go had a flag package and the Python programmers brought use 8 more before they started replacing the OS/exec package. They are half way thru replacing the net/http libraries with idiotic Python syntax and should have pythonG ready soon.

  58. Crap language by Anonymous Coward · · Score: 0

    Obviously he never had to fight old make scripts. Any language that depends on tabs/spaces/line position is a primitive pos and is basically glorified RPG.

    1. Re:Crap language by Anonymous Coward · · Score: 0

      Insightful opinion. Do you have a blog?

  59. Re: Why in the heck should a file server need 2M l by dbrueck · · Score: 3, Insightful

    The Kernel is written in C - a language designed for brevity, while python is much more verbose. ... So the exact same algorithm is likely to use more lines in python than in C

    I dunno, YMMV, but to me the opposite seems to pretty much always be the case - for any non-trivial chunk of code, the Python version tends to require far fewer lines than the C equivalent. At several different companies we've ported various C modules to Python and it's common for the Python version to have only 20% (or fewer) LOC vs the C original. The reason is just the usual stuff: Python, being a much higher level language, introduces a lot of overhead but in exchange you get powerful built-in data types and have to do basically zero manual memory management.

    This tends to show up in not just large libraries or apps, but even in small chunks of code. For example, below is a function from one of our network monitoring agents; as background, basically there are a bunch of different server clusters and a job monitor spits out an hourly file that lists on each line the IP address of each server and the number of errors it encountered (this is part of some legacy thing we're hoping to replace, it's kind of goofy). Anyway, those files get aggregated to a central monitor, that in turn looks for various conditions and alarms if e.g. the error rates are too high.

    Anyway, here's a function that reads those files and tells you which servers are seeing the most errors (it returns a list of server IP address and number of errors encountered, in descending order of number of errors):

    def ServerErrorRates(reportFiles):
        counts = {} # ip addr --> total errors
        for filename in reportFiles:
            for line in open(filename):
                ip, errors = line.strip().split()
                counts[ip] = counts.get(ip, 0) + int(errors)
        return sorted(counts.items(), key=lambda x:x[1], reverse=True)

    Nothing fancy, but doing that in straight C is likely going to take far more than 7 code statements. There's just no way to perform the same work in C in anything close to 7 statements. It's not a knock on C, the two tools are just optimized for different things.

    As another example, I just took a peek at our HTTP server library. The whole thing is a single file of less than 800 LOC, and that handles all HTTP request/response handling including header reading/writing, file uploads, cookies, websocket support, request routing, etc., etc. without using any of the HTTP stuff from the Python standard library. The C equivalent would certainly be several times as many lines of code.

    I think you could maybe argue that individual statements in Python are more verbose than C, but it's common for each Python statement to be the equivalent of several C statements (and/or many statements in C are simply not required in Python), so on the whole Python programs end up being way more concise. Occasionally I'll see an exception, but it's just that - an exception.

  60. Re: Why in the heck should a file server need 2M by Anonymous Coward · · Score: 0

    You might be one of the people targeted by the templating changes made in the new go release. I don't work with them, so the new features were lost on me, but your complaint brought the talk to mind.

  61. Re:Interpreted languages should cease by Anonymous Coward · · Score: 0

    uhm, you can compile java to machine code. It's just most of the time it doesn't make a big difference. Also it's not pseudo code, it's Bytecode. Which is the equivalent of machine code for a machine that doesn't exit.

  62. Re:Why in the heck should a file server need 2M li by JustAnotherOldGuy · · Score: 2

    Parent is being modded into oblivion, but it's a fair question: Why would a file server need 2M lines of code?

    Seriously, even with all the user stuff and housekeeping, it seems like an insane amount of code.

    --
    Just cruising through this digital world at 33 1/3 rpm...
  63. A good piece of advice from the Q&A by jrga · · Score: 1

    -- What’s one piece of advice you can give to young people interested in a career in programming? Find something you enjoy doing. You’ll spend more time doing it, so you’ll become better at it, and then you’ve got a competitive edge. Plus, having fun doing it means you’ll have more fun! Don’t do something you don’t enjoy just because it looks lucrative — that’s where the competition will be fiercest, and because you don’t enjoy it, you’ll lose out to others who are more motivated. -- Great answer. Very wise. Good job.

  64. Re: Why in the heck should a file server need 2M by silentcoder · · Score: 2

    Thats actually a good point I had not considered. But I do think at the level of something as close to the metal as file management that pythons verbose names and syntax would make it bigger than C. At application level the higher level of abstraction should win for python.

    --
    Unicode killed the ASCII-art *
  65. This is the title of my comment by Anonymous Coward · · Score: 0

    And this is my actual comment.

    Seriously, WTF dude, stop splitting your comment between the title and the body.

  66. Re: Why in the heck should a file server need 2M by dbrueck · · Score: 2

    Yeah, that's a good point. I think an even better example might be low level bit twiddling of a byte stream and conversion back and forth between a struct in memory and a packed binary file format - C rules there and in Python you end up jumping through weird hoops a lot of times. The struct module helps a lot (though to your point it's more verbose than the same task in C), but only to a point.

  67. Re:Python by U2xhc2hkb3QgU3Vja3M · · Score: 1

    You don't even like the dead parrot sketch?

  68. History of Python Lecture Given at Dropbox by whh3 · · Score: 1

    Speaking of Dropbox and Python, Guido gave an excellent talk on the History of Python at one of their techtalks. You can view it online:

    Guido van Rossum on the History of Python

    --
    remove nospam. to email!
  69. Re: Why in the heck should a file server need 2M by Anonymous Coward · · Score: 0

    Writing C code to do file management is a chore compared to Python. I like and use C but have always found Python results in less code.

  70. Re:Interpreted languages should cease by Millennium · · Score: 1

    Python compiles to bytecode, much like Java does. In fact, Python was doing it several years before Java was ever introduced.

    Yes, one can argue that JVM bytecode then sometimes gets JIT-compiled to machine code, but by that point, the Java programming language is gone. What actually gets JIT-compiled is JVM bytecode, and this could have been compiled from any language. Like, say, Python.

  71. Re: Python by Anonymous Coward · · Score: 0

    I also hate Python. I've learned that any dynamic languages cost me more frustration than any productivity gains.

  72. Python, 2to3 and retesting by fyngyrz · · Score: 3, Informative

    There's probably working, and there's actually working. When you have a complex system that a business actually depends on, running 2to3 absolutely requires that everything be re-tested. The larger the system is -- and that can mean interactions with libraries, databases, other languages, etc. -- the larger that testing job is, and it gets larger in a nonlinear fashion with the amount of code as interactions multiply.

    However, Python 2.x isn't going to go anywhere. If you have a substantial system or systems written in it, and it's doing what it supposed to be doing, there's actually no reason to move it over. If you want to, you can write new stuff in 3.x; no reason they both can't exist on the same machine(s), either. Either one can call the other. Nothing to it.

    Personally, so far at least, I have no specific need for 3.x, and so haven't bothered with it for anything serious, but I'm not against using it if some reason arises that makes it more useful than 2.x. I can't say I really object to 2.x becoming stable because development is going towards 3.x, either. Again, it reduces the need to re-test, and it keeps the unit testing mechanisms stable as well.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:Python, 2to3 and retesting by HiThere · · Score: 1

      That's a *VERY* interesting assertion. There are a couple of Python2 libraries that I'd like to call from Python3, and there's some code that would be easier to write in Python2 than in Python3...so how do you do it? Even better, got any good links?

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    2. Re:Python, 2to3 and retesting by fyngyrz · · Score: 1

      A python script can control what executes it with the shebang line at the top:


      #!/usr/bin/python2

      So it follows that a script can also have:


      #!/usr/bin/python3

      at the top.

      so:


      #!/usr/bin/python2
      import subprocess
      import json
              subprocess.Popen(["pythonScript", "/path"], stdout=subprocess.PIPE, shell=True)(result, err) = proc.communicate()

      The called Python script can return a json result, which you can in one step parse out into a local python object such as a dictionary, etc.

      You can use this to call python3 from python2, the other way around, or, slightly differently written because Javascript, as a way to call python from Javascript. And I suspect in a lot of other environments as well.

      I do it all the time in Javascript because Python has Sqlite support and javascript does not; so I just build the query in Javascript, shoot it to python to get it handled, and take the results back across into Javascript as json.

      I wrote that all off the top of my head, so you might find a few errors in it, but that's the general idea.

      --
      I've fallen off your lawn, and I can't get up.
    3. Re:Python, 2to3 and retesting by djinn6 · · Score: 1

      Can a 2.x method directly call a 3.x method or are you talking about IPC?

    4. Re:Python, 2to3 and retesting by HiThere · · Score: 1

      Well, I looked at your answer, and ...
      Yeah, that would work, but UGH!! That's horribly ugly. And slow. I don't want to be needing to even convert numbers to strings and back, much less all that other garbage. That is literally a WORSE approach than re-writing in C++. Or even Vala. (OK, Vala may not work. The documentation is so terrible that I can't tell the syntax for many language features. And it *still* might be a better option.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    5. Re:Python, 2to3 and retesting by fyngyrz · · Score: 1

      I don't want to be needing to even convert numbers to strings and back

      If that's a comment about cpu cycle efficiency, yes, there's something to consider there. Definitely a hit during transfer. However, Python is so much faster than javascript, likely it doesn't actually have a serious impact.

      If it's about coding work for you, no. That's all taken care of by json. Two lines in the Python script (one for incoming data, one for outgoing), and two lines in the Javascript, same thing. Also, not ugly, codewise. Very simple; very clean. If you're thinking it makes for ugly code, you didn't understand what I was describing. Probably my fault.

      Anyway, I was asked, I answered. There ya go. :)

      --
      I've fallen off your lawn, and I can't get up.
    6. Re:Python, 2to3 and retesting by fyngyrz · · Score: 1

      Answered above

      --
      I've fallen off your lawn, and I can't get up.
    7. Re:Python, 2to3 and retesting by Anonymous Coward · · Score: 0

      > However, Python is so much faster than javascript, likely it doesn't actually have a serious impact.

      Huh? node.js is way faster than stock Python (but not PyPy).

  73. Whitespace by fyngyrz · · Score: 1

    why didn't you listen to 'us' and fix the spaces thing?

    ...because it isn't broken. It's your coding style that's broken. Consistent use of structured whitespace is a huge benefit to authoring, and to understanding other people's code. As opposed to any random sequence of characters some individual decide suits them personally.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re: Whitespace by Anonymous Coward · · Score: 0

      Get the fuck outta here. How is a space easier to read than { brackets }? Which is what PHP and many other languages use. The { } combo lets me know exactly where a function or statement starts and ends. And with indentation added to that it is even more clear to read. Add in some comments and you are golden.

      I just don't see how people think the indentations in Python are easier than { }. They are both doing the same thing. Only difference is with the { } I can tell where everything started and stopped with a glance. In Python I have to mentally count the spaces and make sure they line up. It's an extra step. Not to mention errors because things aren't indented correctly. I get it and understand why they do it this way, I just don't agree with their reasoning though.

    2. Re: Whitespace by fyngyrz · · Score: 2

      How is a space easier to read than { brackets }?

      It's not about "a space", it's about levels of indentation.

      The answer is basically that braces can match at different places on different lines and be perfectly valid; and many people write code just that way.


      if condition
              doThis
              if otherCondition
                      doThisToo
              else
                      humAFewBars
                      scratchItch
      else
              doThat

      is clearer than:


      if condition { doThis ifOtherCondition { doThisToo }
      else { humAFewBars scratchItch }} else { doThat }

      Structured whitespace delineates code blocks in a much more visually obvious manner. This, in turn, makes understanding what you're looking at much easier. Such understanding aids in writing, maintaining, and altering code. Even more so when it is otherPeoplesCode.

      --
      I've fallen off your lawn, and I can't get up.
  74. Abstraction not always == progress by fyngyrz · · Score: 1

    In computer science, abstraction is progress.

    In computer science, abstraction means your code runs slower.

    As long as that's okay, then yes, you're right. Otherwise, you're completely wrong.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:Abstraction not always == progress by Anonymous Coward · · Score: 0

      What a weak counter argument. Really, code runs slower? OMG, stop the press. Here's another cliche: Machines run faster.

      Btw, if the speed is not ok, why aren't you writing in assembler?

    2. Re:Abstraction not always == progress by fyngyrz · · Score: 1

      Here's another cliche: Machines run faster.

      Here's one problem: we -- individuals -- have limited time. The more efficiently it is used, which is to say, the less time we spend waiting on things to complete, the better off we are. Here's another problem: Some tasks are not fast enough. Here's another problem: computers are no longer getting faster at the same rate.

      There are many classes of tasks that take significant amounts of time to complete. These are the ones that are a good case for higher speed languages. There are also many classes of tasks that execute in an environment that also executes other important tasks, and the more time available for the other tasks there is, the more gets done there. So 100ms as opposed to 1ms does matter to such a machine at large, though it would not matter on a machine dedicated to you alone where that is all you are doing.

      Btw, if the speed is not ok, why aren't you writing in assembler?

      Generally speaking, because the machines out there are not uniform in terms of CPUs. Otherwise, I'm quite good at writing in assembler, and if the target is a dedicated system where the hardware is known and the roadmap ensures that this will not change for some reason, I'm perfectly willing to do it. Particularly if not using assembler means taxing (or exceeding) the resources of the machine or the patience of the user.

      But if the entire program has to be rewritten because the hardware is different -- that's sufficient reason not to write in assembler. However, c is an exxcellent fit in such cases; it's very low level and it provides the ability to obviate the hardware differences as to functionality.

      --
      I've fallen off your lawn, and I can't get up.
    3. Re:Abstraction not always == progress by tepples · · Score: 1

      Btw, if the speed is not ok, why aren't you writing in assembler?

      I am. And I use Python to calculate lookup tables and convert data formats for projects written in 6502 assembly.

    4. Re:Abstraction not always == progress by silentcoder · · Score: 1

      >Here's one problem: we -- individuals -- have limited time. The more efficiently it is used, which is to say, the less time we spend waiting on things to complete, the better off we are. Here's another problem: Some tasks are not fast enough. Here's another problem: computers are no longer getting faster at the same rate.

      Interesting story on this: I attended a talk by the lead programmer for the Square Kilometer Array. Those guys have tons and tons of code to do numerical analysis on signals and keep all those dishes in sync and all that stuff - heavy lifting code where the n is massive and the O's are not pretty and runtimes are very, very long.

      Here's an interesting tidbit: it's all done in python. During the talk he proved that the time saved on development by using python exceeds the time that would have been saved on running experiments by writing them in C.

      Now that is a bit of a special case - the SKA environment means that code is constantly being refactored and modified and rewritten to handle new experiments or search for some new pattern, so there is no long term use in the software and no external customers running it, but at least in that environment python is far more efficient than C (which was the norm for radio-telescopy before SKA) simply because you can implement the code so much faster. The C code may have finished a few seconds earlier, but it would have taken hours more to get it written, tested and compiled.

      --
      Unicode killed the ASCII-art *
    5. Re:Abstraction not always == progress by silentcoder · · Score: 1

      The difference should never be that big. I suspect you had a major piece of badly optimized code somewhere.

      --
      Unicode killed the ASCII-art *
    6. Re: Abstraction not always == progress by silentcoder · · Score: 1

      Data type selection is critical in python. Lists are immutable for example so should used with care. Every change has to copy the entire list. This is one reason pythonistas love dicts. Dict lookups are atomic operations: bleedingly fast.

      --
      Unicode killed the ASCII-art *
  75. The real reason py2 refuses to die. by TapeCutter · · Score: 1

    If you're still running Python 2 code, you should into the mirror see where the problem lies. Python 3 is working just fine these days.

    The "fuck up" the GP is referring too is that py3 broke backward compatibility, when it costs real money to manually port your code to a new version - it's a broken upgrade. For example - I have created an automated build system at work with py2, since py2 still works just fine why would I even try to justify spending time and money porting it to py3?

    --
    And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
  76. Re:Interpreted languages should cease by dgatwood · · Score: 2

    You're thinking of Emacs. C-x M-c M-facebook.

    --

    Check out my sci-fi/humor trilogy at PatriotsBooks.

  77. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    The fun part is you can do that in even fewer lines of Python if you wanted to ...

  78. Re: Why in the heck should a file server need 2M l by MikeBabcock · · Score: 1

    So you've never seen Python code I take it, because there's no similarity between the languages. Effectively none.

    One needs braces and semicolons, the other uses space, one allows in-line regex, the other doesn't, the one can have RSA implemented like this:

    #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
    $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
    lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)

    The other looks like this:
    #!/usr/bin/python
    from sys import*
    from string import*
    a=argv;[s,p,q]=filter(lambda x:x[:1]!='-',a);d='-d'in a;e,n=atol(p,16),atol(q,16);l=(len(q)+1)/2;o,inb=l-d,l-1+d
    while s:s=stdin.read(inb);s and map(stdout.write,map(lambda i,b=pow(reduce(
    lambda x,y:(x>8*i&255),range(o-1,-1,-1)))

    Even super-short highly optimized Python with semicolons for whitespace removal looks nothing like perl.

    All due credit to http://www.cypherspace.org/rsa... for sources.

    --
    - Michael T. Babcock (Yes, I blog)
  79. Re: Why in the heck should a file server need 2M l by HiThere · · Score: 1

    I pretty much agree, but the other guy's point about threading is spot on. Python doesn't have concurrent execution of threads, but only of processes. This can lead to some fierce work-arounds and hard problems. Multi-processing requires multiple python interpreters to be loaded (one/process). Etc. So does any other approach to concurrent execution. (ZMQ comes to mind, but I generally don't use that to start another python process, except while in the process of rewriting something into a different language so that I *don't* need to start up another python process.)

    Still, that's a huge number of lines of code, and I don't see the reason. But, of course, I haven't studied the problem.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  80. Re:Why in the heck should a file server need 2M li by mattventura · · Score: 1

    It doesn't say what the 2M figure actually covers. If that includes the dropbox client programs, all platforms, then that doesn't seem as bad considering the large amount of boilerplate that usually ends up in graphical applications.

  81. Re: Why in the heck should a file server need 2M l by dbrueck · · Score: 1

    Yeah, no disagreement there - I was addressing just the LOC aspect.

    FWIW Python's threading model does have concurrent execution of threads, but only for a part of the time - it does support true OS-level threads, but a single, process-wide interpreter lock gets held when running Python bytecode or in a Python API function, so /some/ applications see benefits to using multiple threads (typically cases when you can either do lots of work in a C API or when you are waiting on I/O and just want concurrency but aren't necessarily CPU bound), but often that is not the case and/or the app has trouble using all available CPU. On the upside, it's really great in that you can't corrupt Python's internal state and crash with threads, but that's a pretty minor upside. :)

    The multiprocessing library is pretty nifty - at my current job we run a Python request handler process on each CPU core and use pipes to talk to a "controller" process (ends up being message inter-thread communication, so a lot like if you use ZMQ), but it's still a far cry from normal threads. And if you just need concurrency and aren't CPU bound, then gevent is pretty spectacular.

    But despite all of this, I think Python's threading model is still one of the big design decisions that can make it a difficult choice in some environments - for our current system, we settled on Python despite this and decided that the cost of dealing with it is offset by the other benefits of Python, but it'd sure be notice to avoid that.

    Long term, I'm keeping an eye on pypy+STM (http://doc.pypy.org/en/latest/stm.html) - it's nowhere near ready and may not ever be, but it's cool in that it's taking a radically different approach to the problem.

  82. Re:Why in the heck should a file server need 2M li by JustAnotherOldGuy · · Score: 1

    "...the dropbox client programs, all platforms..."

    Even so, perhaps I'm out of touch, but 2 million lines of code??

    The Space Shuttle reportedly uses about 400K lines, and Quake 3 was about 350K lines or so....maybe this is the new 'normal', but 2 million lines of code for something like Dropbox just seems....excessive to me.

    Oh well, I'm off to write my 20,000 line "Hello World!" program and sell it to the TSA for a million bucks. I'll be back after lunch!

    --
    Just cruising through this digital world at 33 1/3 rpm...
  83. Re: Why in the heck should a file server need 2M l by Anonymous Coward · · Score: 0

    of course, the funny part here is that to the non-programmer, both of those snippets are identical.

  84. Re: Why in the heck should a file server need 2M l by occasional_dabbler · · Score: 1

    True, Python multithreading is only useful to avoid locked windows or the like, it has no speed benefit. Multiprocess works much better but although it is usually more beneficial on Linux than windows; the overhead of the spawn is so egregious in Windows that you need to have processes lasting several seconds to make it worthwhile, not to mention the horrors of getting a multiprocess logging system to work. The real beauty of python is to allow complex structures to be treated by high level commands yet to perform the heavy lifting in C or Fortran using either python's multiprocessing or openmp via f2py.

    --
    "Our opponent is an alien starship packed with atomic bombs," I said. "we have a protractor"
  85. Lack of PEP 397 held Python 3 back by tepples · · Score: 2

    #!/usr/bin/python3

    Shebang lines like that didn't work on Windows from 3.0 through 3.2. Windows determines which executable to run by examining the portion of the filename after the final period character. Only in version 3.3 did Python gain py.exe, a shebang line processor for Windows implementing PEP 397.

    Python has Sqlite support and javascript does not

    You were saying? node-sqlite3

    1. Re:Lack of PEP 397 held Python 3 back by fyngyrz · · Score: 1

      Thanks for your reply.

      Shebang lines like that didn't work on Windows from 3.0 through 3.2.

      I avoid Windows. This provides another reason why. Sometimes I forget Windows is even out there. Those are good times. :)

      node-sqlite3

      Not really what I meant. Sure, you can add OPC to Javascript. Python's Sqlite support is standard. I prefer to use that if at all possible. Also prefer Python to javascript, but inasmuch as I have to use Javascript in web pages to get that level of interactive capability, this is the way I choose to go about it -- write the parts that have to be Javascript in js, and the rest in Python. Passing stuff back and forth in JSON is just about painless.

      In any case, the technique is generally applicable to anything as long as you aren't dealing with Windows. In the case of a web server, I think *nix is a better choice anyway. For quite a few reasons.

      --
      I've fallen off your lawn, and I can't get up.
  86. Channels that strip spaces from lines by tepples · · Score: 1

    However, it's difficult to paste Python code through channels that apply the equivalent of lstrip() to each line. Slashdot's comment section is one of them: if you have your account's post mode set to "HTML Formatted", even <ecode> won't keep it from stripping spaces. (When I figured this out, I set my account's post mode to "Plain Old Text", which allows HTML tags but translates newlines to <br> elements and suppresses stripping in <ecode> elements.) At least in curly-bracket languages, you can pass the code through GNU Indent or a similar tool to restore indentation.

    1. Re:Channels that strip spaces from lines by fyngyrz · · Score: 1

      Do you really want to set your programming limits by what slashcode does? Based on performance -- or lack thereof, I should say -- running screaming the other way seems like the correct choice to me. Venues that actually consider code to be a likely part of posts (github, basically anywhere that uses markdown properly, wordpress, etc.) handle pasted whitespace consistently and in a way that can be dealt with easily enough, even if a filter or two is needed (like converting tabs to spaces, and adding four spaces up front for markdown). Slashdot's formatting tools are, to be kind, minimal. And somewhat borken at that.

      I presume my account is set the more compatible way; I just used <code></code> to write the GP. Worked well enough. Not too fond of the 8-char indent it created on this end (I prefer 4) but still, it shows exactly why { and } tell the compiler or interpreter things that they can efficiently hide from the programmer.

      I'm a c programmer; I have written a very large number of lines of c. And c++. I still write large applications from scratch in c++. Like this one. But I indent very carefully, and not in the K&R style either, which I also consider borken specifically because it also obfuscates visual cues. I even published some dead-tree magazine articles on specific problems with K&R style authoing in dedicated programming rags, back in the day. Way back. :)

      --
      I've fallen off your lawn, and I can't get up.
  87. Delimit scope with invisible characters by Anonymous Coward · · Score: 0

    What were you smoking? Really. Why? So bad.,

  88. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  89. Re:Interpreted languages should cease by HiThere · · Score: 1

    Yeah, but last I checked pypy only handled python2, not python3. (They were either working on it, or planning to work on it, I don't remember which.)

    Unfortunately, what I need isn't exactly speed, but binary mapping of structs (no pointers allowed) to disk blocks. So python is out. The GIL would make using it a headache anyway. (Again, not speed exactly, but simultaneous execution of different threads. Processes could be made to do in a pinch, so I could use multi-processing, but it would be a headache. ZMQ & C++ looks easier, even with the headaches that causes when handling unicode.)

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  90. Can a JS+Python app run offline? by tepples · · Score: 1

    I avoid Windows. This provides another reason why. Sometimes I forget Windows is even out there. Those are good times. :)

    Not every desktop user has the money to buy a Mac and KVM switch to run your app. Nor does every desktop user have the money to buy extra RAM to run your app inside a Xubuntu virtual machine. Or perhaps you avoid developing desktop apps or offline-capable web apps.

    inasmuch as I have to use Javascript in web pages to get that level of interactive capability, this is the way I choose to go about it -- write the parts that have to be Javascript in js, and the rest in Python.

    But then how do you make JavaScript in the browser communicate with the Python program on the client? Or do you run Python solely on a server on the other side of the Internet from the client, which adds noticeable latency in many cases and destroys any possibility of offline use?

    1. Re:Can a JS+Python app run offline? by fyngyrz · · Score: 1

      I run the Python app on the server side; the only reason javascript runs on the client side from my POV is because there's no other way it will run, and there is no alternative technology that will not require reloads and subsequent browser destruction and re-construction of the page, which is extremely disruptive to the visitor as compared to the minimal amount of rendering changes possible.

      The way I see it, presuming you can use the visitor's computing resources beyond what you actually require to operate is abusive behavior. So the less of that there is, the better the web page is.

      As for latency, that's really not a serious concern. My web pages are so much faster than most other people's because they don't go out to other web sites and make new connections that you'd be hard-pressed to show than anything written this way is even taking 1/10th of the time to run as the average web page these days. They're also much lighter -- I can get my content to you in a fraction of the time, quite aside from latency. Just a few packets, and you have my web pages. No video, only carefully optimized images.

      As for running offline, no. These are web pages. Not applications. I don't write applications on web pages. It can be done, obviously, but I would not do so. The browser is too heavyweight an environmental wrapper. Not to mention that some of them (looking at you, Firefox) are such profligate memory losers and wasters quite aside from anything actually required for functionality that they should be entirely killed regularly in order to get system memory back. So I stick with c++ for applications. Applications of mine (like this one weigh in at less than some web pages, never mind the browser's requirements.

      I'm very comfortable with this. YMMV, obviously.

      --
      I've fallen off your lawn, and I can't get up.
  91. Re:Python by HiThere · · Score: 1

    Apparently, but you don't seem to have any reason for your opinion. I'm torn between whether you're a particularly stupid chatbot, or an inept troll.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  92. Re:Don't take advice from the successful. Just don by HiThere · · Score: 2

    I think every successful programmer is probably an example of applying this advice. I've never met a successful programmer that hated programming, and most people hate programming. But the field has gotten more crowded, so perhaps many people are now doing it purely for the money.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  93. Re: Why in the heck should a file server need 2M by silentcoder · · Score: 1

    Python's file management is actually seriously primitive, in fact it's almost identical to C - but with longer commands.
    One of the big debates ongoing in the python development community right now is about that issue in fact. Notable parts include making pathlib support more integrated (pathlib - by not treating paths as strings is much better able ot deal with the nuances of OS requirements - but also unusable by most file management tools, even the ones in the standard library, without a cast), and about whether or not to create a string.write_to_file style mechanism as is found in many other more specialized languages.

    Looks like the consensus was to not do the latter but to provide some equally simple approaches to file access, storage and safe pickling of data - but these are not yet in python.

    It's kind of odd that you would make this claim in an area where, right now, the python mailing lists are busy debating how to improve the fact that python's file management is essentially identical to that of C.

    --
    Unicode killed the ASCII-art *
  94. Re: Why in the heck should a file server need 2M l by silentcoder · · Score: 1

    >The multiprocessing library is pretty nifty

    Oh yes, I absolutely LOVE multiprocess.Pool.map ! It is, by far, the easiest parallel execution setup I've ever done.

    Python itself seems to be seriously embracing concurrent processing, which is very powerful and very useful for a lot of jobs - though not the ones where parallelism really shines (or anything that's embarrassingly parallel) , the async/await model is a really clean and pythonic way to do powerful concurrent generators - it's still very new, but I think it will replace multithreading almost entirely. For everything MT does well, await/async can do it better and with less code, for the rest MP will generally work better.

    --
    Unicode killed the ASCII-art *
  95. Re: Why in the heck should a file server need 2M l by JustBoo · · Score: 1

    He joined Dropbox quite late on, they had a fully developed syncing platform for years before he joined.

    He might have advanced that platform on, but its difficult to claim that he "built quite a lot of Dropbox". From what I gather, his main work is around optimising their python runtimes, compilers and interpreters.

    So he's re-writing those in c++ then?

  96. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  97. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  98. Re: Why in the heck should a file server need 2M by Anonymous Coward · · Score: 0

    Not knowing much but openbsd has been burdened with the "one lock that rules them all" and it is painful to watch them getting rid of it. I expect Gido gets quite a bit of choice in where he works and solving that problem would be a job draw. Then Dropbox is supposed to be secure. That is generally an interesting problem. As best I know, python exploits are rare, whatever that means in a language, but I expect that is also true for the libraries.

  99. Re:Why in the heck should a file server need 2M li by Half-pint+HAL · · Score: 1

    Well I don't know about you, but I've never written a complete distributed fileserver that runs across thousands of VM instances and serves costumised webviews and APIs to thousands of clients worldwide. I've never written code that manages deduplication, which is quite a bugger to do because one slip and you could accidentally have people deleting each other's files. So I don't really know how many lines it would need in reality.

    --
    Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  100. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  101. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  102. Re:Interpreted languages should cease by tdelaney · · Score: 1

    The first release of pypy (well, technically pypy3) that supported Python 3 was over a year ago (February 2015). However it is still Python 3.2.5 (they're working on 3.3+ support).

    Regarding the rest of your post, a common approach is to write the low-level access code in C and everything on top in Python. The C code can release the GIL (only need to reacquire it if calling back into the Python subsystem).

    Have a look at cffi.