Ask HN: Why you use python most?
1–10 of 39 posts
Re: Ask HN: Why you use python most?
#2Re: Ask HN: Why you use python most?
#3Python used to be my go to language. For me it was clear, easy to read, had a lot of great packages. Trying ideas out in the REPL was handy. (I've since mostly abandoned it for golang, and wonder how any of my Python ever worked considering how many silly mistakes the compiler catches).
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 the GIL is finally beginning to be taken seriously instead of considered hypothetical, optional type annotations are being added, etc., but it may be too little too late.
Re: Ask HN: Why you use python most?
#4Re: Ask HN: Why you use python most?
#5Python used to be my go to language. For me it was clear, easy to read, had a lot of great packages. Trying ideas out in the REPL was handy. (I've since mostly abandoned it for golang, and wonder how any of my Python ever worked considering how many silly mistakes the compiler catches).
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…
Re: Ask HN: Why you use python most?
#6I'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.
Re: Ask HN: Why you use python most?
#7I'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.
Don't roll your own monitoring solution, but tie Python scripts into Nagios, etc..
Re: Ask HN: Why you use python most?
#8Recent 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 for the syntax over c++/Java even for performance critical code.
Re: Ask HN: Why you use python most?
#9Now I use python when it's the best tool for the job, where the "job" is a part of a project. My projects usually involve a combination of three languages: python, javascript (node and/or frontend), and bash scripting. The bulk of the code is node, but for scripts I use a combination of bash and python.
I use bash scripts for anything that involves piping data between processes, simple file I/O, backup scripts, etc. I prototype almost every script in bash. When it gets too complicated, or requires parsing a lot of data, I switch to Python (sometimes I even inline the Python in bash with heredocs).
In my experience, bash is usually the best tool for the job if the "job" involves invoking lots of shell commands and piping their outputs somewhere. Using Python to call shell commands is of course possible, but I find it to be much less readable than bash for that specific use case.
Nothing beats Python for parsing and manipulating data, which is why it can be so powerful when combined with bash. Here [1] is an example bash script I wrote in ~30 minutes that uses inline Python. It deploys schema from a JSON file to parse-server. Bash handles the raw IO of reading files, network requests, etc, but inline Python does the simple manipulation of the JSON files.
[0] I haven't worked much with python3 or async/await... but that looks promising (hah) for increased throughput. I've even seen some benchmarks inline with node.
[1] https://gist.github.com/milesrichardson/b30acef8827c53aae088...
Re: Ask HN: Why you use python most?
#10Python 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…