Hacker News new | ask | show | jobs
by a1a 4452 days ago
On the other hand, if you are comfortable with Python 2, it will do the job, and you know it will be supported for a foreseeable future, why bother learning Python 3?

I assume there is a good answer for switching to Python 3, but I honestly don't know (haven't bothered to do any research though).

Harshly put: I care about getting my python script working as soon as possible and for a foreseeable future - I couldn't care less for the Python language and it's future.

7 comments

> On the other hand, if you are comfortable with Python 2, it will do the job, and you know it will be supported for a foreseeable future, why bother learning Python 3?

This bothers/worries me, because I don't understand where this notion that "learning Python 3" requires significant effort or commitment comes from. Python 3 isn't massively different from Python 2. I learn more "new stuff" (APIs I've never used before, implementation details of systems I work on/with, etc.) basically every month than that difference.

Python 2 -> 3 can be a big step because of dependencies. The difference between the languages themselves is negligible (and yet, IMHO for the better). You don't need to learn any new ways of thinking here.

If you're comfortable with Python 2, you're comfortable with Python 3 as well. If your dep ducks are in a row and you're writing new code, it's an obvious choice.

It's not about the language. Languages are easy to learn. I can learn one between breakfast and lunch and be productive by dinnertime.

I use Python 2 because of the massive ecosystem of libraries that have been written, work, and will continue to work.

It's shortsighted and more than a little irresponsible to shame or muscle people into switching. Code that works is valuable. Code that has been tested for a decade is valuable. What's not valuable is forcing an upgrade to a platform that nobody wants to upgrade to while forcing us to abandon third-party code with years of field testing that the authors aren't ever going to port to python 3.

> It's not about the language.

It was for the OP. Can't fault me for my reply not reading on an argument you make after the fact :).

> I use Python 2 because of the massive ecosystem of libraries that have been written, work, and will continue to work.

I too like useful libraries that save me time and effort, and I agree that Python 2 is extremely strong there. I feel like Python 3 is catching up and has a pretty good library story going for it already (my gratitude to those who make that happen through their contributions), in addition to being a language I find more enjoyable and productive to use than Python 2.

> It's shortsighted and more than a little irresponsible to shame or muscle people into switching.

I don't think I've done either, and I think you're being quite rude here. I was merely voicing my opinion that the magnitude of the differences between Python 2 and 3 gets blown out of proportion. Please be mindful of the context.

> that nobody wants to upgrade to

Not so, I've wanted to and have upgraded things to Python 3, and so have others.

As for the whole "forcing" stuff - well, yes, it happens. As a user of a language you're part of a community, and communities can sometimes decide to go into a direction you don't agree with. It's frustrating and difficult, and you can reasonably decide that it's a deal-breaker and leave the community. Often however it's valuable to instead put one's efforts into achieving consensus, and then defending and carrying that consensus, even if it's not what you originally wanted - shit tends to get done faster then, to the benefit of all.

I didn't mean to be rude. I'm sorry if it sounded that way. I think it's both shortsighted and irresponsible to force people to abandon libraries that work.

The parent poster wasn't concerned about learning the language. They were concerned about dependencies that work, which is what I was saying:

"I care about getting my python script working as soon as possible and for a foreseeable future - I couldn't care less for the Python language and it's future."

Yes, I didn't mean "nobody" literally. I should have said "few."

> The parent poster wasn't concerned about learning the language. They were concerned about dependencies that work

No, read more of the thread - to quote the OP:

> I rarely write anything high language besides small scripts.

OK, so you could argue that their scripts probably remain small because they call into tons of third-party code, but honestly I get the impression that it's a case of working with the included batteries and not being overly concerned with dependencies. If it was solely about deps availability, they probably wouldn't have talked about "learning Python 3" as their sticking point.

^ This is the best comment in the entire thread.

Nobody who's making anything that actually matters and delivers value to customers cares about the improvements in the language itself as much as they care about the battle-tested libraries that come with that particular language.

If you are a company that actually matters (has significant growth / users) and you use Python3 over Python2 as the main language in your stack, I'd like to know who you are, if you even exist.

I'm a build engineer at Intel (100,000+ employees), and we strictly use Python3. You act like it's a completely different language. It hurts the community when you blow the situation out of proportion. There are innumerable Python3 libraries, and while there are most certainly more in the Python2 camp, who cares? This isn't a dick-measuring contest; it's a change for the better in a language we all seem to like.
Is Python the main language you guys use, over Java/C++ as well? And what's the context of its usage? How do you deal with stuff that's missing, do you just have your own employees fork and port existing libraries?

I'm not asking as a challenge to you, I'm genuinely curious.

Well, the one big reason was that you were going to lose support for Python 2. Guido just took that reason away and now tens of thousands of new Python apps are going to be written in Python 2 because they've got another 6 years to worry about it.

Guido just created a bigger problem. No good deed goes unpunished.

> Well, the one big reason was that you were going to lose support for Python 2. Guido just took that reason away and now tens of thousands of new Python apps are going to be written in Python 2 because they've got another 6 years to worry about it.

This shows a serious disconnect from reality. Discontinued support for Python 2 was never a major reason to move to python 3 for apps. Library support is WAY more important in the choice to switch. If all of the libraries worked with Python 3, there would be no reason for app writers not to switch.

Yeah but I understand GP's sentiment. As someone who writes python for my living currently, I'm a little disappointed at this because it's hard to imagine that it doesn't move further into the future the day on which we will switch our code base. I don't need to be a 3-second attention span novelty junkie to just get some pleasure out of using the latest version of the language at my workplace.
It feels like the problem is the black-and-white thinking on the part of developers of every language being either "okay to develop in" or "completely unsupported."

If only there was a way to deprecate a language, with the same meaning as deprecating an API method: "it's not gone yet, but it will be soon, so in strict mode using it is an error." (The main problem to solve would be: strict mode of what? The package manager?)

"If only there was a way to deprecate a language, with the same meaning as deprecating an API method"

One way that usually works is to release a newer version and stop updating the old one after five years. Oh wait...

It's the "using it in strict mode is an error" part that's important. Compilers can automatically refuse to compile deprecated-but-not-broken code. What can automatically refuse to let you start a new project in a deprecated-but-not-broken language?
Where exactly do you get this "tens of thousands" number from?
From the number of Python programmers out there and the percentage using Python 2.

In fact there'd be "tens of thousands" websites made with Python alone (Django et al), so the number of apps in total will be much higher.

Heck, people doing scientific Python are more than 10.000, and they write more than one new apps for their research every year.

Oh, I see. Some people here misinterpreted what I wrote to suggest that Python isn't widely used. Clearly that's not what I meant.

I just dislike how melling basically pulled a number out of his ass, and then used it as "evidence" to back up his claims. I wouldn't even consider it a low-quality estimate, since he doesn't even try to justify or explain how that number was obtained.

In this case, "tens of thousands" could very well really be "hundreds of thousands". It could be significantly less, too. Regardless, it's purely speculative. Using such made up numbers makes his argument weaker than perhaps not using any such value at all.

No, I picked what I thought would be a lower bound. Do you think it will only be a few hundred or few thousand over 6 years? Python is an extremely popular language.
I really do not know. I prefer not to make specific guesses, even lower-bound estimates, when there is insufficient information available.
" why bother learning Python 3?"

Unicode

And of course, you'll move from a platform that's shutting down to one that's evolving

Really, it's worth it.

Python 3 really is a superior language. It took all of the good parts from 2, and left the cruft behind. The downside is that there were so many good parts of 2, and so little cruft, that 3 isn't all that much different. However, it's different enough to break things.
Not to mention `yield from`, which is awesome. Iterators everywhere is a powerful tool.
Unicode works perfectly fine on 2.x.
The 2.x API is incredibly and almost unusably confusing to someone who hasn't already puzzled out the right ways to use it from the many wrong ways that are easier to find.

But that's OK, because 2.7 is exactly for the people who have to maintain old 2.x projects and people who never want Python to change again (and will just move to Rust or something soon anyway, instead of learning and using features in Python 3).

It's hardly shutting down if the support will last another 6 years ...
Well, if you were and are staying on Python 2.7, you are committing to anywhere from 6 (if you start now) to 10 (if you started day of 2.7.0 release) years of a frozen, non-evolving language. No new features, no improvements, nothing -- just the same language, for a decade.

If you can live with that, then by all means stick to 2.7 until your Red Hat support contract expires. If not, consider switching to 3.x.

    No new features, no improvements, nothing -- just the same language, for a decade.
Am I alone in being excited by this? I am figuratively drooling over such stability.
No you are not alone. But you are minority. Majority sees the language not as a tool to solve specific problems, but as a goal, i.e. a way to chase its own tail endlessly. Hence the rudderless pursuit of new. The whole industry is in ADD mode - they moment they create something useful, they discard it and start a new quest.
Projects which never improve get replaced in a few years by new projects which did things better, and by other old projects which improved.

This is not ADD, this is not rudderless. This is preferring actively maintained and improved things over old crap that never gets fixed

Try ANSI C then!
I heard Pascal is all the rage nowadays

Or a good, supported, still used and very stable language: Fortran.

If you prefer to work with a platform that will get only bugfixes/security updates go ahead

Potentially no new libraries (for new things and/or API connections)

Not sure how long new versions of existing libraries will keep 2.7 support.

No new libraries? I wonder if 2014's new Python implementation from Guido's employer Dropbox- Pyston, count as significant in your mind?

If you prefer to have no Google App Engine, Azure, Amazon or distro support other than Arch, then have at it. I'll keep that and PyPy, Pyston, Jython, IronPython, PyInstaller, not to mention all programs where Python is integrated like GIMP, all of this is Python2 only.

Enjoy your Python3. I'll stick with Python.

If you're going to build up a large code base, you don't want to have to port it when the libraries you need stop supporting Python 2.
I could have taken that attitude with Django 3 years ago, but they released a new version a week or so after I started using it. That was a simple upgrade, no problems (1.2 - 1.3). I try to stay up to date now, as it keeps many things relevant. Sometimes it causes a bit of hassle.

Now If I had stayed on 1.2, then many of the extra libraries I am using or looking at these days would not be compatible. (Now sometimes I want to use older libraries that have not been kept up to date, but the more popular packages which gain traction - the "more important ones" tend to keep up to date or replaced by ones that do).

A language is different from a framework, but I assume once enough traction is gained, then the same thing will happen with Python - popular packages will end up up on Python 3 only. There seems to be a fair bit of 'push' from the community for people to move to Python 3, with comments of "why not change already".

Python 3 will do the job, what is your argument against it?
That's not a valid reason to avoid making the switch. A big backlog of code that you can't afford to port is valid; it's a business issue. But you? This is a tool of your trade, just do the research.
"Tool of your trade": I have no use of python 3, nor do I have any use for Scala, Perl, or whatever. These could all be considered "tools of my trade".

I rarely write anything high language besides small scripts. Python 2 does the job. If I ever were to need functionality of another language, great, it's fun to learn something new. Our time is limited and we must prioritize. Sadly we cannot invest time to learn everything (well I guess it's possible, but I rather be awesome in four languages than mediocre in twenty).

It will take you an hour at most to read up on all the significant changes in Python 3. Its not like learning Scala or Perl at all. It just cuts some things that have been depreciated for years, makes everything more consistently iterable, adds some nice new comprehensions and literals, modifies certain bits of metaprogramming, and a few other smaller changes. The hardest thing for me was remembering that print is a function in 3, and needs parens.
@a1a I apologize, I was a jerk yesterday. I definitely dropped my forum manners. Not ok!

Just so you do know what the story is with python3: It's mostly a move to proper unicode support (which couldn't be done without breaking backwards compat) but it's a relatively minor change for most code. You'll definitely run into some library support issues, but they should be few and getting fewer. It shouldn't be terrible, and I'd encourage you to do it just for the sake of Guido and the python community, because this transition has been a bit of a burden for them.

> I have no use of python 3

You admit you haven't done any research, so you clearly don't have any basis for making that statement.

Nor have I done research on Perl, Scala, etc. Your missing my point. I am successfully getting my things done in Python 2. I do not have any use for Python 3, Perl, Scala, or any other language. I might have in the future, and hey, some language might be better suited to solve the problem - but as long as it's not drastically better the sensible tradeoff is to stick with Python 2.
That philosophy sounds like one that will cause you to wake up one day and realize your skill set is massively out if date.

Python 3, scala, and pearl all give you new ways of solving a problem. You're missing out on a lot of super cool stuff by not exploring! Outside of maybe library support, I see no reason to not to at least check out python 3.

Fair point. But I'd like to quote my own post above:

>I rarely write anything high language besides small scripts. Python 2 does the job. If I ever were to need

>functionality of another language, great, it's fun to learn something new. Our time is limited and we must

>prioritize. Sadly we cannot invest time to learn everything (well I guess it's possible, but I rather be

>awesome in four languages than mediocre in twenty).

I'll let you in on a secret: Python 3 is Python, just with a couple of improvements. Painting it as an entirely new language like Perl or Scala reminds me of people I used to support who thought their entire computer was different if I gave them a monitor with a different-colored rim. You're making a mountain out of a molehill.
So much for having a big toolbox with lots of different hammers available to you.
I do have a big toolbox, it contains all kinds of screwdrivers etc for low level programming. But I only need one hammer for the few problems I face that is best solved by scripting languages.
To be fair, most of the people I see with sheds with a load of tools in them don't make much and wouldn't know where to begin if they suddenly had to. It's the appearance of the thing that they love.