Live data from Hacker News

The Incredible Growth of Python

stackoverflow.blog

201–210 of 224 posts

Re: The Incredible Growth of Python

#201
post #141

Predicting it now. A large part of the "why" is going to be because of the jump in data science. Python is an incredibly kind language to new comers in the sense that it allows you to just get started. A lot of people are making bigger jumps into data science (purely anecdotal) in the sense that they are programming more around it. Scraping data, cleaning data, etc is also really easy with Python. Devops stuff is als…

> Looking forward to the "why" post. Glad that they mentioned that they'll be publishing that soon.

I think the "why" is because, for many users:

* they want a small and easy, dynamically-typed, garbage-collected language with few surprises (see `import this`). Perl misses out here.

* they want something built with C so there's easy access to native libraries. Languages on general-purpose VMs miss out here.

* I don't think they want something that transpiles/compiles down to some other lower-level language (which I suspect leads to difficult debugging). Maybe Nim misses out here.

* they're comfortable with imperative-style programming. Maybe lisps and Haskell miss out here.

* Python is fast enough for most things where C-speed isn't needed. Very-high-level languages chasing dreams of high performance mostly miss out here, IMO.

* they want a language that helps them catch their mistakes. IMO, maybe Lua misses out here (with default nil everywhere).

* Users want a general-purpose language. Again, Lua misses here, though, of course, Lua's goal isn't to be general-purpose anyway.

* I think many users also want a language that's licensed GPL-compatible. Clojure misses out here.

* they want a nice helpful community

* Users want a language with familiar C/C++/JS/Java -ish syntax. Python misses out here! {ducks}

Python has its own set of problems, but it hits all those marks except for the last one. So, it's gotten quite popular.

Re: The Incredible Growth of Python

#202

Earlier quoted context omitted.

the matlab documentation, imo, is the best technical documentation ever written for anything. if your background was more math-heavy then the docs provided easy to understand translation between recognizable mathematical idioms into code (if matlab wasn't already very math-idiomatic). and back in 2010 or so, python's numerical optimization libraries left a lot to be desired, and totally hopeless compared to matlab. (…

Matlab's documentation is really good, except when you need to look at the algorithm and can't because it's closed-source...

hmm... no? I think you can hit ctrl-d or some shortcut like that to go straight into the code of the function that you are interested in, and it can be functions written by matlab.

Re: The Incredible Growth of Python

#203
post #141

Predicting it now. A large part of the "why" is going to be because of the jump in data science. Python is an incredibly kind language to new comers in the sense that it allows you to just get started. A lot of people are making bigger jumps into data science (purely anecdotal) in the sense that they are programming more around it. Scraping data, cleaning data, etc is also really easy with Python. Devops stuff is als…

One "non-programmer" perspective here: Python is the new Perl, except it's fast to read AND write. In Python it's fast to do ...everything. I'm an electrical engineer by trade, and Python gets used a lot.

* If I have a giant CSV with data in it:

    import csv
    with open(filename) as csvfile:
        csvreader = csv.DictReader(csvfile)
        data = list(csvreader)
Bam, an array of dictionaries with the data in them, indexed by column name. With listcomps, whatever I need to do will only take a few more lines. And it's this easy for almost any data format. There will be a widely used library for me to `pip install`.

* I needed to plot some I/Q data and superimpose some other data as a heat map over it. Complex numbers are built in. Matplotlib, and bam, graph created. It looks as nice as the graphs my coworkers make using Matlab, and I coded it up just as fast, if not faster.

* I wanted to play around with ordering a pizza online automatically. Import requests, and off I go.

* The code is so easy to read, I've had coworkers update things I wrote when they have never programmed in Python before.

I don't have to do any compile steps. I don't have to use a special IDE. I don't have to think in objects and state-passing and all that BS (but I can if I want to!). I don't have to search for some arcane library. I don't have to know a magic build sequence. I don't have to edit config files. I just make cool shit really fast. It runs slower, but for most things I use it for, I don't care if it takes 10 us or 10 seconds. I just want to make it work.

Re: The Incredible Growth of Python

#204

Earlier quoted context omitted.

Honestly, virtualenv works. Every single time. I use virtualenvwrapper because I find it and the aliases it provides useful. I'll stop using virutalenv when it actually becomes a hindrance. I know venv exists, but I have precisely zero incentive to use it when virtualenv works and allows me to get on with what I actually want to do.

virtualenvwrapper, virtualenv, venv... This is kinda discouraging :)

virtualenv is python2, venv is python3. virtualenvwrapper is as described, a wrapper around them to provide some convenience functions, but they're perfectly functional without it.

Re: The Incredible Growth of Python

#205
post #201
post #141

Predicting it now. A large part of the "why" is going to be because of the jump in data science. Python is an incredibly kind language to new comers in the sense that it allows you to just get started. A lot of people are making bigger jumps into data science (purely anecdotal) in the sense that they are programming more around it. Scraping data, cleaning data, etc is also really easy with Python. Devops stuff is als…

> Looking forward to the "why" post. Glad that they mentioned that they'll be publishing that soon. I think the "why" is because, for many users: * they want a small and easy, dynamically-typed, garbage-collected language with few surprises (see `import this`). Perl misses out here. * they want something built with C so there's easy access to native libraries. Languages on general-purpose VMs miss out here. * I don't…

A lot of people like the Python syntax. It has to be about the most readable of all computer languages.

Re: The Incredible Growth of Python

#206
post #130
post #9

Earlier quoted context omitted.

Three of us (including me), in an academic lab, are making the jump from matlab to python. We use py3 (of Anaconda, on Windows10). We like it, but we are constantly screaming and bitching about the complications of 2 3 ("Ahhh X and Y module only works on py2!", "Ahhh device developer only provides example code for Labview and Matlab!", "Ahhh python isn't even supported for this device/application!"). Package manageme…

I think you're right, the biggest pain for a general developer for Python is determining which package manager to use. I'm thankfully insulated from it a bit due to using Docker for a lot of my development, but I hate the fact that Pip won't install to your home/project directory unless you coax it to (and sometimes still won't even if you give it all the proper environment variables), and I think virtual environment…

    pip install --user pkgname
Does that not work for you?

Re: The Incredible Growth of Python

#207
post #96

Earlier quoted context omitted.

I don't think hype is the main factor. Ruby's decline is due to its narrow focus on web development and Rails in particular. Whilst there certainly are gems covering other areas of computing Ruby never seemed to diversify the way Python has. With Node.js eating Ruby's lunch in the web development sphere Ruby is left looking like the single-commodity Venezuelan economy. Let me add that I think Rails is a fantastic pie…

Having done both Ruby and Python, I confirm that they are pretty similar languages, both performance wide and syntax wise. Python is mainly popular because of historical reasons. Not because of some magical functionality it has over ruby, here are a few key points: Ruby was created in 1996 and Python in 1989. Python was the main language chosen by academia because at the time no one really knew about ruby, until its…

Ruby syntax has a higher learning curve, making it harder on beginners.

Re: The Incredible Growth of Python

#208

I moved from my last job (mostly C#/vba, front office finance)to a new role (python, data guy at hedge fund). Doing data stuff and simple web services is absurdly more straight forward in python, the main things I miss (weaknesses of python to C# and I'm guessing java): nice parallel options (I know several options exist but haven't found any of them as easy to get into as C# async/await, GIL is the problem i guess)…

Trivial lambdas make Python more readable than highly nested languages.

Re: The Incredible Growth of Python

#209
post #201
post #141

Predicting it now. A large part of the "why" is going to be because of the jump in data science. Python is an incredibly kind language to new comers in the sense that it allows you to just get started. A lot of people are making bigger jumps into data science (purely anecdotal) in the sense that they are programming more around it. Scraping data, cleaning data, etc is also really easy with Python. Devops stuff is als…

> Looking forward to the "why" post. Glad that they mentioned that they'll be publishing that soon. I think the "why" is because, for many users: * they want a small and easy, dynamically-typed, garbage-collected language with few surprises (see `import this`). Perl misses out here. * they want something built with C so there's easy access to native libraries. Languages on general-purpose VMs miss out here. * I don't…

Thats a pretty awesome list!. I'd love for these to be the reasons but somehow I doubt any of us are that thorough.

The only reason I used python is that it was the first result that showed up in a Google search "write program to scrape web page" (ah beautiful soup. How I love thee!)

The only reason I used flask was Udacitys course taught their web app course with it.

I'll admit it, I've never actually analysed the benefits of a language in that way. My only judgement has been "mmm does it feel productive to use this language for what I'm doing". And "how quickly does the documentation take me to a hello world". Which is terribly subjective I admit. I'm suspecting I'm not alone. Or at least I hope I'm not :D. Yes. The embarrassment I feel is real.

PS - it's also how I ended up using nginx over Apache. I couldn't really understand Apache in 30 minutes so I used nginx instead. I even remember an interview where I was asked why I used nginx over Apache and I said "um... because it was easier I guess". Definitely not best practices and I'm trying to be more objective nowadays.

Re: The Incredible Growth of Python

#210
post #198

Earlier quoted context omitted.

Ok. It looks like they also drop python 2 next year?

They plan to release the spec like that, but I'm certain on this update most studios will be lagging due to the vast amount of 2 to 3 migration work that needs to be done.

Oh well knuckle down and use six for another couple of years then.

At least you're not trying to write Fortran compatible with the 77 and 90 specs....

Post reply on HN