3 ms·
Well, another issue is that there are carrots, but they are tough to sell. I have been using Python 3 for 2 years now in production, and I would never want to
by sametmax 10y ago
Well, another issue is that there are carrots, but they are tough to sell.
I have been using Python 3 for 2 years now in production, and I would never want to go back to Python 2. Benefits include:
- less boilerplate. Automatic super(), no object inheritance, yield from, generalized unpacking, keyword only args, less itertools import, no need for __future__, f-srings, etc. Basically my code is shorter and faster to write.
- better error handling. This one is big. It is easier to get a bug free Python 3 program. You get exception nesting handling, finer file exception granularity, more safety nets (e.g: no more arbitrary object comparison), better error messages, absolute import by default, regular division by default, etc. As a trainer, Python 3 is so easier to teach.
- unicode is no just about u''. You have the "encoding" parameter everywhere by default. Everything default to "utf8" naturally. You don't need the # coding: monbo jumbo. There is no more "auto-casting" of bytes. English native speakers underestimate the value of this. As a European, it's invaluable to me, and it is to the rest of the world that is not using ASCII as their main alphabet.
Those are really, really great benefits. But terrible carrots. They don't sell. People want big shinny stickers with "+30% perf" which will never be of used for most projects. While those benefits, I guaranty, are stuff all project benefits from, and you feel them a lot once you get used to them.
- hueving 10y agoGood points, but error handling and less boilerplate are mostly moot once the code is already written, which is what makes them not great carrots for switching projects.
- sametmax 10y agoYes it's more "invest now, get the next iterations of your project in a better shape". And it's not as appealing as "invest now, get 30% speed up now".