Slashdot Mirror


Is Python the Future of Programming? (economist.com)

The Economist argues that Guido Van Rossum resembled the reluctant Messiah in Monty Python's Life of Brian. An anonymous reader quotes their report: "I certainly didn't set out to create a language that was intended for mass consumption," he explains. But in the past 12 months Google users in America have searched for Python more often than for Kim Kardashian, a reality-TV star. The rate of queries has trebled since 2010, while inquiries after other programming languages have been flat or declining. The language's popularity has grown not merely among professional developers -- nearly 40% of whom use it, with a further 25% wishing to do so, according to Stack Overflow, a programming forum -- but also with ordinary folk. Codecademy, a website that has taught 45 million novices how to use various languages, says that by far the biggest increase in demand is from those wishing to learn Python. It is thus bringing coding to the fingertips of those once baffled by the subject. Pythonistas, as aficionados are known, have helped by adding more than 145,000 packages to the Cheese Shop, covering everything from astronomy to game development....

Python was already the most popular introductory language at American universities in 2014, but the teaching of it is generally limited to those studying science, technology, engineering and mathematics. A more radical proposal is to catch 'em young by offering computer science to all, and in primary schools. Hadi Partovi, the boss of Code.org, a charity, notes that 40% of American schools now offer such lessons, up from 10% in 2013. Around two-thirds of 10- to 12-year-olds have an account on Code.org's website. Perhaps unnerved by a future filled with automated jobs, 90% of American parents want their children to study computer science.

"The CIA has employed Python for hacking, Pixar for producing films, Google for crawling web pages and Spotify for recommending songs," notes the Economist.

Though Van Rossum was Python's Benevolent Dictator For Life, "I'm uncomfortable with that fame," he tells the magazine. "Sometimes I feel like everything I say or do is seen as a very powerful force."

41 of 300 comments (clear)

  1. It's great.... by Rei · · Score: 4, Insightful

    ... until you discover that your program is butting up against performance or memory limitations, since Python gobbles both, and then you have to go back and redesign the whole bloody thing.

    --
    "Lock and load, Brides of Christ!"
    1. Re:It's great.... by 0100010001010011 · · Score: 5, Insightful

      Rule of Optimization

      Developers should prototype software before polishing it. This rule aims to prevent developers from spending too much time for marginal gains.

      Not everything needs to be the best, most optimized way to do something.

      We're constantly automating away boring tasks at work with Python and they're all 'good enough' to finish and move on to the next problem. We *could* do them in C but it'd be marginally faster with longer development time.

    2. Re:It's great.... by Anonymous Coward · · Score: 2, Insightful

      > That was my criticism of Java 30 years ago... and yet...

      Wow. You have some amazing psychic powers if you were criticizing Java in 1988!

    3. Re:It's great.... by isj · · Score: 2

      And if you start out with, say, C++ then you may discover your developers is not developing fast enough.

      Both interpreted and compiled languages have their place.

      I frequently make prototypes/experiments in python, and then when it comes to making the actual program I may switch to C++ or Java if the performance wouldn't be good enough in Python, or if I need special libraries for dealing with something, or there are some unusual constraints.

    4. Re:It's great.... by Rei · · Score: 3, Insightful

      This has happened multiple times. Last one was species analysis, combining species lists, GBIF distribution data, geonames data, and IPCC climate data.

      The reality is that A) some tasks will always require significant performance or memory, and B) not all tasks' footprints are readily discernable when you begin the task.

      Python is a real monster with memory in particular. The amount of overhead on every variable and every member of a list or dict is absurd. There are packages like numpy to help with this, but they're not universally applicable and more limited in capabilities than stl structures in C++.

      --
      "Lock and load, Brides of Christ!"
    5. Re:It's great.... by jma05 · · Score: 4, Insightful

      ...which is when you are supposed to profile to identify your performance bottle necks and write those in a native extension. Python was meant to be used with occasional supplementation by a fast programming language, not replace those. That is how most use it. Python even chose to sacrifice true multi-threading to simplify writing native extensions. If you have a lot of number crunching, you use a GPU math library from Python, not code straight in it.

      That aside, the main reason I use Python today is the ecosystem. I started using Python almost 2 decades ago, when it wasn't that popular - back then, I had to explain that it was just a nicer Perl, to people who had never heard of Python. Back then, the high performance languages just weren't very productive to use. Today though, things have changed. There are several programming languages that are almost as performant as C/C++, and yet are very easy to use with several high-productivity features. My favorite is Nim. Rust and Scala are also quite nice. But it is the libraries, not the language that still keeps me in Python. They cover just about everything. Most of the time, performance is the least of my concerns. Time to produce is (research analytics - quick disposable programs).

    6. Re:It's great.... by Rei · · Score: 4, Informative

      >>> a=0
      >>> sys.getsizeof(a)
      24
      >>> a=""
      >>> sys.getsizeof(a)
      49
      >>> a=[]
      >>> sys.getsizeof(a)
      64
      >>> a=[0]
      >>> sys.getsizeof(a)
      72
      >>> a={}
      >>> sys.getsizeof(a)
      288

      --
      "Lock and load, Brides of Christ!"
    7. Re:It's great.... by DontBeAMoran · · Score: 4, Funny

      To be honest, it's not that great of a coffee.

      --
      #DeleteFacebook
    8. Re:It's great.... by DontBeAMoran · · Score: 5, Funny

      Go checkout your mirror, the problem will stare you in the eye.

      Everyone! This guy is trying to shame vampire python programmers! /typicalSJWmoron

      --
      #DeleteFacebook
    9. Re:It's great.... by jma05 · · Score: 2

      > The amount of overhead on every variable and every member of a list or dict is absurd. There are packages like numpy to help with this, but they're not universally applicable and more limited in capabilities than stl structures in C++.

      Then you Cython the heavily used data structures. But more likely, Python is perhaps not optimal for your use cases. In the end, it is still a glue language. But most of the programs typically written in Python never hit these performance road blocks.

    10. Re: It's great.... by SuperDre · · Score: 3, Insightful

      Yes, and that's a big problem. We get better/faster hardware every year, and yet every new version of new software feels slower and slower due to using these very unoptimized languages. 'developers' are getting more lazy by the minute and don't spend any time on optimizing anymore.

    11. Re:It's great.... by Rei · · Score: 2

      Maybe I'm more prone to have my programming projects involve data crunching than the average person.

      Python is great for a "whip it together quickly" project. Even with data crunching, some slowdown, and gobbling up half your memory, is fine. But push it too far, and everything falls apart gloriously. And knowing in advance whether you'll hit that bound is not always obvious. If I know from the beginning something will be a big project, I start it in C++.

      --
      "Lock and load, Brides of Christ!"
    12. Re:It's great.... by DCFusor · · Score: 4, Insightful
      Burn mod points or point out that this is a fad, there are other glue languages that work fine, and even make it far easier to optimize just the part you want into some inline::C or inline:your_language_of_choice.
      .

      Due to some half decent grunt work done in python for the things it's fine for - say device drivers for slow stuff on a raspberry pi - and the difficulty refactoring one loosely typed language into another with slightly different rules, particularly where bit-fiddling is involved, I've recently written several programs using all of perl, python, and C. No sweat with "use Inline"....
      .

      The only issues I've had is poor python drivers where instead of checking a ready bit, the easy fractional sleep was used, making it utterly non portable even on the same machine (since perl's inline compiles python - while the sleeps are the same speed, the rest is now faster than native and oops, not ready....). Your basic "earnest beginner" mistake, tuning the sleep to go as fast as it would in testing, rather than actually doing the work to do it properly. Some languages attract beginners, and those are also the ones with the most google or stack overflow or whatever - searrches. The popularity, or how good a language is, might be better measured some other way. You could make the case that the more questions, the goofier the language, after all.
      .

      Yeah, I know, ,it's popular to diss perl for many of the same reasons - people too easily impressed with their own cleverness looking for job security by writing impossible to read code is blamed on the language, which would actually apply well to almost any of them. But you don't have to write bad or hard to read code. I've had people ask me what C(++) syntatic sugar templates I'm using to make my code so clear. I'm writing for myself and the poor maintainer who'll have to look after it later is me. I like me...so I make it easy. Freedom is always a doubled edged deal.

      --
      Why guess when you can know? Measure!
    13. Re: It's great.... by mSparks43 · · Score: 2

      hmm, not sure i agree with that. python can do many powerful and complex things you never could with a shell script. some heavy lifting AI and other data analytics spring to mind.

      The problem is more one of suitablity to team development and long term maintenance.

    14. Re: It's great.... by LostMyBeaver · · Score: 2

      I honestly avoid Python as much as possible as I do with C even though I just pumped out a few thousand lines of a Linux kernel module in it.

      I think the real issue with Python is not whether it is suited for large projects or not, but instead is that the package repository is completely blasted with piss poor quality modules.

      Most of the Python modules I have attempted to use (thanks to Google and SE telling me I should), I find I spend a great deal of time fixing or rewriting modules and then feeling as if I have to take ownership of them as theyâ€(TM)re mostly abandoned.

      Python as a language is extremely versatile. It can do almost anything and generally can also do it well. I do develop a lot of computers and language tools including JITs, but I wouldnâ€(TM)t even know where to begin to write a JIT compiler for Python as there are far too many circumstances to consider. The language is simply far too rich and flexible to be able to write meaningful optimizers and code generators.

      The architecture to Python also sells memory consumption as a good thing. The nice part is that itâ€(TM)s a pointer-free language. This means that a defragmenter can be part of the garbage collector. The bad news is, Python probably more actively allocates memory than any other language Iâ€(TM)ve bothered with.

      I believe I could, with a great deal of effort write good, clean, and performant code in Python. Itâ€(TM)s probably better however to focus on programming languages which are too difficult for most scripters.

    15. Re:It's great.... by Waffle+Iron · · Score: 2

      Except for the integer, those sizes are comparable to most any language. Strings and arrays all involve at least one pointer and usually a capacity and size. On a 64-bit system, that can be 24 bytes right there. Hash tables are often allocated with some empty slots, so they are usually bigger still in any language. Python might be a little bigger in most cases to handle the overhead of dynamic typing, but it looks like it's within a factor of two.

      At any rate, if you're doing any serious number crunching in Python, it's probably best to figure out how to store the floats in numpy or "array" module structures, or even write a native library engine for your core crunching algorithms (it's not that hard). Alternatively, like you want, just use a different language without dynamic typing. But the tradeoff is usually less safety (C/C++), lack of a huge collection of comprehensive libraries (most other languages), or just being even slower and more bloated on most real-world tasks than Python for no good reason (Java).

      The other error that you made is that if you get first post on a Python article, you really are supposed to just say: "Derp! Whitespace! Derp!!"

    16. Re:It's great.... by Viol8 · · Score: 2

      "Except for the integer, those sizes are comparable to most any language"

      Really?

      int main()
      {
                      char a[1];
                      printf("%d\n",sizeof(a));
                      return 0;
      }

      $ ./a.out
      1

    17. Re: It's great.... by ath1901 · · Score: 2

      This. The popularity of CPython is not just because of the language features in my opinion. It is also the easy connection to C. I would even go further and claim the C connection is the most important feature. By writing "the application" in CPython and then rewriting the performance critical parts in C, you can get the best of both worlds.

      Excellent libraries like numpy are written in both C and Python. Not either or.

    18. Re:It's great.... by Waffle+Iron · · Score: 3, Insightful

      That's apples and oranges.

      The Python integer can hold an unbounded sized value (eventually using even more storage if the value goes over 2^63).

      You allocated an array with a single character on the CPU stack (always reported as size "1", but you don't really know how big it is in octets; C doesn't specify). The tradeoff is that you now have several potential bugs/vulnerabilities:

      * You can overflow the number if it gets larger than 127 (or maybe it's 255, or even some other limit; who knows? C doesn't specify)
      * You need to manage the array size implicitly in your code and make sure you never index past zero.
      * The lifetime of your object abruptly and silently ends after you return. You must manually make sure to never store a reference to your array anywhere that could outlast your function.
      * You must mentally remember that a is not a null-terminated string, even though most C library functions dealing with characters only use that format.
      * If you use any recursion in your program, the stack allocation might fail, possibly without warning, resulting in serious security vulnerabilities. You'd need to manually avoid that possibility.

    19. Re: It's great.... by mSparks43 · · Score: 2

      I take that back, the worst error message is and always will be "keyboard error, press F1 to continue"

    20. Re: It's great.... by optikos · · Score: 2

      the worst error message is and always will be "keyboard error, press F1 to continue"

      There is nothing wrong whatsoever with stating that the keyboard-detection failed, please plug in a keyboard, and then press F1 as a positive-verification test. I bet that I have done exactly that rectification at least 500 times since 1981 (although which keyboard connector I use has changed about once each decade).

    21. Re: It's great.... by Anne+Thwacks · · Score: 2
      Unlike "Syntax error at or near line 1, column 1" - which tells you everything you need to know!

      Personally, I prefer:
      User error: Strike user to continue!

      --
      Sent from my ASR33 using ASCII
    22. Re:It's great.... by Shirley+Marquez · · Score: 2

      I wish I hadn't already commented on this subject so I could mod this comment up.

      Michael Abrash is somebody who LITERALLY wrote the book on writing high performance code. More than one, actually. I also remember his posts on the subject on the late lamented BIX. He is the antithesis of an incompetent programmer.

  2. No by Anonymous Coward · · Score: 2, Insightful

    Next stupid question.

  3. Popular != Good by DogDude · · Score: 5, Insightful

    If popularity was a determinant of goodness, McDonald's is the best restaurant in the US, and Wal-Mart is the best retailer in the US.

    Python is popular because it's relatively easy to use, not necessarily because it's "The Future of Programming".

    --
    I don't respond to AC's.
  4. A reality TV star by Patrick+May · · Score: 4, Funny

    I love that the Economist feels it necessary to explain who Kim Kardashian is to their readers.

    1. Re:A reality TV star by Chris+Mattern · · Score: 4, Funny

      She's one of those aliens from Star Trek, right?

    2. Re:A reality TV star by TeknoHog · · Score: 3

      I still struggle to understand why KK is somebody worthy of media attention, unlike people who actually make useful tools and products. From what I've seen, she is just making a huge ass of herself.

      --
      Escher was the first MC and Giger invented the HR department.
  5. Briefly? No. by AlanObject · · Score: 5, Insightful

    It seems we will never get tired of "language X is the future of all computer science because Y it" tropes.

    In the past, X can be replaced with Ada, C, C++, Java, Javascript, Python, Erlang, or whatever. The list is endless.

    The term Y can be replace with "I like it," "I really like it," "I really really like it," or "I don't know what is going on but the StackOverflow numbers seem to mean something.

    Jeez. Can't we just all accept that some careers or individual software gigs involve programming in just one language. Most careers and gigs require multiple languages.

    Right now I am doing an Angular project that includes HTML, CSS, TypeScript, Javascript, and Java all at the same time. Is that the "future?" I have no reason to believe so. I am just trying to get a job done.

    There will always be another language to learn and there were always be another up-and-coming language on a hockey stick. That's not a bug that's a feature.

  6. Another "Language X is the Future" Story? by mykepredko · · Score: 3, Insightful

    This type of story is even less useful than "What is today's most popular programming language?" stories that pop up here every week or so.

    Python is an excellent language and well worth knowing and being competent in programming in. But, so is Javascript as all developers tend to need to do some intelligent web UIs. Then there's C/C++, in which most of the world's system programming is written in. VBA is important to have to be able to work with databases/spreadsheets. And, of course you can't do anything without Rust and Go and Perl is great for doing something quick and dirty.

    How about an article pointing out that to have a successful career as a software engineer (ie "coder") you must be willing to pick up skills in different programming languages (and environments) and avoid latching on to what the pundits tell you is "THE PROGRAMMING LANGUAGE OF THE FUTURE".

  7. Wow. The CIA offers some sweet services. by dmomo · · Score: 4, Funny

    "The CIA has employed Python for hacking, Pixar for producing films, Google for crawling web pages and Spotify for recommending songs," notes the Economist.

    I didn't know the CIA uses Pixar to produce their films. And, I'm glad that they're in the business of recommending songs!

    1. Re:Wow. The CIA offers some sweet services. by Entrope · · Score: 2

      The important thing is that they avoided using the passive voice. They could have written "Python has been used by ..." and had no problems with the parallel construction they used. I would guess that's what the original author really wrote. Then someone came along with a grudge about the passive voice and butchered the sentence.

  8. Re:Briefly? No. by dmomo · · Score: 2

    "It seems we will never get tired of "language X is the future of all computer science because Y it" tropes."

    "Language Klingon is the future of all computer science because fuck it"

  9. The future may not be good by raymorris · · Score: 2

    In 1965 someone asked "is McDonald's the future of American restaurants?" The answer was yes, regardless of whether most restaurants were better.

    Is Python the future? That's scary, but it may be so. Why do I say it's scary? I wouldn't have said so 30 years ago. When I started programming, Python would have cool. Something very important happened in the mid 1990s. Something that completely freaked out Microsoft's programming tools team.

    When I started programming, I started by writing very simple programs in languages such as BASIC, which ran first on my computer, then on a Casio calculator / handheld computer they sold in the 1980s. I'll never forget impressing my friends with a program that consisted of nothing but a loop and set of IF statements. It would prompt you to enter your name via the keyboard, then print in the screen "you're cool" or "you're weird" or whatever based on the name you entered. I think for one name in particular, Casey, it said "you're pretty". A very simple program, by a beginner programmer.

    Few new programs today take input via keyboard and print output to the screen. These days, they take input via the Internet, query other resources over the network, and return something over the internet. It's no longer my boyhood crush Casey entering something, it's hackers from all over the world. They attack each program hundreds or thousands of times. Very simple programs by beginning programmers are now vectors for multi-million dollar losses. It's very hard to learn safely these days, because it requires some expertise to design and code software that will be safe against constant attacks. I don't know that I could learn today, it's just too dangerous for beginners to run code exposed to the internet, and today most code is exposed to the internet. Even a super simple programming task like a thermostat -
    if (temp desired) {
      Hear = on
    }

    Is now an IoT, and a threat.

    This worries me because as we make it easier to create software, more possible for people who don't know what they are doing to expose your systems, we are now having so much exposed by people who haven't studied. You CAN write code without learning much at all. You can, that very much doesn't mean you SHOULD. Not in today's society, where everything is online.

  10. Go fork yourself! by fazig · · Score: 3, Interesting

    Hardware trends gravitate towards adding more and more CPU cores and threads in order to increase performance instead of increasing IPC and clocks. AMD will soon release their 64 thread monsters for HEDT and workstations and we're seriously discussing if Python will be the future?
    Maybe in very specific niches, but I don't see it utilizing future hardware very well compared to the many other options that are capable of running multiple threads.

  11. Not a Modest proposal: Lose Tab its ASCII code by mykepredko · · Score: 4, Informative

    Tab should have a key-code, but not a ASCII code, like Shift. It has no place in a document, whether it be code or prose

    You do realize that tab characters are used in places other than "code or prose"? It's very useful for document/table formatting especially for non-proportional fonts. It's also very useful in UI processing (ie moving between controls in a dialog box).

    I don't think what you're asking for is all that modest.

  12. Single threaded toy language by zm · · Score: 4, Insightful

    cannot be THE future of programming.

    --
    Sig ?
  13. Re:Briefly? No. by fermion · · Score: 2, Interesting
    I consider Python like Pascal. Some of it's popularity is simply due to the fact that it is used as a teaching tool so a lot of people are familiar with it. It can do a lot, but ultimately what makes it good as a teaching tool makes it not so good for production code.

    Java and VB are the most popular languages right now. Java is taught to every high school AP computer science student. VB has the entire marketing of MS behind it.

    I use python for personal projects, which are simple and direct. I can imagine Pixar using it as they write code for each movie, and are not widely deploying it to end users.

    I suspect in a decade scripting is not longer going to be the status quo, and the kids will be learning programming by moving blocks. Don' scoff, it is already happening and all that is needed is to expand and refine the technology.

    --
    "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
  14. Re: It has a bright future by Anonymous Coward · · Score: 2, Insightful

    Python is the Cobol of Lisps

  15. Bad Metric: Rate of Queries by blavallee · · Score: 3, Insightful

    Having contributed a hundred searches in the last week, it's another BAD metric claiming how popular python is.
    Last time, it was that python had the most questions on Stack Overflow.

    When a search does not answer a question, when Stack Overflow does not have the answer, it does not mean python is popular.
    It indicates that python is the most frustrating!

    I spent hours trying to get python to use syslog. Any may other languages it's simply syslog().
    To do it with python, search for it yourself. You'll find a dozen ways to do it, but which will work for you?

  16. Channels that mangle whitespace by tepples · · Score: 3, Insightful

    Unless you're trying to collaborate with somebody over a channel that mangles leading whitespace. That's the biggest nontrivial criticism of indentation-as-syntax: you can't demangle it with an indenter.