back to article Python swallows Java to become second-most popular programming language... according to this index

Python has surpassed Java to become the second-most popular programming language in the TIOBE index, one of several imprecise yardsticks used to rank what's in vogue among coders. "For the first time since the start of the TIOBE index nearly 20 years ago, Java and C don't make up the top 2 positions any more," said Paul Jansen …

  1. sorry, what?
    FAIL

    Sin tax

    As a professional developer I cringe when helping my kids do their programming using this language. To me it's a poor man's lobotomized JavaScript taking a leaf out of the FORTRAN book of stupidity. I really don't understand why educational institutions have adopted it. Can someone explain the appeal?

    1. Blackjack Silver badge

      Re: Sin tax

      Eh, is more or less the BASIC of the 21st century.

      Nowadays BASIC is looked back fondly, but go back in time several decades and the language had many detractors.

      Just like you cannot start teaching math using Isaac Newton's Mathematical Principles of Natural Philosophy, you can't start kids with programing using C.

      1. Tim99 Silver badge
        Coat

        Re: Sin tax

        "you can't start kids with programing using C." Why not? K&R is ~250 pages long - A couple of bits from each section should do it. They need it to be "pretty"?

        Guess what's in my pocket >>=========>

        1. Mike 137 Silver badge

          "Why not? K&R is ~250 pages long"

          The most important attribute of C for elementary programming instruction is that it's very near the metal. The biggest source of bugs in today's bug ridden software is total reliance on the high level of abstraction imposed by most currently used languages.

          Abstraction is highly beneficial in the production environment - it eliminates re-inventing the wheel, it enforces code consistency and it speeds development, but unless a programmer really understands what their code does at chip level, they'll not be able to appreciate the need (or to accumulate the skill) to test to that level.

          The overwhelming majority of security bugs in code result from machine level flaws such as variable type, buffer and pointer mismanagement which are hidden by language abstraction This category is very large, and has not been eliminated by use of highly abstracted languages. It would be much less prevalent if programmers were taught to think at the metal level even when using highly abstracted languages for development. The question "what machine code does this high level program create?" should be in the back of the mind at all times, as that's the code that will actually crash or be subverted.

          1. Crypto Monad Silver badge

            Re: "Why not? K&R is ~250 pages long"

            > The most important attribute of C for elementary programming instruction is that it's very near the metal. The biggest source of bugs in today's bug ridden software is total reliance on the high level of abstraction imposed by most currently used languages.

            As someone who started building hardware and coding directly in 6800 and 6502 machine code, I have a strong affinity to that point of view.

            However, I'd argue it's the explosion of *state* which is the source of most bugs. On a machine with 1KiB of RAM, there was some chance of being able to track all your program's important state in your head. We now have machines with 1,000x faster CPUs and more than 1,000,000x more RAM, and complexity is spiralling out of control.

            Hence there's another point of view which says that a more abstract (functional) approach is the way forward. Unfortunately that requires a complete mental shift in how to approach computing.

            As for Python, I've done a lot of work in this, and my main bugbear is the lack of almost all compile-time checks. You can run your program and have it chomp on data for minutes, only for it to crash due to a trivial typo at the point where it wants to output the data. This means that you have to write unit tests which exercise *every* line of code, including all the unusual edge cases.

            The sweet spot for me currently is Go. It's low-level enough that what you code maps closely to machine language instructions, like C. It has a decent dollop of type safety. But it also includes dynamic memory management, and a straightforward concurrency model.

            1. Tom 38

              Re: "Why not? K&R is ~250 pages long"

              As for Python, I've done a lot of work in this, and my main bugbear is the lack of almost all compile-time checks. You can run your program and have it chomp on data for minutes, only for it to crash due to a trivial typo at the point where it wants to output the data. This means that you have to write unit tests which exercise *every* line of code, including all the unusual edge cases.

              Apart from syntax, there aren't compile time checks, but this doesn't mean there is no static analysis available without having to unit test every line, especially in modern python. A trivial typo in attribute or variable name would be caught by flake8. Using the wrong type of variable would get caught by mypy. Formatting woes can be auto-fixed by black+isort.

              Everyone loves static analysis - in Go we'd use golint, gofmt and govet

              Besides, unit tests are good. Any language that encourages high levels of unit testing, and makes it easy to write unit tests, that's a good thing.

              1. Morten Bjoernsvik

                Re: "Why not? K&R is ~250 pages long"

                >Everyone loves static analysis - in Go we'd use golint, gofmt and govet

                You can force static typing in python just use `-m mypy` or `mypy` command. In 3.9 you do not even need to import typing. Our CI have a mypy label which enforces static type check on any code before deploying containers. We also have git hooks that run mypy on your code before you check in.

                But it is as with all trades, if you program python for years 24/7 you learn to write defensive pythonic, so it is actually not needed.

                1. Tom 7

                  Re: "Why not? K&R is ~250 pages long"

                  But it is as with all trades, if you program any language for years 24/7 you learn to write defensive code, so it is actually not needed.

                  And in moving to any new language you take that experience with you. I was just relieving lockdown boredom by (for some reason dont ask me why) looking at Fortran and someone in the comments here mention Fortran book of stupidity and I though perhaps he should read more than one book. Or add the bits that cause him problems.We're using computers FFS, get them to do the work if you cant be arsed.

          2. logicalextreme

            Re: "Why not? K&R is ~250 pages long"

            In my experience the biggest source of bugs in today's bug-ridden software is idiocy (this probably holds true for yesterday's and the day before's). I know absolutely nothing closer to the metal than SQL with smatterings of Python, C#, bash and Powershell but most of the bugs I've encountered have been stuff I can identify the root cause of, and it's normally nothing a swift punch to the offender's throat wouldn't sort out.

            I'm with you in spirit though, and you rightly highlighted that security bugs are the inevitable impact of a glut of high-level programming. However I think the danger lies in programmers with a mindset that's perfectly content to know what they know at the level they know it — I've never seen much good come out of people who don't always want to know what happens under the hood when they're doing something. The people that do want to maintain at least a bit of passing knowledge of "one level down", as I call it, also tend to have an awareness of when they're out of their depth and will refuse to continue until they've either learned properly or called in an expert.

            1. Tom 7

              Re: "Why not? K&R is ~250 pages long"

              I prefer the Laziness is the Mother of Invention approach. Something pisses you off or makes your life difficult? Fuck it over with a bit of code and or a checklist. My major bugbear in python is the fucking indentation - so a small bit of python or whatever run as a macro to check its a multiple of 4 or tabs or convert one to the other depending on project convention on IDE file save and that's about 5 hrs saved a week on one project I played with that took forever to get to your code and fuckup. Adding preprocessing in make was a a great time save too.

              Computers are really good a finding your mistakes - make use of it.

              1. logicalextreme

                Re: "Why not? K&R is ~250 pages long"

                I've rarely run into the issue except with stuff I've grabbed from the internet and then modified (and a lot less since I adopted spaces), but Git at least has commit and checkout options relating to that sort of thing. The tab/space settings in your IDE should help too, along with displaying whitespace characters.

              2. logicalextreme

                Re: "Why not? K&R is ~250 pages long"

                Upvote for the last bit because I'm pinching that to use on all the people that are afraid of exceptions.

          3. Mage Silver badge

            Re: overwhelming majority of security bugs in code

            You were doing great till then.

            The overwhelming majority of security bugs in code are due to poor programming techniques, not the languages, though it's easier to shoot off your feet in C than PROPER C++ (too much C++ is simply poorly written C with Classes),or Java or C#.

          4. bombastic bob Silver badge
            Devil

            Re: "Why not? K&R is ~250 pages long"

            The biggest source of bugs in today's bug ridden software is total reliance on the high level of abstraction imposed by most currently used languages.

            'Sauce' on that? Not disagreeing, just curious...

            I wouldn't necessarily use 'source of bugs' but rather "source of inefficiencies and bad coding practices".

            After having to clean up a DJango web service, by having it invoke some C language utilities to do the REAL work (and getting 10:1 performance benefits as a result, saving MINUTES of 'wait for it to finish' data transfer time for end-users), I can surely sympathize.

          5. Electronics'R'Us
            Holmes

            Re: "Why not? K&R is ~250 pages long"

            I started out doing some BASIC (horror!) and then assembly for Z80 (on a ZX-81 - that pretty much dates me) and followed that up with stuff on 6502, 68xx and more. The move to C was natural and relatively painless (there are many gotchas but the language is small enough that you tend to find those out quite quickly). That was even despite getting a rather terrible book (which perversely led me to dig further in search of answers and in a way actually made me better at the language).

            Since then I have used a number of different languages, each with its pros and cons. Poor software is not about the language but more about not choosing the right language or not considering the problem space properly. There are others such as totally unnecessary levels of abstraction which is also a programmer problem, not a language problem. I tend to use C more than anything else simply because it fits the problem space I most commonly encounter.

            My view is you need to understand one level below what you are doing. Much of my code has been hardware diagnostics and as such I needed (and still need) to have a detailed understanding of all the underlying hardware and hence the use of C.

            The major problem I see is the use of inappropriate features of languages; inheritance and abstraction (as provided by C++) can be incredibly powerful and useful in a particular problem set, but bare metal diagnostics is not (usually) in that category.

            Python has a well deserved place where it fits the problem space.

        2. Mage Silver badge

          Re: Sin tax

          And no-one should still be using C even 30 years ago.

          Most use of C results in buggy, insecure unmaintainable code. No-one in the last 30 years should be using it. It was obsolete 35 years ago.

          1. Anonymous Coward
            Anonymous Coward

            Re: Sin tax

            What would you have been writing kernels or device drivers in instead, for the last 35 years?

          2. geekguy

            Re: Sin tax

            I'm afraid the idea that no-one should be using C/C++ now is part of the inherent problem. Assembly and its readable counterpart C should be taught as standing still. You cannot build on top without understanding what you are building on.

          3. parperback parper

            Re: Sin tax

            And yet the fact that it's still being used 35 years later kind-of suggests that might not be true.

      2. theOtherJT Silver badge

        Re: Sin tax

        Bang on. Basic is the worst language in the world... except... it's really not. It got millions of us into programming when we were young because you could just spit out a simple program and watch a computer *do a thing* without actually really understanding it. Python is just the same, but 35 years later. It might not be a language you'd want to use for a serious project, but we owe it some respect for the fact that people can just jump in and start using it. It's accessible.

        1. Sceptic Tank Silver badge

          Re: Sin tax

          I've had the misfortune of having to work with Python on serious projects. What a nightmare! You run into the kind of bugs where only one record read from a DB is added to a collection because the statement to add it to the collection is out-dented, and not part of the loop. Or you have property Foo, and assign a value to foo, and now you have two properties in your object. Now go and find out why the code doesn't work. That kind of hell.

          1. logicalextreme

            Re: Sin tax

            I've used it on plenty of serious projects, but those are indeed the sorts of things that can trip people up if they're used to other programming languages. Simplified scoping is the cause of the first, and I don't know what the name for the cause of the second is (being able to dynamically throw properties onto objects).

            That said, you'd generally expect somebody using Python in a serious project to have the correct indentation come as second nature to them, and be consistent enough with their casing that it'd be glaringly obvious if they mistyped a property name.

            1. Glen 1

              Re: Sin tax

              "That said, you'd generally expect somebody using Python in a serious project to have the correct indentation come as second nature to them"

              Indeed. The equivalent bug would be having a closing brace in the wrong place. Easy enough mistake to make, but blaming the language makes them sound like they suck don't have a lot of experience.

              If someone learning C complained about their curly bracket placement, one might nod along sympathetically and tell them to keep at it. Perhaps suggesting a linter/style guide to make such mistakes easier to spot. Why not the same for python? Or was that learning curve so long ago people have forgotten what its like to be new at something?

              Personal preference is a thing, and that's fine. However there is a difference between "I don't like it, so I think it sucks" and "It objectively sucks, so I don't like it". Some of the people posting here are definitely the former, thinking they are the latter.

              As always - horses for courses.

              1. logicalextreme

                Re: Sin tax

                I was actually initially going to say the equivalent would be having the line outside the closing (curly bracket | brace), but then it occurred to me that that would control the variable scope in, say, C# but not Python. So you'd get shouted at immediately for making the same mistake, assuming the variable's useful lifetime was intended to exist solely within the block.

                I hope "objectively sucks" was a premeditated pun :)

        2. MikeShea

          Re: Sin tax

          No serious apps? Instagram. YouTube. Dropbox???

          “I don’t know it” != “it’s not serious.

          I program in C and Python. Python is magnitudes faster to build clean code that works.

          1. Charlie Clark Silver badge

            Re: Sin tax

            There's lot of other stuff written in over heavily using Python either for development or extensions. Python generally scales pretty well, until you start hitting the kinds of limits that Google did with YouTube.

          2. bombastic bob Silver badge
            Meh

            Re: Sin tax

            Python is magnitudes faster to build clean code that works.

            depends on what you're doing. Although I've written sample code in python for things _LIKE_ serial comms demo programs that control a device via USB serial, mostly from the likelihood that doing so would be understandable by the intended audience, I wouldn't use that language to develop anything BEYOND a simple demo, MOSTLY because the handling of binary structures and binary data in general is PATHETIC in Python.

            Additionally, the handling of arrays (in general) is ALSO PATHETIC in Python. I suppose the need for binary structure packing as well as array'd data (in general) is kinda the same basic problem...

            "Clean code that works" - if your "clean code" is "slap these pre-written 3rd party objects together with 'glue' to become 'an app'", then maybe. As for me I'd rather have COMPLETE CONTROL over EVERY aspect of the code, particularly for high reliability things. No 'midnight phone call' or 'angry customer' for anything _I_ write. (it's also why I like to statically link the installed binaries, even for Linux)

      3. Anonymous Coward
        Anonymous Coward

        Re: Sin tax

        > Eh, is more or less the BASIC of the 21st century.

        Ah! So that's where I had left my comment. Can I have it back, please?

      4. Anonymous Coward
        Anonymous Coward

        Re: Sin tax

        > you can't start kids with programing using C

        I don't know. My first programming language, at age 9, was a Lisp dialect. And I had to learn to program *before* I was bought a computer.

        1. Schultz
          Stop

          "My first programming language, at age 9, was a Lisp dialect."

          Pah, that's nothing. My first programming course in high school was in Prolog. Somehow one of the teachers convinced us that those would be afternoons well-spent. It did something to my brain, but I am still a bit confounded after some 35 years.

          Give my Python any day. For those 99% of us who are not professional coders, it does a great job of replacing Excel, Labview, or Matlab with something that works better and doesn't lock you out when you fail to pay your corporation taxes. It's a Swiss army knife -- good at everything without pretending to be the best tool for any particular job.

          1. sorry, what?
            Trollface

            Re: "My first programming language, at age 9, was a Lisp dialect."

            "Ey-up. When I were a lad, mi dad used tuh beat us wi' a pro-log tuh get us owt er bed in 't morning. Ee'd then make us wash wi' raw eggs whilst we 'ad a python round our necks. We'd be lucky tuh be allowed owt o' the 'ouse wi-out first licking the toilet clean."

            1. Anon

              Re: "My first programming language, at age 9, was a Lisp dialect."

              Oh aye, lickin' the user input: first stage garbage collection. Next step were th' cleaning out th' next generation shite wi' owse toes, down th' sewers if we'se were lucky. T'urd generation garbage? That's only rich kids, wi' their fancy grammar 'n' some idea of a consistent accent.

        2. Sceptic Tank Silver badge

          Re: Sin tax

          I started off in MSX BASIC, was appalled by the speed, and dug into Z80 assembler. The ones truly interested in the topic won't be scared by complexity.

          1. Nick Ryan Silver badge

            Re: Sin tax

            Similarly here... I started with Commodore Basic on a Commodore 64, but was quicky frustrated not so much by the immediate speed but the lack of features. I tried implementing things in Basic but had to switch to assembly code. By the time I'd finished teaching myself I'd pretty much disassembled the Basic ROM and support library chip to see what was there that was interesting and how it was implemented. The how it was implemented part taught me a lot, even down to the storage of Basic statment tokenisations and jump tables.

            At first I didn't even have an assembler. I just output the statements using Basic to the screen. I then read these statements using the utterly indispensable Advanced Programming Guide that Commodore sold as this also included the entire 6510 instruction set including the decimal values for each statement. I learnt to write 6510 assembly in decimal!

            Later I progressed to a machine code "monitor" and then, finally, to a proper assembler. The assembler saved a lot of sanity.

      5. sorry, what?

        Re: Sin tax

        What would have been wrong with teaching kids using JavaScript? I don't mean using every last aspect of the language, since there are some serious complexities in places, but using an appropriate sub-set needed for educational projects. Browsers come with tooling better than IDLE.

        1. Anonymous Coward
          Anonymous Coward

          Re: Sin tax

          JavaScript can be rather complex because of its baggage, but your idea definitely is worth considering, IMO, for at least these reasons:

          * As you mention, anyone with a desktop computer of any description has access to a web browser and hence to a JavaScript platform. No installation steps necessary, however simple those may be.

          * Because of its asynchronism it forces you to think about your code in a non-linear way, which is how modern computers work these days, as does a system of any complexity.

          * It supports a good variety of paradigms, so you can familiarise people with them without having to introduce a whole new language.

          * There is a large market for JavaScript developers of all sizes and shapes, so as a skill it has practical value.

          As a couple of readers have downvoted, I would be curious to know if it is because they disagree with your idea and if so, why.

          1. sorry, what?

            Re: Sin tax

            I'd also like to understand why the thumbs down...

            1. Anonymous Coward
              Anonymous Coward

              Re: Sin tax

              As Klitschko once said: the thing with chess is that everyone plays but nobody claims to know much; in boxing, everyone criticises but none gets in the ring.

              There seem to be a lot of the latter type around here.

          2. Nick Ryan Silver badge

            Re: Sin tax

            Because of its asynchronism it forces you to think about your code in a non-linear way, which is how modern computers work these days, as does a system of any complexity.
            Oh, if only this were true. The number of abject horrors that I've come across where supposedly experienced developers don't seem to demonstrate even the first hint of appreciation of concurrency, let alone reducing code exposure to timing issues. Most so-called web application developers still seem to think that a web page is a modal system application and can be abused as such.

            On the other hand, not to bash JavaScript, I've seen the same utter lack of comprehension of concurrent processes in C++ and C# applications.

            1. sorry, what?

              Re: Sin tax

              BTW, whilst JavaScript appears to have concurrency, it doesn't. There's no actual multi-threading the the browser. Instead it is simply single threaded and able to wait on multiple responses from outstanding requests, appearing to multi-task.

        2. rcxb Silver badge

          Re: Sin tax

          Far better to start teaching something that can easily interact with the system, not something sandboxed.

          1. Anonymous Coward
            Anonymous Coward

            Re: Sin tax

            > Far better to start teaching something that can easily interact with the system

            a) Why?

            b) What are the boundaries of "the system" you're thinking of? Note that even in a sandboxed installation there will be an input, and output and processing in between. What else do you need to teach a first programming course?

            c) Why do you assume that a given JavaScript installation will be sandboxed?

            1. rcxb Silver badge

              Re: Sin tax

              As soon as your programming students want to run an external system command, read something from a file on the local system, etc., they're pretty well stuck. Given that Python is going to be at least as easy to learn as javascript, it seems a terrible idea to limit your students to such a sandbox. There are really no reasons to start with javascript, unless you know all your students will be doing web dev.

              c) If you're not using javascript sandboxed inside the web browser, then you've just taken away the one and only reason proffered that it would be a good language to start with.

        3. Periquet dels Palots

          Re: Sin tax

          I think I agree.

          I've done my fair share of Python development, as well as some C/C++, some Matlab and just a little Javascript.

          ES6 Javascript has much of the feeling of Python. If you jettison the old clone-and-modify class model and enforce the classes, I think it feels quite like a solid language and can really be good to teach (and use) good software engineering.

          Everybody has a good ES6 (and later) engine in their devices, be they Win, Lin, Android, macOS or iOS. It can be used to build decent platform independent UIs without a lot of effort. It runs very fast. And app distribuition can be as simple as a zip file.

          I wish Microsoft built a simple IDE for Javascript and include it with Edge. Mostly everything is already in place, they just need to add a simplified copy of the VSCode UI, an editor, and a little handholding code that sets up the boilerplate stuff needed for a new project. Wrap it in a PWA, and you have a new QuickBasic for both kids and adults, with a vastly larger scope.

      6. Anonymous Coward
        Anonymous Coward

        Re: Sin tax

        My university physics programming course started with C in the first year, then C++ in the second year.

        Why not?

        My other university physics programming course was in FORTRAN.

        1. sorry, what?
          Facepalm

          Re: Sin tax

          Starting with C and migrating to C++ is quite different to starting with Python and migrating to JavaScript. C's syntax is a sub-set of that needed for C++ and you can compile C with a C++ compiler. This doesn't hold true for Python and JavaScript. The Python syntax is, um, unique to that language and while there are some similarities with JavaScript (enough to let me help my kids with little extra effort on my behalf) the use of shitespace indentation and colons instead of delimited blocks is very different (and totally insane IMHO).

          As to being asked to use FORTRAN at uni, you are either around my age or you had a cruel and unusual lecturer. Or both.

      7. Mage Silver badge
        Windows

        Re: BASIC for the 21st Century

        Meh, don't they get that BASIC should NEVER have been on CP/M, AppleII, Pet, Tandy, DOS, BBC Micro? That was Microsoft's fault for Porting Dartmouth BASIC, purely a cut down ForTran as an introduction.

        Beginners All Purpose Symbolic Instruction Code.

        Though VB5 and VB6 with Option Explict weren't that bad if you had a C++, Modula-2 or Turbo Pascal background. Hardly Basic at all. Basic.net was such a poor replacement for VB6 that changing to C# was better. And C# is really a MS concept of Java. Certainly better than Basic and a decent rework of the Java idea.

        I've not used Python, maybe it's great. But comparing it to Basic isn't a recommendation.

        1. Richard Plinston

          Re: BASIC for the 21st Century

          > Microsoft's fault for Porting Dartmouth BASIC,

          BASIC is not one language but is a collection of many diverse languages with vague similarities. Some of these were quite usable and maintainable, for example BBC BASIC.

          Actually, Microsoft ported a DEC BASIC for the Altos, and later for several other machines. This was an open source interpreter on DEC. As 8080 development was done using cross compilers on DEC machines this was relatively easy to port the major part of it but a completely new maths module was required.

    2. Glen 1
      Flame

      Re: Sin tax

      "Can someone explain the appeal?"

      **Bad Analogy Warning**

      Think of it like Bash but with a big standard library and friendlier $SYNTAX

      What python is really good at is glue code. That's why the data science folks doing the hard maths have taken it to heart. Its a case of being able to just get on with stuff while others complain about the minutia of juggling pointers. If you start to bump into python's limits, that's when its time to look for another tool. (eg R)

      Look at Jupyter notebooks - you do your hard maths and have the results formatted in a nice graph in the browser window you launched the query from - cutting out many intermediate steps.

      Perl could have been what python is. Yet we see it going the way of COBOL

      If I may ask, what is it about python that irks you? (open question to everyone)

      *ducks*

      1. theOtherJT Silver badge

        Re: Sin tax

        If I may ask, what is it about python that irks you?

        Syntactic. Fucking. White. Space.

        1. david 12 Silver badge

          Re: Sin tax

          The only language I've used without syntactic white space was FORTRAN, in which GOTO100 and GO TO 100 were the same statement, X=SUM SX was the same as X=SUMSX, and accidentally hitting the . key instead of the comma key gave you a legal statement meaning DO50I = 10.1 instead of DO 50 I = 10, 100

          I'm not aware of any person who's actually /used/ a language without syntactic white space who wants to go back.

        2. Richard Plinston

          Re: Sin tax

          > Fucking. White. Space.

          Get better tools, or learn to configure your tools.

          'white space' is only a problem when your tools deal with this inconsistently.

          1. Anonymous Coward
            Anonymous Coward

            Re: Sin tax

            A poor craftsman…

      2. Anonymous Coward
        Anonymous Coward

        Re: Sin tax

        > what is it about python that irks you?

        In no particular order:

        * The stupid indent syntax

        * Their habit of doing things *slightly* different from everyone else

        * The way modules (don't) work (relative paths, etc.)

        * The lack of proper lambdas

        * The "community"

        * The documentation is neither very good nor easy to read

        As others have said, it is basically the BASIC of our days. This is not a put-down. Just like BASIC, it does have its uses, it's horses for courses.

        I use it if I have to, just don't expect me to enjoy it.

        1. CrackedNoggin Bronze badge

          Re: Sin tax

          "Their habit of doing things *slightly* different from everyone else"

          The ternary operator

          value_if_true if condition else value_if_false

          It was wedged in as an afterthought in 2006 v2.5. IMO, it's ugly.

          Presumably a ternary was initially judged to be unnecessary, in order to keep the language clean and simple.

          This way is also possible

          (value_if_true, value_if_false)[if condition]

          1. Flocke Kroes Silver badge

            Re: ?:

            Using C's ?: would confuse some text editors that "know" a : in python always precedes an indented block.

            (value_if_true, value_if_false)[if condition] always evaluates both if_true and if_false which may have unwanted side effects.

            condition() and if_true() or if_false() goes badly wrong if bool(if_true()) is False

            There was a long argument about if/how to include ?:. if_true if condition else if_false was mostly considered least awful.

          2. Charlie Clark Silver badge

            Re: Sin tax

            I've never liked the ternary operator. It was indeed shoe-horned for people who want to do as much as as possible in a single line. Nothing wrong with if/elif/else chains. For very simple logic I personally prefer boolean evaluation if A and True or False. And, of course, switch like functionality generally gets implemented using dictionary dispatch.

            1. ThomH

              Re: Sin tax

              The advantage of the ternary is that it requires that both options evaluate to the same type and avoids accidentally omitting the assignment in one branch or the other.

              As with anything there's a risk of abuse, in this case through nested ternaries and statements with side effects, but in the intended use it's a less repetitive and equally readable way of expressing your intent.

              1. Charlie Clark Silver badge

                Re: Sin tax

                Maybe, but I agree with the OP, it feels like it was added because so many people asked for it, presumably for embedding in template languages, etc. where one-liners make more sense.

              2. Wheels-Of-Fire

                Re: Sin tax

                Speaking of ternary operators, does anyone ever use the ternary operator (?:) in C++ ? The C++ programming book I am currently reading seems obsessed with it and they keep slipping it into their example code. Am I missing something ?

                1. bombastic bob Silver badge
                  Devil

                  Re: Sin tax

                  I use the '?:' syntax frequently enough. If you put them into the arguments passed to 'printf()' you can adjust output based on a value, like:

                  printf("You answered %s\n", (const char *)(bYesNo != 0 ? "Yes" : "No"));

                  (but you kinda need to force some parens and type casting in there so certain compilers won't gripe nor get it wrong)

                  when working with a microcontroller, having ONLY A SINGLE FORMAT STRING for multiple possible outputs saves NVRAM. But of course, YMMV and you probably want to test all possible refactor possibilities before settling for the one with the smallest footprint.

                  1. parperback parper

                    Re: Sin tax

                    Ternary is a very neat and easy way to make something const.

                    int directionMultiplier;

                    if (goUp)

                    {

                    directionMultiplier = 1;

                    }

                    else

                    {

                    directionMultiplier = -1;

                    }

                    ... and now directionMultiplier can be changed without warning later on (leaks non-constness)

                    vs

                    const int directionMultiplier = ( goUp ? 1 : -1 );

                    ... and now directionMultiplier will not change later on.

                    You'll also notice it's handy for books because it takes up less space.

        2. Flocke Kroes Silver badge

          Re: what is it about python that irks you?

          Strange. I like python for pretty much all the reasons you don't like it.

          Ever had to deal with a cryptic error message pointing at the wrong place when there is a } missing in C? The missing } is probably hidden by misleading white space. Sometimes it is easier to find the problem with indent than by remembering what you changed recently but that only works if you have the experience to recognise what the problem is in the first place.

          Modules with and without relative paths work for me.

          I cannot identify your problem with lambdas.

          I find the documentation very good and easy to read (except for distutils and setuptools). If you want really bad, try alsa or Linux sound in general.

          1. werdsmith Silver badge

            Re: what is it about python that irks you?

            I have a Casio handheld calculator that can be programmed in Python, either by uploading to it, or painfully directly through the keypad. It is very popular for non professional programming.

        3. Charlie Clark Silver badge

          Re: Sin tax

          * The stupid indent syntax

          This complaint seems to come from people who've not actually worked with Python a lot and who miss their braces. Indentation is a fairly neutral and natural way to structure blocks: as would that bullet point list of yours look, if you've written it in HTML. It means the structure is visible without having to read the code, and it also suggests that if you're three or for levels in, you might want to think about refactoring.

          This is why Python has become so popular with non-CS people. They understand the importance of being able to express their intent in code clearly and easily and appreciate the excellent libraries for their particular domains without having to know or care whether they're in C, C++, FORTRAN or whatever.

          Where Python is struggling is native and indepth support for multiprocessing and asynchronous work, though async is improving. Some of this is legacy and some of it is because it really is quite hard to get right™.

          1. Anonymous Coward
            Anonymous Coward

            Re: Sin tax

            To add to the list above:

            * People constantly trying to justify poor design decisions.

            1. Charlie Clark Silver badge
              Stop

              Re: Sin tax

              It was chosen for a reason, and I am pretty sure there is data to back that up, and I agree with that reason. That is not a post-hoc justification for poor design. At most it's a personal preference, just as yours is.

          2. Anonymous Coward
            Anonymous Coward

            Re: Sin tax

            > This complaint seems to come from people who've not actually worked with Python a lot

            My arse.

            > Indentation is a fairly neutral and natural way to structure blocks

            *I* will decide, based on the context and the wider environment, how I am going to format my code for readibility and accessibility, not the guy doing the parser. And I am not even blind.

            1. Charlie Clark Silver badge

              Re: Sin tax

              So, you versus the world then. Python's approach removes the need to think about that particular problem, which makes more sense the more people are likely to have deal with the code.

              1. sorry, what?

                Re: Sin tax

                I have to disagree. If I have something like:

                if (condition) {

                something;

                something;

                }

                something;

                It is very clear where the block is even though I messed up my indentation. If I have:

                if (condition):

                something;

                something;

                something;

                and happen to use an editor that doesn't preserve whitespace properly (yes there are plenty out there) then I'm screwed. I have no idea where the condition block finished.

                Oh! Look at that! The Register's post editor didn't keep the whitespace! Shame.

                1. Tomato42
                  Trollface

                  Re: Sin tax

                  ah, so you still pass code around using carrier pigeons? no wonder it irks you

                  come, join us in the in the 21st century, we have distributed version control systems (just don't use carrier pigeons to carry patches either, the patches have syntactic whitespace too)

                2. Richard Plinston

                  Re: Sin tax

                  > an editor that doesn't preserve whitespace properly

                  Get better tools, or configure the ones that you have to suit.

                  1. sorry, what?
                    Facepalm

                    Re: Sin tax

                    And what if I need to post a snippet of code on a forum (such as this) that doesn't preserve whitespace?

            2. Richard Plinston

              Re: Sin tax

              > *I* will decide,

              That's fine. No one cares if you don't use Python.

            3. Gareth Gouldstone

              Re: Sin tax

              PEP 8 - Style Guide for Python. Indentation use 4 spaces per indentation level.

              https://pep8.org/

              1. Anonymous Coward
                Anonymous Coward

                Re: Sin tax

                Ever tried making sense of a Python script through a screen reader / braille display?

          3. Francis King

            Re: Sin tax

            "as would that bullet point list of yours look, if you've written it in HTML."

            Not a good example.

            HTML has start and end tokens - like Fortran, Julia, Elixir... So it doesn't matter what column the text is in, unlike Python.

      3. bombastic bob Silver badge
        Mushroom

        Re: Sin tax

        If I may ask, what is it about python that irks you?

        'pip' and python environments and _EVERYTHING_ surrounding or involved with it...

        THAT and the non-backward-compatible changes from 2.x to 3.x

        1. Richard Plinston

          Re: Sin tax

          > non-backward-compatible changes from 2.x to 3.x

          I've not had any trouble at all writing code that runs identically in Python 2 and 3.

    3. RegGuy1 Silver badge

      Re: Sin tax

      A language that refuses to let you put minuses in filenames is not a language I want to use.

      ALL my filenames have a name such as 'this-is-a-file-of-mine.txt'. WTF will Python not let me use this? Just because it thinks this is some sort of arithmetic expression.

      Fuck off. If I have a file like this on a read-only filesystem I'm stuffed. There may be some exotic way round it, but if I can't easily (or at all) create files with minuses I'm not going to entertain the language.

      Pile of poo -- end of.

      1. thames

        Re: Sin tax

        Well you have pretty obviously never used Python because there is nothing preventing you from opening files that have hyphens in their name.

        In fact I found your claim to be so bizarre that I had to try it myself just to reassure myself that I hadn't fallen into an alternate universe. I was able to open and read a file with a hyphenated name without any problems.

        Your claim lacks credibility.

      2. Anonymous Coward
        Anonymous Coward

        Re: Sin tax

        Can you post a code example that demonstrates your claim?

        In Python (like most other languages) file names are just text, unless you are using the pathlib library (one of those things that someone too clever for their own good decided to tack onto the standard distribution). Maybe it is with the latter that you are having a problem? Or it may be that you were using a file in a context where it was passed on to the shell (rather than a system function) as an argument?

        I do not like Python myself, only use it through gritted teeth, but your claim has to be one of the most bizarre I have come across in the last three days.

        1. Tomato42
          Boffin

          Re: Sin tax

          actually, Python is more clever than that, it knows that file names are not text, they are collections of bytes, that usually form correct UTF-8 or UCS-2 sequences. So if they follow expected encoding it will give you a string, but if not, it will give you a byte sequence (one of the many reasons why you should use `path.join()` instead of concatenation)

      3. Richard Plinston

        Re: Sin tax

        > WTF will Python not let me use this?

        Maybe your computer just hates you because Python lets me do that.

        filename = 'this-is-a-file-of-mine.txt'

        fd = open(filename)

        print(fd.read())

    4. Povl H. Pedersen

      Re: Sin tax

      It is easy to learn, forces some indentation and stuff.

      To me it is just another programming language, with its own HUGE set of modules/libraries. As OP wrote, the library is often a big help.

      I have written a few small programs from scratch in Python, modified others.

      Before Python. Perl was the language with the huge library of modules. Never felt other languages had quite as easy and centralized module library as these two.

      Java I never really got to like, despite having written quite a bit of code in it back in the days.

  2. Pascal Monett Silver badge
    Devil

    "Python creator [..] joins Microsoft"

    Run for the hills !

    Anytime any creator of a valuable anything joins Borkzilla, you can be sure that a basterdized, weakened version of the same thing will emerge from the cursed depths of Redmonia.

    Just look at Sharepoint for proof.

    1. Fruit and Nutcase Silver badge
      Coat

      Re: "Python creator [..] joins Microsoft"

      Keep him away from C#

      1. Tim99 Silver badge
        Trollface

        Re: "Python creator [..] joins Microsoft"

        No, keep the C# people away from him...

    2. Flocke Kroes Silver badge

      All your nightmares

      IronPython was maintain by Microsoftians for a while and is implemented C#.

      1. StrangerHereMyself Silver badge

        Re: All your nightmares

        No, IronPython is Python running on the CLR virtual machine.

    3. Charlie Clark Silver badge

      Re: "Python creator [..] joins Microsoft"

      Because so much stuff is being done in Python, Microsoft is seriously considering allowing to be used for extensions. So, instead of some horrible VBA blackbox, people who really want to, will be able to write macros in Python.

      Guido certainly isn't doing this because he has to but because he wants to and thinks he'll be allowed to make a difference. Something which he famously wasn't allowed to while at Google where his Python for Android was taken out back…

  3. Blackjack Silver badge

    Python is not turned for speed

    And Java is? Because that's not what I have been hearing about it.

    1. karlkarl Silver badge

      Re: Python is not turned for speed

      You can write slow, unoptimized code in either. However a veteran programmer can develop very fast software by avoiding both.

    2. Wilco

      Re: Python is not turned for speed

      yes Java is tuned for speed. The Java Virtual Machine has, over a couple of decades, been provided with a wide array of performance optimisations, including highly optimised low pause garbage collectors, JIT compilation and global code optimisation. Yes, you can construct microbenchmarks that show that C, C++ or Rust perform a bit better, but generally Java is a highly performant language because it runs on a highly efficient VM.

      Python, whatever the benefits or shortcomings of the language and ecosystem, hasn't had the same level of investment, and won't perform as well.

      Also, __init__() is a terrible name for a constructor - the whole "special method name" zoo __new__, __del__ etc are just unnecessary and ugly

      And Whitespce. gack

      1. Charlie Clark Silver badge

        Re: Python is not turned for speed

        The Java Virtual Machine has, over a couple of decades, been provided with a wide array of performance optimisations, including highly optimised low pause garbage collectors, JIT compilation and global code optimisation.

        The same is now largely true for PyPy.

        Strictly speaking __init__ isn't the constructor. You have __new__ for that. The magic methods convention is just that, a convention; though a really useful one because, along with descriptors it means you can provide useful functions without having to worry too much about the method names. This facilitates a certain degree of orthogonaliy across libraries, which is nice.

      2. Anonymous Coward
        Anonymous Coward

        Re: Python is not turned for speed

        > the whole "special method name" zoo __new__, __del__ etc are just unnecessary and ugly

        That merits an upvote.

        There are generally two reasons why you start adding "magic" to your system:

        1) A certain construct is so common and unambiguous that it makes sense to give it special treatment.

        2) You're plugging a hole in your design.

      3. StrangerHereMyself Silver badge

        Re: Python is not turned for speed

        I hate Python too. As a language it's simply a mess. For example, a string or array doesn't have a .length() method op .length property but you need to use len(variable name), which I find illogical and stupid.

        1. Richard Plinston

          Re: Python is not turned for speed

          > I find illogical and stupid

          I find your argument to be illogical and stupid. Your argument is simply: "This language isn't C++".

        2. Gareth Gouldstone

          Re: Python is not turned for speed

          len(obj) is a higher abstraction of obj.__len__() to allow non OO programmers to feel comfortable. So you could do it if you want to write ugly code!

          1. Anonymous Coward
            Anonymous Coward

            Re: Python is not turned for speed

            > len(obj) is a higher abstraction

            1. An abstraction or a synonym? What does it abstract away exactly?

            2. What is the point of it anyway?

            I think this perfectly illustrates the point the other poster made.

            1. Gareth Gouldstone

              Re: Python is not turned for speed

              Python is not a pure OO language. It is a general purpose scripting language based on Objects. Some general things that non-OO people might use are implemented as functions, like print() and len(). In reality, they interact with the object via methods, obj.__str__() and obj__len__(), respectively. So the object itself decides what is printed and determines its own length, if any.

      4. MacroRodent
        Boffin

        Re: Python is not turned for speed

        > but generally Java is a highly performant language because it runs on a highly efficient VM.

        Yes, it surprised me when I benchmarked some popular languages a while back. It actually beat C++ in a sieve benchmark.

        But Java is hamstrung by its implementation architecture, where every class is treated like a separately loadable plugin. Even nested classes. This means program startup is inevitably s l o w and even later, whenever you program has to execute code from a class it has not used before, the first execution is slow.

        This is why people perceive Java as sluggish. The most used CPython implementation was actually ridiculously slow in my benchmarks compared to Java, but because it is consistently slow, and starts up fast, people complain less.

  4. katrinab Silver badge
    Mushroom

    Would that have anything at all to do with Oracle licensing and lawsuits?

  5. Anonymous Coward
    Anonymous Coward

    " And Python's 'slowness' is overstated. Who cares about some other language that's a few nanoseconds faster if you spend hours (or days or weeks) trying to figure out how to use it? A human's time is more valuable than a computer's."

    Firstly, the difficulty comment is just his personal experience.

    Secondly, it's not just the person writing the code, but the thousands of people running it - and those accumulative CPU cycles making the planet hotter!

    1. Blackjack Silver badge

      Really? I didn't know Python was used to code bitcoin wannabes.

      But that would explain so freaking much.

    2. Charlie Clark Silver badge

      Most code isn't doing a lot of processing for a long period of time. And in Python, if that's likely to be the case, you're likely to be using some optimised libraries just like Raymond says, which is what all the machine learning libraries, etc. do. The same is true for physicists at CERN: they process a lot of data in Python that in the backgrounds hands off the processing to some C++ or FORTRAN libraries that they don't need to write.

      BTW. I've met Raymond and he's both nice and smart with a lot of programming experience. As a core developer, he spends a lot of time working in C so he is qualified to make the comparison.

    3. thames

      Raymond Hettinger's explanation was more to the point, and he's one of the core developers. I'll expand a bit more on that.

      First we have to admit that there is no one size fits all language. Different languages have their pros and cons in different application domains. That's why multiple languages exist and will continue to exist for the foreseeable future.

      While there may be no one size fits all languages, Python happens to fit a lot of application domains. It's the "size medium" of computing languages. It's not the fastest, but it's not the slowest either. It's a good balance between speed of development and speed of execution.

      The area that it's slow at is things involving tight loops on large arrays of basic data types, particularly integers.

      However, as Hettinger states, in most of the sorts of applications where you do that sort of thing extensively, you would tend to be using libraries anyway, such as Numpy or other native libraries. One of the things that Python is really good at is interfacing with existing libraries written in languages such as 'C' used in numerical, scientific, artificial intelligence, and other applications. It's a deliberate design choice that prevents certain optimisations that could be made to the Python run-time itself, but it's considered to be worth it.

      If those existing libraries don't suit your needs, there are options such as Cython or Numba which compile Python to C or C++, and thence to native code. At that point there's no difference between a C program and a Python program, because your Python program has been converted to C (or C++). However your development cycle is then slowed down to the pace of a C program, so it's considered advisable to only do this to the performance bottlenecks in your program, if it's necessary at all.

      There are multiple implementations of Python, including ones which have JIT compilers which score well on benchmarks. The fact that people stick with the original C-Python system shows that most users don't see significant performance problems with respect to performance which aren't addressed by the tools and libraries which are well known to Python programmers. There's probably a reason why Python is the language of choice in many high performance computing applications.

      And for markets such as web development, the alternatives to Python tend to be Javascript (NodeJS), Ruby, PHP, or Perl. I would take Python over any of those in an instant, as not only can you typically do the same job in fewer lines of code when using Python, Python is usually faster as well.

      The actual problems that Python has are lack of penetration into mobile programming, and not having a better cross-platform GUI system integrated into the standard distribution than TKInter. The first problem mainly has to do with the difficulties in jumping through Apple's and Google's walled-garden hoops without a big corporate backer. The second problem is due to lack of interest as people would rather either using the native platform GUI (for which there are library bindings) or they prefer to use QT, which is a third party library. Python comes with the TKInter GUI toolkit, and there just isn't enough interest in replacing it to make the effort worth while.

      1. Anonymous Coward
        Anonymous Coward

        > not only can you typically do the same job in fewer lines of code when using Python, Python is usually faster as well.

        Prove it.

        > they prefer to use QT, which is a third party library

        What is the problem with Qt being "third party"? In fact, if I had one good thing to say about Python it would be that developing Qt applications is really fast and mostly frictionless. As an experienced Qt programmer, I appreciate that. It is also what makes it useful as a plugin language for applications that already use Qt as their GUI, database, network or sensor access toolkit.

        1. Periquet dels Palots

          The problem with Qt (or WxPython or whatever) not being a system library is that you will have to distribute it with your application -- and app distribution is by no means Python's forte. Also, it turns your hundred-liner into a half-gig behemoth, plus it throws platform independence down the drain, so you need to distribute different builds for every architechture you support. And then, all that dance with Pyside vs PythonQt and having to choose buggy and incomplete vs expensive.

  6. Sceptic Tank Silver badge
    Devil

    Visual Basic 7.0

    The fact that the guy changing you tires codes in Python is a scary thought. I worked on projects where people with very basic rudimentary programming skills were developing serious systems in Visual Basic 6 and then wondering why things were slow when everything was being converted to strings, passed around, and converted back to numeric formats to do calculations. The perceived ease of use of these tools attracts the wrong type of people to software development careers, who ideally should be pursuing other career opportunities.

    I can see that Python would be a good choice for educational purposes: if you can develop a bug-free program in that horrible language you are probably market-ready as a dev. The language practically forces you to make mistakes. And lack of a compiler means that often, the first time you encounter a simple syntax error is when the code is running in a production environment. Who in their right mind relies on such a system?

    Keep that PoC away from me!

    1. This post has been deleted by its author

      1. J27

        Re: Visual Basic 7.0

        I have fond memories of learning Visual Basic in high school. It was a great jumping off point to real programming languages.

    2. thames

      Re: Visual Basic 7.0

      C-Python compiles to byte code and you will get compiler errors if you type in the wrong syntax. If you want more in depth static code checking than that, there are popular static analysis tools available for free.

  7. Anonymous Coward
    Anonymous Coward

    "I'm not surprised by Python's continued gains in popularity; it's easy to learn and straightforward to use," said Sweigart in an email to The Register. "And Python's 'slowness' is overstated. Who cares about some other language that's a few nanoseconds faster if you spend hours (or days or weeks) trying to figure out how to use it? A human's time is more valuable than a computer's."

    It's straightforward in some respects, a bit of a nightmare in others (eg deployment). And the difficulty and slowness of getting results in other languages is itself being overstated. And nanoseconds do matter, if you're going to scale up, because it can turn into inefficient systems and a whole bunch of wasted electricity. Absent a renewable energy policy nanoseconds can turn into more CO2, in which circumstances choosing Python is putting environmental concerns second...

    Python's popularity is simply due to it being taught, just like JavaScript, Java, C++ and C before it. Universities tend to teach what's cheap and easy...

    1. werdsmith Silver badge

      Contrary to popular belief, Uni computer science is not a holiday, they use C, C++, Assember and stuff like Haskell. They teach supporting stuff in mathermatics and predicate / first order logic.

      Python with its extensive choice of libraries is replacing MatLab on the physics / science courses, and it is quite suitable for that role.

      C++ is seeing the benefit of Qt now, because Qt goes some way to addressing the Linux gui fragmentation problem. Qt is available for Python but the c++ is more native. How many times I’ve heard “ffs, not tomcat again”

      Java is a total turd, horrible outdated piece of crap, which is becoming more and more stigmatised and increasingly rejected since it started to carry the Larry spike.

      I am amazed to see that PHP is still a thing on Tiobe. I had forgotten it existed.

      1. Anonymous Coward
        Anonymous Coward

        PHP? What is this 1999?

        PHP is only one step past ColdFusion.

      2. Anonymous Coward
        Anonymous Coward

        > Contrary to popular belief, Uni computer science is not a holiday

        I don't think the poster above you was referring to computer science studies. They do teach programming courses in engineering and even graphic design studies too.

        I agree with you that PHP is (well) past its prime. It did have its place at one time and I did quite a bit of serious coding in it in my day, but sometime between 2010-2015 it "jumped the shark" as the septics say.

        However, there are large code bases, entire products written in PHP, so it will still be a thing for years to come.

      3. Periquet dels Palots

        I see quite a bit of misinformation in your post.

        Java is in no way stigmatized and rejected. Mostly no destop applications are built with Java, but a huge proportion of Web Apps are built with Java in the server. Java EE seems to precipitously dropping in popularity, but that is because Spring is easier for development, deployment and maintenance, and Java EE Web UIs are anchored in the turn of the century.

        Similarly with PHP. It is behind more than half the worlds web sites, mostly due to the popularity of Wordpress, but not only.

  8. TheMeerkat

    Python today occupies the same niche as Visual Basic did around Year 2000.

    1. werdsmith Silver badge

      I don’t think VB was used much for data science, ML etc.

  9. mrwenni

    Imagine doing some OO progamming like this:

    class Point:

    def __init__(self, x, y):

    self._x = x

    self._y = y

    Yuck. No, thanks.

    But is serves well as a quick-and-dirty scripting language and as a Matlab replacement I suppose...

    1. Flocke Kroes Silver badge

      Or ...

      Point = complex

      Or ...

      class Point(complex):

      Remember - before writing new code check to see how many of the existing implementations already do most or all of what you need.

    2. Tom 38

      Imagine doing some OO programming like this:

      class Point {

      public:

      Point(int x, int y);

      int

      getX() const;

      int

      getY() const;

      private:

      int m_x;

      int m_y;

      };

      Point::Point(int x, int y)

      : m_x(x)

      , m_y(y)

      { }

      int

      Point::getX() const { return this.m_x; }

      int

      Point::getY() const { return this.m_y; }

      Yeah, the problem with python is its lack of legibility.

      1. Anonymous Coward
        Anonymous Coward

        "Yeah, the problem with python is its lack of legibility."

        No, its problem is that the OO support is an ugly hack like it was in its spiritual forefather, Perl. If I recall from my brief look at it, instance variables are also public meaning encapsulation is non-existent.

        1. Anonymous Coward
          Anonymous Coward

          To be fair, encapsulation is not an intrinsic feature of object oriented paradigms.

  10. Anonymous Coward
    Anonymous Coward

    Meaningless

    Python isn't really a programming language, is it?

    It is an interpreted scripting language used to interact with a large set of very useful software libraries (written in C) for statistics, data mining, machine learning, vector mathematics etc.

    No-one uses it to write actual re-useable programmes, do they?

    As a language, it is pretty horribly ugly, but that's just my opinion. Comparing usage to Java is a bit apples to oranges. Might as well say more people use Excel than C.

    1. thames

      Re: Meaningless

      Python and Java fit into very similar application areas, so they're a good comparison. Both are most commonly used to write applications, although Python probably has a broader range of uses.

      The biggest area where Java has widespread use that Python has much less use is in mobile applications, specifically for Android.

      With Oracle doing a kamikaze attack on Google and Google now promoting other languages instead of Java, I won't be surprised to see an increasingly rapid decline in the use of Java in future, and its eventual relegation to the legacy enterprise business application niche. Java won't go away, just like Cobol hasn't gone away, but we can expect to see it continue to slide down the charts.

    2. Anonymous Coward
      Anonymous Coward

      Re: Meaningless

      > Python isn't really a programming language, is it?

      How so?

      > It is an interpreted scripting language used to interact with …

      You are confusing language and implementation

      > No-one uses it to write actual re-useable programmes, do they?

      Yes, myself for instance.

      > As a language, it is pretty horribly ugly, but that's just my opinion.

      And mine. Horrible hack, albeit sometimes useful. What I really detest is the horde of fanatics that it attracts. You can easily recognise them because of their use of the word "Pythonic".

  11. J27

    I think these indexes quite often overrate trendy languages, possibly because it's mostly students and junior programmers filling in surveys. For example, look at how far Ruby has dropped in the last few years, from a previously massively-overrated slot down to #15. Simple to use languages like Python are used a lot as teaching tools, so they have a big following in new programmers.

    I am a little surprised to see JavaScript as low as it is on this list, I thought that was still on an upwards trend. Perhaps I'm just out of touch, or perhaps this method for measuring language use is meaningless.

    1. thames

      Ruby has declined because it's main use was with the Rails web framework. As web applications have evolved and changed how they interact with servers and browsers, Rails has fallen out of favour and Ruby has fallen with it.

      Python has a very broad range of uses and so is not dependent upon any particular one framework or application.

  12. J.G.Harston Silver badge

    Popular?

    Language changes. Nowadays "popular" means "muchly bigly liked". This index isn't measuring popularity, it's measuring most-used-ness or most-requested-by-employers-ness. It's like saying Anusol is "popular".

    1. Anonymous Coward
      Anonymous Coward

      Re: Popular?

      Not even that, I can't think of a single large project that's written in Python.

      A web server? Office suite? OS front end? Browser? Database system?

      It's just a bunch of small website projects.

      Do any of the big web sites even use it?

      1. thames

        Re: Popular?

        Python is extensively used as an application program where speed and therefore cost of development is a primary criteria.

        C is used extensively to write operating systems, databases, web servers, and the like.

        In this sort of comparison C and Python don't really overlap much in use cases. It's a good idea to know both, and to know which one to use in which circumstances, and even how to use the two together. Python is designed to integrate well with C. They are complementary in that respect.

        It would take me a while to recall all the programming languages that I have learned and used professionally. They would amount to two dozen at least, with each having some particular advantage in certain applications.

        If I had to compress all of those languages down to as few as possible to do the same tasks, then C and Python would cover nearly all of those use cases.

        1. Anonymous Coward
          Anonymous Coward

          Re: Popular?

          Some serious generalisations in there, but

          > Python is extensively used as an application program where speed and therefore cost of development is a primary criteria.

          This is indeed my experience and one of the ways in which I use Python (though I do not enjoy it one bit).

          For instance, if I need to do Qt development I don't even bother with C++ these days, I just go straight to Python.

          The other case is for rapid prototyping or if the budget is tight. In this case it competes with Node. If the task is linear or involves things like text processing I'll probably go for Python. If it involves any form of networking, except very low level, or any form of asynchronism or concurrency, it's Node all the way.

          The projects I've worked on (generally not as developer) in the last few years have been a mixture of languages though, whatever makes sense (mostly from a financial and maintainability point of view) for each part. Yes, you do need developers who are fluent and competent in multiple languages and yes, they do command and deserve higher rates, but the overall result is that you get there on budget and on time. Last three projects (between 500-1,500 hours so not massive but not trivial either) have been delivered within (from memory) 2% of estimated budget and +1/-2 days of deadline. There is a lot more than goes with it than mere choice of language, but that and quality developers and requirements people are important factors. In fact, one of the recent projects was the client's second attempt at having a certain tool created for them. The first attempt was abandoned after 18 months by the previous contractor, with no visible results. We put together a much more advanced version within three calendar months at less than one third the cost.

          We can do this because of depth and breadth of experience and because we take pages from many different playbooks. If we were all dogmatic as to what tools and processes we like / are going to use we'd be out of business.

      2. ragnar

        Re: Popular?

        Mozilla, Pinterest, Instagram, Disqus, National Geographic according to

        https://www.djangoproject.com/start/overview/

      3. Glen 1

        Re: Popular?

        "It's just a bunch of small website projects.

        Do any of the big web sites even use it?"

        Yeah, 'small website projects' like google (inc youtube), reddit, instagram, netflix....

        There are *many* sites using python that you will have heard of. A quick google gives many lists, but I present this one as it includes quotes from the companies themselves.

        10 Famous websites built using Python

      4. Richard Plinston

        Re: Popular?

        > I can't think of a single large project that's written in Python.

        Your inability to think is not a constraint on the use of Python.

      5. porkfat

        Re: Popular?

        Well, AI. *the* big thing of the moment. pytorch, tensorflow and what?

        Can you imagine those reference frameworks in perl? Oh god.

  13. StrangerHereMyself Silver badge

    Professional use

    I believe that TIOBE should not just polling the number of developers using the language, but also the number of PROFESSIONAL developers using it.

    Most professional developers only use Java, C# or C/C++ and Rust should be seen gaining in popularity there. I don't for a minute believe many LOB (line of business) applications are made using Python. Businesses would be building on quicksand if they did.

    1. Anonymous Coward
      Anonymous Coward

      Re: Professional use

      I checked a few job boards, and almost all the jobs with programming language requirements are for Java or C#. I suspect those languages simply don't have such enthusiastic proponents as the likes of Python.

      1. werdsmith Silver badge

        Re: Professional use

        Some languages where the developers are usually very competent, you don’t see much web chatter because they are not students constantly asking for help with their coursework on stack overflow.

  14. Anonymous Coward
    Anonymous Coward

    It’s what students learn now

    It’s no mystery why Python is number one. Once Stanford replaced Java with Python as the first language they teach, other schools followed suit. And so when all new grads prefer Python, it eventually becomes number one. Just a matter of time.

  15. aldolo

    java fasing out because of the new license

    my company will stick to the older jdk because of the new license cost, and will replace it with openjdk when required.

  16. martinusher Silver badge

    I've never understood what people have against braces (or semicolons)

    I was quite lucky because despite being introduced to programming by way of BASIC (and even a touch of FORTRAN) I only really got going when I learned Algol. I also dabbled with Lisp and its offshoots but as I was a reformed engineer my nnatural progression was towards systems lianguages like 'C'.

    People have developed numerous languages over the years but they all have two characteristics that make them inferior (in my estimation, at least). One is that there sems to be a vendetta against structuring tokens like braces. Python is Exhibit 'A' here. I put this down to the idea that most programmers can't type. They'll do anything to save a keystroke or two and the result often ends up being machine readable at the expense of being human readable. The other is that people confuse functional libraries with the language. Many programmers assume tha the execution environment -- the bit that gets to 'main' in a 'C' program -- is an inherent part of the language. They also assume that the libries are an inherent and necessary part of a language. This results in criticism of languages which is entirely unjustified -- the critics are really talking about libraries, not the language. Experienced programmers will know how to attach any library to any language. (Which segues neatly into the problem with Java -- with Oracle trying to claim ownership of the API there's ample grounds for avoiding it for new projects.)

    A huge amount of effort has been expended over many years to make a language that's 'programmer proof'. The earliest that I know of is ADA but there might be others. Its useful, but everything always comes down to the notion that its not really the language that's the problem, its the software. A disciplined programmer can take a vintage version of BASIC and produce nicely structured code. I've seen people make what could only be described as a "God awful mess' using C++ -- void methods returning void with essentially a puddle of global variables, a nightmare to debug let alone figure out the design. I tell people that experienced programmers spend a lot of time not writing code -- the novelty of coding wears off after hte first couple of decades -- but this usually elicits odd looks.

    So Python is the language du jour now. Some years ago when my nephew was in college it was Java. It will probably be something else next year.

    1. Richard Plinston

      Re: I've never understood what people have against braces (or semicolons)

      > the result often ends up being machine readable at the expense of being human readable

      You have that entirely the wrong way around. Python, as long as the source code use space characters and not tab characters, is read the same by the machine and the human reader. Braces and braced indent can be misused to confuse the human reader.

    2. Marco van de Voort

      Re: I've never understood what people have against braces (or semicolons)

      Well, braces are shifted letters. Non shifted characters are easier. Like euh, begin...end, but some people wanted to save some keystrokes ;)

      1. parperback parper

        Re: I've never understood what people have against braces (or semicolons)

        Braces are a great improvement over BEGIN..END or WHILE...WEND or REPEAT..UNTIL etc. etc. for the lazy typist.

  17. Lorribot

    Seems to me there are a lot of coders here. Most have experience on several languages and probably represent about 0.1% of the population of a school.

    If you want to teach kids you need to engage with and get them motivated, this requires you to give them a good reason to do something or make it really easy or it will be a very long and uphill battle. with any luck more than 1% of them may be interested enough to look a bit deeper.

    Basic was basic, but it was something anyone could do and was a big step up from CESIL on punch cards sent of to the local University computer lab every week especially as you could do it on a new fangled Z80 based Research Machines micro computer.

    Python seems to be also relatively easy for a disinterested youth to get something to happen on screen and understand what is written. Many of the others have been written to perform certain tasks in particular scenarios and probably not as ideal as first language.

    If you were teaching Art you would not give kids a block of marble and a hammer and chisel or oil paints and a canvas, more likely some pencils, clay or cheap water based paints.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like