Live data from Hacker News

Ask HN: Why you use python most?

news.ycombinator.com

21–30 of 39 posts

Re: Ask HN: Why you use python most?

#21
post #6

Earlier quoted context omitted.

How about moving any (all) calls to /usr/bin/ssh to run a script on a remote server? Like running deployment, upgrades, or creating home directories and mail folders for a new user? http://harpcaller.jarowit.net/ ( https://github.com/dozzie/harpcaller )

We do this using Ansible (Written in python haha). So we have that covered there =)

I would say that Ansible, with its all SSH baggage, is quite poor method of running remote procedures, especially when it's mixed with maintaining configuration. But d'oh, it's the usual way people abuse it.

Re: Ask HN: Why you use python most?

#22
post #18

Python is my go-to language and I write big batch jobs in it and profile them and use PyPy. I do it because it's so clean and concise. Recent C++ with lambda and auto is much improved but still not nearly as productive as Python. Likewise lambda has really made Java better, but lack of type inference really makes it clunky to write. I really want a statically typed Python. But because I don't have it, I choose Python…

> I really want a statically typed Python. Can golang fill this role?

Both Golang and Swift were designed as performant, type-aware Pythons. It should be able to fill the role fine.

Python also has optional type support since 3.5: https://docs.python.org/3/library/typing.html

Re: Ask HN: Why you use python most?

#23
post #5

Earlier quoted context omitted.

Yeah, both Golang and Swift are direct descendants of Python, and it's sort of hard to justify a niche for Python now that Google and Apple have performant in-house versions. I have to wonder if Go and Swift would've just been Python if Guido had put more attention on the Python VM (and been willing to make some compromises to accommodate improvements). Now Python is stuck playing catch up. Discussion around removing…

if python is the language of ML and ML is the future, i dont think the snakes are going extinct.

1. There's no reason that Python has to be "the language of ML", especially not with so many new Python-inspired languages, like Go. ML is a performance-sensitive sector. Python's strong/established C FFI is its selling point here, since Python gives such nice icing on the cake buried in a C module like NumPy, but this will only matter as long as the newer languages are not fast enough for the performance-sensitive bits. Once native Go is fast enough, it seems logical that everything will move to Go instead of C+Python.

2. "ML is the future" is vague and meaningless. ML is certainly not the future for many things, and it's certainly being misapplied on many other things in the cargo-cult belief that ML must be used everywhere.

Re: Ask HN: Why you use python most?

#24

I'm in ops and python is pre-installed on debian and fedora so besides writing stuff in bash, python is my next best thing without installing other languages. I would like to do more advanced things in python but I don't have any big projects / automation in my head yet.

ops is a great place for Python. How about backups? Backup monitoring? Don't roll your own monitoring solution, but tie Python scripts into Nagios, etc..

Yea i'm tying python into that stuff where I can. But i'm hoping to do something not ops related with Python eventually. Maybe implement my own monitoring dashboard with django and some other front end framework.

Re: Ask HN: Why you use python most?

#26
post #14

The biggest reason I use Python? Honestly, because it's great for interview-type problems, comfortable for writing on a whiteboard, and suits one-man projects where I don't find myself wishing for static typing or interfaces as a way to coordinate code. P.S.: I'm sure you can make big multi-team projects in Python with the right discipline and tooling, but that's just not the spot it occupies in my language-toolkit.

And when you do find yourself wishing for static typing, there is MyPy. It's not perfect but it's much better than nothing.

Re: Ask HN: Why you use python most?

#27
post #5

Earlier quoted context omitted.

if python is the language of ML and ML is the future, i dont think the snakes are going extinct.

1. There's no reason that Python has to be "the language of ML", especially not with so many new Python-inspired languages, like Go. ML is a performance-sensitive sector. Python's strong/established C FFI is its selling point here, since Python gives such nice icing on the cake buried in a C module like NumPy, but this will only matter as long as the newer languages are not fast enough for the performance-sensitive b…

Actually there are several reasons that Python has to be the language of Machine Learning and Data Science. It begins with two decades of being promoted as the most accessible language for scientists to get the job done. Then the widespread use of Python led to an explosion of libraries creating a rich ecosystem.

Nowadays there are sophisticated tools like Orange3 and Jupyter (not to mention Beaker Notebook) that make it easy to share code within teams of scientists. None of this is going away and even R users are discovering that it is easier to use R for the stats part of the problem and integrate with Python for everything else. R used to have the best presentation graphics but now Python has caught up with improved Matplotlib and Bokeh. Also some people prefer to use d3.js in the browser moving from just presenting their data to enable exploration of it.

In the ML/DS area, CPUs will never be fast enought with Go. You need to exploit the GPU which Python has good support for, or move to distributed computing which Python also does well.

No other language will dislodge Python. Instead we are making integration more prominent and using multiple languages working together. Beaker Notebook is particularly good at this and is driving Jupyter in that direction too.

Re: Ask HN: Why you use python most?

#28

Python is my go-to language and I write big batch jobs in it and profile them and use PyPy. I do it because it's so clean and concise. Recent C++ with lambda and auto is much improved but still not nearly as productive as Python. Likewise lambda has really made Java better, but lack of type inference really makes it clunky to write. I really want a statically typed Python. But because I don't have it, I choose Python…

> I really want a statically typed Python.

You need to give type annotations a shot! https://www.python.org/dev/peps/pep-0484/#abstract

    pip install mypy
    mypy script.py

Re: Ask HN: Why you use python most?

#29
It was easy to learn, has great libraries to do virtually anything and I haven't yet found a need to require strict static typing (I haven't explored MyPy yet though). More importantly, I know the internals of the language pretty well and I invested a lot of time in learning them. So I'm kind of reluctant to switch to another language, although I want to explore Go.

Re: Ask HN: Why you use python most?

#30
post #18

Earlier quoted context omitted.

> I really want a statically typed Python. Can golang fill this role?

Both Golang and Swift were designed as performant, type-aware Pythons. It should be able to fill the role fine. Python also has optional type support since 3.5: https://docs.python.org/3/library/typing.html

> Both Golang and Swift were designed as performant, type-aware Pythons.

What do you base that assertion on? :)

Post reply on HN