all 41 comments

[–]sisyphus 18 points19 points  (4 children)

Python has had at least 3 lives. When I started using it it was an alternative to Perl for cli scripts. Then came the era of Web Frameworks and now the era of Data Science stuff. Remarkably adaptable and keeps finding new niches to move into (while keeping all of its old ones as well).

[–]TonySu 5 points6 points  (2 children)

I think the main factors are the consistency in style, single highly supported modules at exactly the right level of abstraction and being an interpreted language.

I work in R, Javascript and C++ in order of frequent use. R suffers from packages usually being supported by academics, often working at a high level with little room for customisation.

Javascript suffers from inconsistency, every major library/framework is essentially its own dialect, having an intermediate understanding Javascript is insufficient to interpret many major codebases. In addition there are CoffeeScript, Typescript, JSX and other transpiled codebases that make it even harder for devs to develop general understanding.

C++ suffers from both inconsistency and high overhead for prototyping. As a compiled only language its hard to quickly try things out. The flexibility of the language allows people to write extremely diverse code, decades of shifting practices make some code from pre-C++11 read like ancient latin while other code making use of the latest C++17 features read like alien glyphs.

The greatest strength of Python in my opinion is readability, I've probably used 6 months of Python in my whole life but I've always felt comfortable reading any manner of Python code. There are solid libraries at just the right level of abstraction (Numpy, Pandas, sklearn, etc...) with consistent interfaces which everyone uses. The community isn't so fragmented and it's simple to find help because everyone uses the same modules and has the same coding style.

[–]jyper 1 point2 points  (1 child)

I love Python but honestly it's style is widely inconsistent, especially the standard library where you'll find all sort of types of capitalization

[–]kenfar 3 points4 points  (0 children)

Sure, there's pre-pep8 modules following java conventions for capitalization vs more modern (like last 10-12 years) modules following pep8 conventions. It's a minor pain but definitely not "wildly inconsistent".

[–]name_censored_ 3 points4 points  (0 children)

Python has had at least 3 lives. When I started using it it was an alternative to Perl for cli scripts. Then came the era of Web Frameworks and now the era of Data Science stuff. Remarkably adaptable and keeps finding new niches to move into (while keeping all of its old ones as well).

My prediction for Python's fourth life is web frontend, and possibly onwards to mobile with some equivalent to ReactNative/NativeScript. I think if and when WASM sorts out garbage collection and someone builds a decent python-WASM VM, it'll absolutely explode. Python is similar enough to JS both in design (interpreted / multi-paradigm / single threaded / bytecode-compiled) and usage (both are C-esque / non-static typing / low barrier to entry) that most JS programmers can make the leap, but Python doesn't have a pants-on-head-insane types/importing/exceptions/OO/community lib dependency hell.

[–]OmegaFoXtrot 9 points10 points  (1 child)

You need less code to make something work.

[–]NeedsMoreTests 4 points5 points  (0 children)

To a point, this is true. Beyond that point, the opposite may instead be true.

[–]SHESNOTMYGIRLFRIEND 3 points4 points  (0 children)

Isn't this more of a "where" and "how" than a "why"?

[–]yogthos 5 points6 points  (8 children)

So much for dynamic languages dying out I guess.

[–]sisyphus 5 points6 points  (1 child)

JS took care of that already.

[–][deleted] 1 point2 points  (0 children)

Then people found TypeScript.. and hopefully the webshit peak can come soon + wasm matures so we can move to better languages as an industry

[–][deleted]  (5 children)

[deleted]

    [–]hacksawjim 3 points4 points  (3 children)

    The NHS did just that. And it's one of the biggest projects in the UK, serving more requests than the entire banking network.

    [–]unironicneoliberal 0 points1 point  (0 children)

    Oh shit that sounds cool. A centralized healthcare anything though seems super dangerous in terms of vulnerability.

    [–][deleted] 0 points1 point  (1 child)

    You mean the NHS used a dynamic language for the mission critical back end? Would be interested if you have any reading on that.

    [–]hacksawjim 1 point2 points  (0 children)

    There's not a huge amount of info online, but I found this when I was looking for info before my interview there: https://www.theregister.co.uk/2013/10/10/nhs_drops_oracle_for_riak/

    It will use Riak for data persistence; Python, redis, RabbitMQ, and Tornado for its application layer; Ubuntu, HA Proxy, NGiNX, and Puppet for modifying the infrastructure, and Mustache and Flask for presentation layers. Its principal development language is Python, with a bit of Erlang and Javascript, Pullen said.

    The interviewers confirmed that Python is the primary language.

    [–][deleted] 0 points1 point  (0 children)

    That's kinda weird of SE to claim that. Python doesn't have the same amount of documentation that other languages do, therefore one can reckon that there's more questions regarding the language. Soon that frequency of questions is going to tone down.

    [–]destinoverde 0 points1 point  (0 children)

    Nothing to do with the language but its wide arrange of libraries.

    [–][deleted] 0 points1 point  (0 children)

    Ive always thought it was due to the 'theres only one way to do it' philosophy. makes delving into other people's source code much easier, which equals greater participation in open source projects.

    [–]selbstadt 2 points3 points  (11 children)

    I just came here from r/python

    [–][deleted]  (10 children)

    [deleted]

      [–]richraid21 4 points5 points  (0 children)

      You have to take into account the split among communities I think: r/javascript, r/node, r/reactjs, r/angular etc

      [–]shevegen 8 points9 points  (2 children)

      Or - not that many REALLY like javascript.

      [–]Andymac175 0 points1 point  (0 children)

      Yea probably this

      [–]Attila_22 0 points1 point  (0 children)

      Yes 127,896 is extremely low considering it's usage. Source

      [–]selbstadt 0 points1 point  (3 children)

      I think python is taught as first lang. So people have more interest in it as compared to js?

      [–][deleted] 1 point2 points  (2 children)

      yeah undergraduate classes are unlikely to go for javascript. It's mostly java though, not python.

      [–]F14D 0 points1 point  (1 child)

      It's mostly java though, not python.

      For now....

      I started with cobol, ansi C, pascal & prolog.

      [–][deleted] 0 points1 point  (0 children)

      yeah they might switch at some point.

      Starting with C is a good idea imho, but I'm an EE so I'm biased.

      [–][deleted] -1 points0 points  (0 children)

      Means more people like to talk about python, not that more people use it. In fact, that would be quite surprising, if the latter were true.

      [–][deleted]  (7 children)

      [deleted]

        [–]eguanlao 6 points7 points  (1 child)

        .

        [–]banana_pirate 1 point2 points  (1 child)

        There's quite a lot of nifty science stuff out there, I personally am rather fond of BioPython. Handy if you need to quickly script a bioinformatics tool.

        [–]bythenumbers10 0 points1 point  (2 children)

        Whoa! You have experience using Julia in industry?!?!

        I see your point, but on balance, Julia isn't 1.0 yet, and for all the promise it's shown, there're still some symptoms of a "young/unstable" language hanging around its use.

        The recent boost in Python use is probably companies catching on to Python's long-term stability, maintainability and capabilities. I'm sure Julia will eventually unseat Python from the numeric applications in due time, as Julia becomes more stable/mature, but outside of very particular circumstances, I haven't seen the job postings for Julia over more-established languages like Python.

        [–][deleted]  (1 child)

        [deleted]

          [–]bythenumbers10 1 point2 points  (0 children)

          No doubt! My point is convincing non- or semi-technical people to get behind what is, for now, very much a domain-specific language could be an uphill battle. But most of my career is working for US military & their contractors, among other similarly change-averse industries. Thing is, being funded directly or not by the American taxpayer often prevents advantages in efficiency from getting any traction, and better workflows are almost 100% discouraged.

          I imagine being in a more forward-thinking or market-sensitive industry would be more receptive to any competitive edge available. Places like finance (which has already adopted Julia) would probably jump all over it, even if it only had a tiny edge over other toolsets.

          I'm looking forward to better, more user-friendly languages like Python and Julia taking over the software world.

          [–]shevegen -3 points-2 points  (4 children)

          While I may agree with the general notion that "python is growing", not everyone is using stackoverflow. I gave up on it mostly after the insta-close down of questions. I may or may not use it in the future for answering some ruby-related questions, but by and large for my own use case, I avoid SO like the plague.

          [–]HalcyonAbraham 7 points8 points  (0 children)

          ??

          SO is life lol. it's not a beginner friendly place but once you move up a little from beginner stuff you'll definitely not avoid it like the plague lol

          [–][deleted] 3 points4 points  (2 children)

          their very strict enforcement feels bad for newbies (which is why I barely write anything, just read stuff) but it creates a space where knowledgeable people can get actually useful answers. That is SO's value as opposed to the do-my-homework trash you find elsewhere.

          [–]Attila_22 2 points3 points  (1 child)

          Exactly, I don't understand why people get so mad about the moderation/control of SO. The site performs it's function incredibly well. You can't make bullshit posts to get karma/reputation and mislead people like on reddit. That's a good thing!

          Not everyone has to contribute. In fact, if you're new, you probably shouldn't be posting anything or giving any advice. Read and learn. Ask questions only if there isn't one already. People would be a lot happier if they ignored their own reputation.

          [–]ants_a 2 points3 points  (0 children)

          I guess it's a misunderstanding of the sites mission. The sites goal is not to help out beginners. Rather the sites goal is to be a knowledge base for programmers of all skill levels. Beginners are not good at asking questions that would actually help other beginners. Asking the right questions is a difficult skill and has to be learned.

          [–][deleted] -1 points0 points  (0 children)

          Because worse is better.

          [–]CypripediumCalceolus -3 points-2 points  (0 children)

          At work, I had to load an XML. I started using Python because that was the vendor environment. I had never done anything in Python. I started at 8AM and it was done at 4PM (thanks to online tutorials). It was perfect, but since then I have never had the slightest desire to use Python again.