Live data from Hacker News

Python 3 in 2016

hynek.me

71–80 of 194 posts

Re: Python 3 in 2016

#71
post #68

I started off python learning python 3, but a few months into it, I was forced do a project in python 2. It was a turning point, I immediately ported over all my python projects to python 2. To me, it just seemed more simple, elegant, and cleaner. It was the more pythonic version of python. And if I'm still working with python after 2020, I'll be using python 2.

I don't understand this, what is more "pythonic" about 2?

Not typing 'encode' or 'decode' when dealing with strings. I know it sounds stupid, but it's really distracting compared to everything else in python that just flows easily.

Re: Python 3 in 2016

#72
post #22

Earlier quoted context omitted.

Your post gives the stats some level of credit when really they tell absolutely nothing, or more precisely they tell a tale that is so open to interpretation as to mean nothing at all. There's no gloom around Python 3. Lots of people support it. The highest ever upvoted post on Reddit/r/Python was a post asking to remove training material that asserts that Python 3 is irrelevant. https://www.reddit.com/r/Python/top/…

Hm that’s unfortunate that it comes out that way. I thought I’m just acknowledging that people are agonizing over them and then explain why’s not a good metric.

Footnotes are not very explicit, nobody reads the small print.

Re: Python 3 in 2016

#73
post #71
post #68

Earlier quoted context omitted.

I don't understand this, what is more "pythonic" about 2?

Not typing 'encode' or 'decode' when dealing with strings. I know it sounds stupid, but it's really distracting compared to everything else in python that just flows easily.

Then you're doing it wrong. Sorry but that's definitely better solved in Python3 than in 2. Always decode/encode when opening a file/stream/whatever and only use unicode internally.

Re: Python 3 in 2016

#74

I've done a lot of Python for many years and its all been Python 2. Python 3 seems to be a decent improvement, and if I was working on a Python 3 project, that would be fine. But when it comes to new projects, I struggle to find a compelling reason to use Python at all, when there are so many amazing languages now to choose from. With a new project you could choose Scala, Haskell, Clojure, Erlang (or Elixir) or Go. A…

> I struggle to find a compelling reason to use Python at all

My issue is I always see Python as the Second Best choice for what I am doing. There is always a better tool for the job. The one thing going for Python is that it is such a generalist BUT when doing work I prefer the Right Tool for the Job approach. I seriously can't think of a job that Python does best.

Re: Python 3 in 2016

#75
post #71
post #68

Earlier quoted context omitted.

I don't understand this, what is more "pythonic" about 2?

Not typing 'encode' or 'decode' when dealing with strings. I know it sounds stupid, but it's really distracting compared to everything else in python that just flows easily.

Sounds like you are shooting yourself in the foot. Your code may work with ASCII but will immediately break in non-naïve cases.

Re: Python 3 in 2016

#77
post #63
post #47

Earlier quoted context omitted.

Go is staticly linked, you don't need to deploy packages, just the binary.

But you have to build those with its dependencies. And the best thing Go came up with is vendorizing.

And good luck keeping everything updated.

(Does go statically link the libc, too? If so, you should be rebuilding all your go applications right now, after the glibc issues reported on Tuesday…)

Re: Python 3 in 2016

#78
post #10

Been thinking about learning to code, and a lot of people have recommended Python as a good language to begin with. Taking a look at this, should I be looking elsewhere?

If you decide to learn Python, I'd suggest going through the Learn Python the Hard Way book. It's excellent.

Re: Python 3 in 2016

#79

I've done a lot of Python for many years and its all been Python 2. Python 3 seems to be a decent improvement, and if I was working on a Python 3 project, that would be fine. But when it comes to new projects, I struggle to find a compelling reason to use Python at all, when there are so many amazing languages now to choose from. With a new project you could choose Scala, Haskell, Clojure, Erlang (or Elixir) or Go. A…

For anything involving data analysis and scientific computing Python really shines - though I'm often surprised the extent to which web-oriented programmers are unaware of this, I read things like "you can write better web services in Go, therefore Python is obsolete".

Python in science is kinda like the One Ring the Binds them - it is the glue that holds together the HPC code at CERN, ESA, NASA, and more, it crunches climate models and delivers your daily weather forcasts. Some really great projects like Cython, Theano, and Numba boost the performance of numeric code to native speeds with a fraction of the hassle of hand-written C. Mountains of machine learning research is done in Python, as well as statistics and analytics. And of course Numpy remains the de-facto standard of N-dimensional array libraries - if you look at numeric computing libraries in many other languages they will be framed as "Numpy-for-X".

Re: Python 3 in 2016

#80

I've done a lot of Python for many years and its all been Python 2. Python 3 seems to be a decent improvement, and if I was working on a Python 3 project, that would be fine. But when it comes to new projects, I struggle to find a compelling reason to use Python at all, when there are so many amazing languages now to choose from. With a new project you could choose Scala, Haskell, Clojure, Erlang (or Elixir) or Go. A…

> or Go.

If you like Go, try Nim - it's like Go but without all the dogma. I wrote a blog post about my little Nim project: https://klibert.pl/output/slock_in_nim.html

> Why should I choose Python 3 for my new projects?

You shouldn't unless it fits all the constraints of your new project. Choosing a language is not, for the most part, a technical decision: sure there are language features and implementation features (those are separate matters!), but in the end it comes down to external factors: your experience with a particular paradigm, your taste in syntax, skills of potential collaborators and so on.

One thing of note, though: there is no rule saying that you can't use more than one language for your project. On the contrary, you can mix-and-match languages with relative ease nowadays (see https://klibert.pl/output/python_interop.html) and, in my experience, it works rather well. For example, in one of my projects I need to scrape a bunch of websites for data and then process this data. I wrote scraper in Elixir, which made dealing with network errors and parallelizing requests a breeze, and used Python with Pandas for the analysis part. It was a very pleasant experience: neither Python nor Elixir were up to the task on their own, but they worked very well together. It's even easier when you use a JVM, .NET or JavaScript-based languages.

Post reply on HN