> Originally created during the Python 2.4 days, we've tried to keep the content universal and exercises relevant, even for newer releases. As mentioned on the setup page, this material covers Python 2. While we recommend "avoiding" Python 3 for now, recognize that it is the future, as all new features are only going there.
I remember my freshman year of college, I was told how some 60% of what I learn will be out-of-date by the time I graduate. I always thought that was a ridiculous statement. But nevertheless - the prime example was Python. At the time we were being taught Python 2.7 or so, we were told how by the time we graduate - most of the world will be using Python 3.X
Since computing is a young field, that gets less true every year. I would say less than 60% of what I learned 15 years ago is out-of-date, but talking with my dad, it was a much higher percentage when he got his MS in the early 80s.
I am willing to bet that computing is a much older field than you realize. And the amount of change is much more than you're aware of.
Furthermore I do not believe that the rate of change will stop in several lifetimes.
On how old computing is, automated computing using punch cards was invented in the 1800s. "Programmer" has been a viable job title since WW II. Essays about programming written 50 years ago are still relevant today.
On how much things change, that depends on your environment. Across the hall from me there is a company of COBOL programmers. A lot of what they need to know hasn't changed since before I was born. Sitting next to me are people implementing code in node.js with react. Most of the libraries and best practices that they are trying to follow were invented in the last 10 years. I'm maintaining a legacy project that isn't using any technology less than 10 years old. The experience of how much things change is highly dependent on what exactly you are doing.
However I'm minded of what my sister said about nursing. When she started as a nurse she was told that on average half of what she knew would be out of date in 10 years. This is why nurses need continual retraining. This was ridiculous to her. But guess what? When she retired it was true, every 10 years about half of what she knew went out of date! Between new research, new technologies, new best practices and so on, nursing never stopped changing. And hasn't stopped changing since modern nursing was invented in the 1800s.
If a profession so much older than ours shows such sustained change, and our profession has shown an extended sustained rate of change, why would I expect this to change? The truth is that I don't. Sustained change is more the rule than the exception in technology, and none of the fundamental reasons why have changed.
Some knowledge is core - the ways that programmers get defensive and have trouble accepting their own bugs and mistakes has not changed since before I was born - and others change constantly. Learn the principles. Learn what is core. And be prepared to continue learning trivia forever because programming is continuing to change.
I feel like that means they were teaching from the wrong perspective. All of my cs classes were about principles, and the language was incidental, and I don't feel that the things I learned have gone out of date at all.
Edit: On a related note, I don't think python is a very good first language, despite it being my absolute favorite, because it uses kind of a mishmash of paradigms.
My university had an interesting approach to that problem - where it was necessary or useful to use real code, different classes were deliberately taught in different languages (mix of Java/ML/C/MIPS/Verilog).
What language would you say is a good first language? To me, Python seems very readable to a new programmer without having a capability/tooling ceiling that you will eventually reach, which seem to make it a decent choice.
As much as I hate to say it, probably C. Actually, I wonder if there are any toy languages out there that are basically C without raw pointers? If so I would go with that.
Yeah, for some reason Google is adamantly opposed to adopting Python 3. I have no idea why. It's clearly much better, more well designed, etc. I mean come on... print as a statement rather than a function call? That alone should be enough to make the decision I'd think.
You can begin a transition without moving everything at once, or even ever. Start with a policy that all significant new efforts should strongly consider Python 3 (including porting any dependencies). Keep a "scoreboard" for un-ported dependencies and add a point every time it's decided to keep a new project in Python 2 because porting a certain dependency would be too much work to identify the bottleneck. Invest in porting those. You should see the proportion of Python 3 to 2 go up. Eventually, you're left with a relatively small set of legacy stuff in Python 2, and that's probably fine to keep like that.
Python 2 was the norm when they adopted Python internally, but I think it's inaccurate to say that Google is "adamantly opposed" to Python. They've done a good job in making their most popular open-source projects 3.x compatible, such as Tensorflow: https://github.com/tensorflow/tensorflow/issues/1
I think the problem is that Python 3 is a different enough language that it's hard to consider it an upgrade, adapting existing code to it really is a port (although six and __future__ help).
And if you're going to port, it's not a question 2 vs 3, it's a question of 3 versus many other languages, chiefly Go.
Python 3 has some architectural decisions that make working with data difficult; mostly ///my opinion/// is that it completely botched Unicode handling.
The idea of data being encoded should be an extremely high level idea, with foundations that are supported by the internal libraries and maybe even compiler.
I feel that golang has a much more data-structure friendly view of Unicode.
* The ancient paradigm of bytes remains
* Strings are immutable sequences of bytes; but are trivial to cast back and forth.
* 'runes' (distinct Unicode code points) also exist
However to actually validate or do anything fancy to a Unicode sequence a programmer would need libraries from https://godoc.org/golang.org/x/text which shows how truly complex /proper/ handling of Unicode data is; instead of just the simple copy / append / search (is this inside of / a match to it) operations that make up 99% of my handling of Unicode data.
Have you worked in Python 2 unicode?? Over half of the work and debugging the search engine service management team I was on was fixing unicode document injesting.
But I agree, making unicode part of the language is very dumb. I just wish they would give up as it has never been good.
It optimized for O(1) indexing to Unicode scalar values instead of optimizing for more useful things. Also, even though the API semantics are UTF-32, the storage may be USC-2 or Latin-1, so there's a surprise performance effect when a string gets it first non-Latin-1 character or its first non-BMP character. So much for O(1) behavior.
The best in-memory representation of Unicode is UTF-8. No alignment issues, ingest "decode" is mere validation and output "encode" step is a no-op. Space requirements are favorable to common computer language syntaxes. Byte-wise lexical sort matches code point-wise lexical sort.
However, since "narrow builds" of Python 2 already used UTF-16 which allowed for things like bridging strings with Cocoa, Python would have done well to stick to UTF-16 and get rid of the "wide builds".
Not having both "narrow" (UTF-16, Python 2 on Mac) and "wide" (UTF-32, Python 2 on Debian) is an improvement, though.
I don't think it has to be anything more than inertia. They're a massive company that has millions of lines code running in production for a whole chunk of languages. Making a change from python2 to python3 probably seems like more worth than it's worth. It is also a fairly googley problem to think that the way Google does things is automatically superior in all cases. So, since googlers use py2, why shouldn't it be good enough for everyone else?
Dropbox, which is a much smaller company and codebase than Google, is (as far as I've heard) still on Python 2, despite having hired Guido van Rossum away from Google to work on static type annotations for Python to fix all the str/bytes stuff and related incompatibilities in their codebase so that they can move. Certainly this was the status in mid-2016, about four years after they hired van Rossum: https://us.pycon.org/2016/schedule/presentation/2266/
The difficult engineering problems in the world aren't greenfield engineering.
I don't think this is true, as a python user at Google. There's momentum that has to be shifted, and that can't happen overnight. But it is absolutely a work in progress.
The writing is on the wall for py2 at Google, and in some ways it has been for years.
It's hard to understand that they could think Python 2 to be the valid choice for this, as though Python 3 was "the future" and things are heading there.
Python 3 is the present, we are there, Python 2 is the past and in 2 short years it will be unsupported and whatever you learned from this resource will need to be re-learned for Python 3 pretty damn quick.
Likely explanation: Not updated in a while and mostly meant for internal use, where developers will mostly interact with Google's legacy systems. I'd also take a guess here and suspect that Google might have a larger than usual share of 2/3 incompatible code (binary-text-boundaries are notorious).
That certainly appears to be the perception they've created with many. I don't see it that way entirely, because it seems like any programmer using Python will have to come face to face with the intricacies of how Python 2 and 3 differ. If they write all their projects in Python 3 they may never feel comfortable approaching legacy codebases, but if they start off in Python 2 they're going to be peer pressured into learning 3 as well, and get experience with what goes into porting from one to the other - I'd consider that an invaluable lesson.
If you're learning a programming language, your decision about which language to learn should not be driven by whether or not the language is preinstalled and you need to go to the trouble of installing one piece of software.
"I decided to become a Prolog programmer because it was the only thing installed on my machine."
I disagree. 5 mins of work to install a new programming language impacts so much of what you do with that language and how you would deploy it in production environment. As the GP says - Python 3 is the future.
Last time I tried to install python3 and pip on a Mac without root, I tried following 2 guides from the internet, both gave weird errors, and I gave up.
My "give up" was just install as root, system wide, but that's only because I have root access to my machine.
> and how you would deploy it in production environment
We're talking about learning a new language, not deploying to production.
> By this logic, we should be using IE on Windows.
No, that's not what anybody said. This is about learning languages, not even using them. Using a language is different from learning a language in so many ways they aren't even comparable.
Millions of people could be learning a language for millions of reasons. Simple portability is useful - knowing a language that is preinstalled on a huge portion of computers worldwide has massive advantages for a huge number of people who are learning new languages today.
Dismissing the values that others might place in how they learn a language is being close-minded. There are lots of reasons to learn to program, and learning based on the language available to you first and most readily is certainly a reasonable approach.
I don't see anything wrong with that logic. It's not like I'm going to be using code that I wrote while learning in the future. And it's not like learning Prolog (or Python 2) will make me unable to learn other languages in the future.
Of course it should! That's how I got started programming 17 years ago. I never would have started programming if the first thing was to find a language and pick it. I absolutely started programming because there was a language there.
(In this case, it's both javascript and c, on linux, and VBA on Windows. I use none of those today but that doesn't matter!)
Python 3 has has become prevalent in usage around 2013-2014. I don't know anyone who is starting a Python 2 project as of now. In terms of library support, as of 2018 you get more library support on Python 3 [1]. Some new libraries coming out may still support Python 2, but many are Python 3 only. For example the latest Tensorflow is Python 3 only if you want to install it on Windows[2] and Django back in 2017 has completely removed Python 2 support [3]
>Python 3 has has become prevalent in usage around 2013-2014.
Citation needed. Back then it was at best at 20%, and even today it's not much more (source: PYPY download statistics breakdown).
>I don't know anyone who is starting a Python 2 project as of now.
I know several. Any company with lots of Python 2 projects that are not going anywhere soon (Google is one of them), is probably also starting new Python 2 projects alongside them, they won't add 2 different versions to cater to.
> Any company with lots of Python 2 projects that are not going anywhere soon (Google is one of them), is probably also starting new Python 2 projects alongside them, they won't add 2 different versions to cater to.
Citation needed.
Edit: Oh and Tensorflow for Windows is made by Google and it's Python 3.5 or higher.
> Is there something useful that's only in Python 3?
Most of the big libraries have supported both 2 and 3 for a while; that's changing soon, and not because Python 3 is dying.
IPython dropped Py 2 support in 6.x.
Django dropped support for Py 2 with Django 2.0.
Numpy drops new feature support for Python 2 at the end of this year (but will continue bugfixes for that last Py2-supporting feature release past that point), and all support for Python 2 at the end of next.
SciPy, similarly, has announced it will drop Python 2 support by 2020.
And lots of other libraries have sunsetted or announced plans to sunset Py 2 support quite soon.
Also—and a big driver—is that the Python Software Foundation has announced it will drop support for Python 2 in 2020.
Numpy drops new feature support for Python 2 at the end of this year (but will continue bugfixes for that last Py2-supporting feature release past that point), and all support for Python 2 at the end of next.
>SciPy, similarly, has announced it will drop Python 2 support by 2020.
And there's the reason I needed to convert, thank you.
It's Google deciding to publish their formerly internal documentation as a public service. If they're using Python 2 internally, of course their internal documentation is going to be on Python 2. Releasing it is purely positive.
Still, if you need to search for today's reason to switch to DuckDuckGo, I guess Google releasing a free class for the wrong version of Python is as good as any.
If you are releasing a free Python class under the Google brand, but the content is almost a decade old[1] and a lot of it will be phased out shortly or unsupported in 2 short years, you are doing the community a dis-service.
Stop assuming freebie is always good stuff or Google always release high quality content.
Disclaimer: I am a long time python developer and I love Google's service in general.
> If you are releasing a free Python class under the Google brand, but the content is almost a decade old[1] and a lot of it will be phased out shortly or unsupported in 2 short years, you are doing the community a dis-service.
Companies use things that are "out of date" due to various factors. You could shit on a "IBM's COBOL Class" because COBOL is old as shit, but it doesn't change the fact that there is a lot of COBOL out in the world, and a need for folks to learn it so that they may maintain or migrate it.
Just because Python 3 is the shiny new version and the future of the language doesn't change that there is going to be a lot of Python 2 out there and folks will need to learn and understand it.
A better analogy would be IBM releasing a tutorial for an unsupported version of COBOL and calling it a tutorial for "modern" COBOL.
In a nutshell, it's not about Python 2 being old, it's about calling Python 2 "Python" when that hasn't been the case for a few years now at the least.
> A better analogy would be IBM releasing a tutorial for an unsupported version of COBOL and calling it a tutorial for "modern" COBOL.
Well, no, they've made no comparable claim.
From skimming the material, not only does Google not refer to Python as "modern" but provide the caveat
> For Google's Python Class, it's best to use Python 2.7. Although Python 3.x is becoming more popular, this course is designed for Python 2.6 or later.
I suppose to some folks they should provide a disclaimer with road flares warning of Danger Ahead, but it's not as if they're intentionally misleading.
> Unless the reader is aware of the state of Python 2 vs. 3, he/she wouldn't even bat an eye.
If I were looking at learning Python and read that line I'd stop and dig a little deeper.
I hate on Google as much as the next neo-Luddite, but they're putting out quality material on a topic that some folks will need. Y'all are pretty damn hateful.
Python is the #1 fastest growing programming language on Stackoverflow.[1] and #4 on TIOBE index[2]. There is a huge need for good and current python tutorials and/or online classes for the growing community. I applaud the intent for Google to contribute.
BUT if your content is not current or not up to the bar, perhaps you shouldn't even consider releasing it? Google internally has a lot of Python 2 code no doubt, but for the beginners that want to learn python, Google's python class is not even on par with the expectation out there.
COBOL doesn't even make it to the top 25 on TIOBE index, so your comparison doesn't matter. Who wants to learn COBOL these days if they weren't mandated by the job or for teaching?
>Just because Python 3 is the shiny new version and the future of the language doesn't change that there is going to be a lot of Python 2 out there and folks will need to learn and understand it.
1) Teaching beginners' Python 2 , the motives are suspicious -- especially considering Googles' use of Python 2 internally.
It's not entirely noble to train beginners' to familiarize themselves on languages that are on their way out just so that they can maintain your legacy code once they get some experience. It's profit maximizing, speaks to their thought-process behind the employees' career, and points towards a culture that's uninterested in internal improvement when things work to turn a profit.
2) Python 2 is not Python, it's Python 2. Programming tutorials for "Python" muddy the search-query waters and make it difficult for beginners to find specific information. This happened to the Lisps, and it's a big barrier to entry for beginners to the language(s).
3) Python 2 can be easily understood by Python 3 users. In fact, it's often more verbose and easier to wrap your head around than Python 3, and the syntactic differences are minor unless you're using advanced features.
I'm sure Google is just releasing internal stuff that's been around for years -- I just think its' disingenuous to refer to what they teach as 'Python'.
Yeah; it's Python if you're a googler; it's python 2 to the rest of the world -- and it's on the way out.
P.S. if my company sent me to a seminar on COBOL, i'd be well aware of the position they expected of me -- and i'd have one foot out the door.
> I just think its' disingenuous to refer to what they teach as 'Python'.
Well what do you propose we call it? Cobra? It's still Python, just not the latest version.
> P.S. if my company sent me to a seminar on COBOL, i'd be well aware of the position they expected of me -- and i'd have one foot out the door.
To be frank, you sound like a prima donna. Part of software engineering is maintenance and migration. If my company sent me out to learn COBOL I'd be happy for an interesting challenge that I'd not normally be exposed to.
> Programming tutorials for "Python" muddy the search-query waters and make it difficult for beginners to find specific information.
Yeah, very true. Finding latest programming courses and tutorials is a pain on Google Search. We are making Hackr.io as a better alternative for online programming tutorial search. For Python: https://hackr.io/tutorials/learn-python
I don't understand what the big deal is. If you learn Python 2, you're 95% of the way to Python 3. Honestly, this is like arguing over spaces and tabs. It gets old.
> Welcome to Google's Python Class -- this is a free class for people with a little bit of programming experience who want to learn Python.
Python 2 still comes pre-installed on most everything. So, why can't someone coming to Python with little or no experience just be welcomed to use what they have for now?
I kid you not, some of these Python3'ers would have a newb bike shed for a week getting a whole Python 3 workflow with virtual environments, etc going before they'd let the person write their first hello, world. They can learn that stuff later, when it matters.
>> So, why can't someone coming to Python with little or no experience just be welcomed to use what they have for now?
So, why can't someone coming to Python with little or no experience just install the latest version?
Just shedding some light on both sides of the argument. I'd prefer people starting out use the latest version because it is not hard to install Python 3 and takes very little effort.
You're not really countering what he said by naming something in the 5%. Yes, there's slightly different string behavior when working with unicode, most things return iterators instead of lists, and print is now a function.
Going from knowing Python 2 to 3 is far easier than going from not knowing Python or programming at all to knowing Python 3.
Why the recommendation for Learn Python 3 The Hard Way? Not only the author was against Python 3 for the longest time (but his Python 2 stuff would be outdated, so less money, right?), his persona was controversial at best here in HN. Don't support Zed Shaw or Terry Goodkind[1], folks.
Instead I suggest Real Python[2], which is extensive but to the point, or Automate the Boring Stuff[3], that also has practical examples and free.
>> Why the recommendation for Learn Python 3 The Hard Way?
Specifically because even Zed Shaw - probably the most vocal and longest time objector to Python3 has moved on from recommending against Python 3. Thus now that he supports Python 3 then I think he should be supported - history is past.
Everyone with a significant industry presence has moved on from recommending against Python 3 - except Google.
> Everyone with a significant industry presence has moved on from recommending against Python 3 - except Google.
Do you have any source confirming that Google is recommending Python 2 as of 2018? Because e.g. the current installation instructions for Tensorflow recommend Python 3.5 or 3.6: https://www.tensorflow.org/install/install_windows
I've never heard of Goodkind before but this particular issue doesn't seem worth any ire. Apparently they didn't like the cover for their book, they made a joke and then apologized. They clarified that the art direction was the problem and not the composition itself.
I wouldn't recommend Shaw's stuff to anyone, but being Python 3 opponent for a long time doesn't seem like a solid point. Armin Ronacher was hating on unicode in Python 3 and writing stuff in Python 2 only long after Python 3 has "won", doesn't make him a bad programmer and such.
While he may not be a "bad programmer", it concerns some folks that people are so against moving forward to something the industry is in strong support of. I wonder what other kinds of singular opinions (or very minority at best) that could be affecting other aspects of his programming.
Not really on topic but thought it interesting to see a resource from my alma mater linked here. Do you work with Dr. Patterson or did that randomly come up?
The notion that the Python core devs get to decide when Python 2 should stop being used is not cool.
Under the freedoms provided by Free Software licensing, users who have a need to continue to use Python 2 should be able pool their effort to continue to support Python 2.
There was an effort called Python 2.8 to do this, but the Python Software Foundation made it change its name and I don't recall what the new name is. It's not particularly nice that the thing that's compatible with what was called Python to begin with is the one that got renamed.
This feels kind of entitled, to be honest. The core devs don't owe you indefinite support for your chosen version. Absolutely they get to decide when they want to stop supporting it (and they already gave it a ridiculously extended support lifetime!).
The PSF also owns the "Python" trademark and the whole purpose of trademarks is to prevent confusion about who made something, i.e. exactly the kind of confusion a Python 2.8 that isn't made by the same people who made Python 2.7 would have caused.
Entitled to the name perhaps, but _not_ entitled to indefinite support by the core devs.
> The core devs don't owe you indefinite support for your chosen version. Absolutely they get to decide when they want to stop supporting it (and they already gave it a ridiculously extended support lifetime!).
I agree! I said the users of Python 2 should be able to pool effort to continue to support Python 2.
Yet, there is a lot of sentiment in this thread that whether Python 2 should continue to be used should be tied to whether the Python core devs are still supporting it. Similarly, there is widespread sentiment that e.g. Linux distros should drop Python 2 and packaging Tauthon in its place doesn't even make it to the agenda.
> The PSF also owns the "Python" trademark and the whole purpose of trademarks is to prevent confusion about who made something, i.e. exactly the kind of confusion a Python 2.8 that isn't made by the same people who made Python 2.7 would have caused.
I'm well aware that the PSF is legally entitled to exclude Tauthon from being called Python 2.8. It's still not particularly nice towards the users of the language who bet on Python 2 and who'd benefit from easy discovery of Tauthon.
Imagine if Stroustrup had gone on to develop the language that's in reality called D but insisted that it be called C++ and the language everyone else knows as C++ be renamed if developed further in a backward-compatible way.
Once there is no longer a Python 2.x by the Python core devs to confuse Tauthon with, it's arguably more confusing for Python 2 and Python 3 to share a name but Python 2.x and Tauthon not to. (For clarity, the previous sentence is not a legal argument. I'm well aware that the public who could be confused about names doesn't have standing under trademark law.)
> The notion that the Python core devs get to decide when Python 2 should stop being used is not cool.
They don't. They just won't support it anymore, nor provide updates for it.
> Under the freedoms provided by Free Software licensing, users who have a need to continue to use Python 2 should be able pool their effort to continue to support Python 2.
They can, just not under the name of Python, as this name is owned by the Python Software Foundation. Similarly Canonical would crack down on someone opening a project 'Ubuntu12', continuing to support Ubuntu 12.x versions.
> There was an effort called Python 2.8 to do this, but the Python Software Foundation made it change its name and I don't recall what the new name is.
And the people who decided to do this are well within their rights to do so - it is free software after all. Just - as explained in the last paragraph - not with the name Python.
This isn't only to prevent the brand 'Python' to be influenced by a project out of the reach of the foundation, but also to prevent confusion for newcomers.
You seem to not understand how the freedoms of Free Software licensing work.
You are absolutely able to go clone their git repo right now (https://github.com/python/cpython) and work on it as your own. You can create updates, backport fixes, etc. You can maintain that well after they cease supporting python 2.7.
You may not call it Python though, because of trademarks.
> The notion that the Python core devs get to decide when Python 2 should stop being used is not cool.
Many major libraries have already released their last version supporting Python 2 or announced plans to do so by the end of this year, several have already released the first major version that does not support Python 2.
Core decision that Python 2 wouldn't be supported past 2020 played a role in timing, but isn't the decisive factor in why Py 2 is being dropped: many of the projects specifically said Py 2 was holding them back.
> Under the freedoms provided by Free Software licensing, users who have a need to continue to use Python 2 should be able pool their effort to continue to support Python 2.
They are free to do so.
> There was an effort called Python 2.8 to do this, but the Python Software Foundation made it change its name and I don't recall what the new name is.
Tauthon, I think, is the project you are referring to.
> It's not particularly nice that the thing that's compatible with what was called Python to begin with is the one that got renamed.
Free Software principles don't make names public domain; you don't get to steal a project’s name because you object to major release.
> The notion that the Python core devs get to decide when Python 2 should stop being used is not cool.
This is incorrect. They get to decide when they stop supporting it. Of course that's within their rights, and a 2020 sunset date on a version released in 2010 is a very long LTS window.
> It's not particularly nice that the thing that's compatible with what was called Python to begin with is the one that got renamed.
This is how copyright works. Someone else is free to release a MyPython 2.8 if they'd like, but they're not free to call it Python.
Unless you discover an internal bug in Python 2 in which case it will never be fixed. Depending on the source of the bug, your options then become: (1) maintain your own patched version, (2) upgrade Python to a version where it is fixed, or (3) use something else. I would personally choose #2.
Except the community really can't and live to tell anyone about it (aside from a fringe fork), because the Python Foundation won't let them use the Python name for the fork, even though a fork is in every other way open source and labeled for maintenance purposes only.
Anyone who's every ported a very large project from 2 to 3 might end up despising the PSF for this purpose and might tend to search for a new language (Nim? Go? JS? Scala?
Ruby?!). So much for the B in BDFL..
>Except the community really can't and live to tell anyone about it (aside from a fringe fork), because the Python Foundation won't let them use the Python name for the fork
Yeah, but a name like "Cobra, a fork of Python 2.7" will do just as well, and everyone that cares enough will know what it is and where to find it.
The lack of core maintenance isn't meaningless (it's true someone else could step in, but it's not clear they will in any substantial way.)
More importantly, the fact that major libraries are dropping Python 2 support is not meaningless. (Again, I suppose, it's possible that people could fork IPython, NumPy, Django, etc., from the last Py 2 supporting version and extend support, but that seems even less likely than the core language getting solid support by way of a community fork.)
You do know this resource was published circa 2010, right? It's not a new course, and back then Python 3 wasn't anything.
Also, you should note that most systems that come with python pre-installed still come with 2.x, so the last update to this (March 2016) could have been accommodating that fact.
I watched the original Nick Parlante videos that this material is based off 7 years ago, and recommend it to anybody that thinks they need to learn programming.
I took a couple C classes in college that were geared for people who already knew how to program and hated it. Never wanted to think about it again.
Those videos helped abstract a lot of the low level muck away and build real stuff. Once I was able to understand some of these concepts and why you would actually use them I could go back and learn all the things that were too deep in the weeds to understand.
Its a bit dated now but still some of the best training videos I've seen.
This changed my life. In 2010 I downloaded all the videos, and learned python as I was riding home on the bus. By the end of the year I was scripting stuff at work, within 4 years I had a new job as a full time developer.
Sure it's mostly outdated, but it really clicked for me. Nick Parlante does a great job, and his codingbat.com was the perfect step 2.
No, None of the other ones were really as good at the time. I haven't checked in a while. Going to my local PUG is what really helped me get to the next level.
By introducing me to new libraries, and ways of doing things. Really just being able to talk about Python, and programming/computers in general in a social atmosphere made it feel like more than just a hobby or something i was doing for my job.
I like that they are continuing to share resources and education. Google has also collaborated on a myriad of courses on Udacity. If you check the course catalog and search for "Google", there are 62 results for "IN COLLABORATION WITH: Google". They run the gamut from Android development to web development to Google APIs to Design to Business Development to ....
It's an interesting mix of empowering the learner and getting the learner to use Google products (e.g. you finally make that Android app, you learn how to iterate development, gain traction with users, grow). I wonder to what extent learning from the resources can bring up to parity with a Google developer.
I read this as an OO class that access Google's API. Given the overloading of the term, a better title might be 'Learn Python with Google' or some such.
Anyone ever searched a flag for a python library and been swept away into some weird gamified recruitment test?
Some years ago in a googs search box i searched for some flag for 'python3 itertools' and googs immediately took me to a subdomain saying, 'does this sort of thing interest you? This is the kind of work we do here at the goog.' then something to the effect of enter your email and answer some obscure python question
Out of curiosity I answered the first few questions but after about four I was more bothered than intrigued and closed the tab and redid the search and this time googs gave me the results I was looking for
127 comments
[ 3.1 ms ] story [ 141 ms ] thread> Originally created during the Python 2.4 days, we've tried to keep the content universal and exercises relevant, even for newer releases. As mentioned on the setup page, this material covers Python 2. While we recommend "avoiding" Python 3 for now, recognize that it is the future, as all new features are only going there.
Furthermore I do not believe that the rate of change will stop in several lifetimes.
On how old computing is, automated computing using punch cards was invented in the 1800s. "Programmer" has been a viable job title since WW II. Essays about programming written 50 years ago are still relevant today.
On how much things change, that depends on your environment. Across the hall from me there is a company of COBOL programmers. A lot of what they need to know hasn't changed since before I was born. Sitting next to me are people implementing code in node.js with react. Most of the libraries and best practices that they are trying to follow were invented in the last 10 years. I'm maintaining a legacy project that isn't using any technology less than 10 years old. The experience of how much things change is highly dependent on what exactly you are doing.
However I'm minded of what my sister said about nursing. When she started as a nurse she was told that on average half of what she knew would be out of date in 10 years. This is why nurses need continual retraining. This was ridiculous to her. But guess what? When she retired it was true, every 10 years about half of what she knew went out of date! Between new research, new technologies, new best practices and so on, nursing never stopped changing. And hasn't stopped changing since modern nursing was invented in the 1800s.
If a profession so much older than ours shows such sustained change, and our profession has shown an extended sustained rate of change, why would I expect this to change? The truth is that I don't. Sustained change is more the rule than the exception in technology, and none of the fundamental reasons why have changed.
Some knowledge is core - the ways that programmers get defensive and have trouble accepting their own bugs and mistakes has not changed since before I was born - and others change constantly. Learn the principles. Learn what is core. And be prepared to continue learning trivia forever because programming is continuing to change.
Edit: On a related note, I don't think python is a very good first language, despite it being my absolute favorite, because it uses kind of a mishmash of paradigms.
What language would you say is a good first language? To me, Python seems very readable to a new programmer without having a capability/tooling ceiling that you will eventually reach, which seem to make it a decent choice.
And if you're going to port, it's not a question 2 vs 3, it's a question of 3 versus many other languages, chiefly Go.
The idea of data being encoded should be an extremely high level idea, with foundations that are supported by the internal libraries and maybe even compiler.
I feel that golang has a much more data-structure friendly view of Unicode.
However to actually validate or do anything fancy to a Unicode sequence a programmer would need libraries from https://godoc.org/golang.org/x/text which shows how truly complex /proper/ handling of Unicode data is; instead of just the simple copy / append / search (is this inside of / a match to it) operations that make up 99% of my handling of Unicode data.But I agree, making unicode part of the language is very dumb. I just wish they would give up as it has never been good.
The best in-memory representation of Unicode is UTF-8. No alignment issues, ingest "decode" is mere validation and output "encode" step is a no-op. Space requirements are favorable to common computer language syntaxes. Byte-wise lexical sort matches code point-wise lexical sort.
However, since "narrow builds" of Python 2 already used UTF-16 which allowed for things like bridging strings with Cocoa, Python would have done well to stick to UTF-16 and get rid of the "wide builds".
Not having both "narrow" (UTF-16, Python 2 on Mac) and "wide" (UTF-32, Python 2 on Debian) is an improvement, though.
The difficult engineering problems in the world aren't greenfield engineering.
I seriously cannot tell if this is a joke or not.
The writing is on the wall for py2 at Google, and in some ways it has been for years.
Python 3 is the present, we are there, Python 2 is the past and in 2 short years it will be unsupported and whatever you learned from this resource will need to be re-learned for Python 3 pretty damn quick.
Recommendation to those learning Python: avoid this Google resource and instead use Zed Shaw's "Learn Python 3 The Hard Way" https://learnpythonthehardway.org/python3/
Or you could do things Google's way and then follow up with learning how to use DOS http://people.uncw.edu/pattersone/121/labs/L1_MSDOS_Primer.p... because I believe things are heading that way.
"I decided to become a Prolog programmer because it was the only thing installed on my machine."
By this logic, we should be using IE on Windows.
But, if you know nothing about the web and are just learning, and you've got a Windows machine, sure, use IE (or Edge, if it's Windows 10.)
Just like if you are starting from zero programming, and self-teaching, sure, use whatever is available in the base install of your OS.
My "give up" was just install as root, system wide, but that's only because I have root access to my machine.
We're talking about learning a new language, not deploying to production.
> By this logic, we should be using IE on Windows.
No, that's not what anybody said. This is about learning languages, not even using them. Using a language is different from learning a language in so many ways they aren't even comparable.
Millions of people could be learning a language for millions of reasons. Simple portability is useful - knowing a language that is preinstalled on a huge portion of computers worldwide has massive advantages for a huge number of people who are learning new languages today.
Dismissing the values that others might place in how they learn a language is being close-minded. There are lots of reasons to learn to program, and learning based on the language available to you first and most readily is certainly a reasonable approach.
(In this case, it's both javascript and c, on linux, and VBA on Windows. I use none of those today but that doesn't matter!)
if only..
Is there something useful that's only in Python 3?
[1] https://python3wos.appspot.com/
[2] https://www.tensorflow.org/install/install_windows
[3] https://docs.djangoproject.com/en/2.0/releases/2.0/
Citation needed. Back then it was at best at 20%, and even today it's not much more (source: PYPY download statistics breakdown).
>I don't know anyone who is starting a Python 2 project as of now.
I know several. Any company with lots of Python 2 projects that are not going anywhere soon (Google is one of them), is probably also starting new Python 2 projects alongside them, they won't add 2 different versions to cater to.
Citation needed.
Edit: Oh and Tensorflow for Windows is made by Google and it's Python 3.5 or higher.
Most of the big libraries have supported both 2 and 3 for a while; that's changing soon, and not because Python 3 is dying.
IPython dropped Py 2 support in 6.x.
Django dropped support for Py 2 with Django 2.0.
Numpy drops new feature support for Python 2 at the end of this year (but will continue bugfixes for that last Py2-supporting feature release past that point), and all support for Python 2 at the end of next.
SciPy, similarly, has announced it will drop Python 2 support by 2020.
And lots of other libraries have sunsetted or announced plans to sunset Py 2 support quite soon.
Also—and a big driver—is that the Python Software Foundation has announced it will drop support for Python 2 in 2020.
>SciPy, similarly, has announced it will drop Python 2 support by 2020.
And there's the reason I needed to convert, thank you.
Still, if you need to search for today's reason to switch to DuckDuckGo, I guess Google releasing a free class for the wrong version of Python is as good as any.
If you are releasing a free Python class under the Google brand, but the content is almost a decade old[1] and a lot of it will be phased out shortly or unsupported in 2 short years, you are doing the community a dis-service.
Stop assuming freebie is always good stuff or Google always release high quality content.
Disclaimer: I am a long time python developer and I love Google's service in general.
[1] https://www.python.org/download/releases/3.0/
Companies use things that are "out of date" due to various factors. You could shit on a "IBM's COBOL Class" because COBOL is old as shit, but it doesn't change the fact that there is a lot of COBOL out in the world, and a need for folks to learn it so that they may maintain or migrate it.
Just because Python 3 is the shiny new version and the future of the language doesn't change that there is going to be a lot of Python 2 out there and folks will need to learn and understand it.
In a nutshell, it's not about Python 2 being old, it's about calling Python 2 "Python" when that hasn't been the case for a few years now at the least.
Well, no, they've made no comparable claim.
From skimming the material, not only does Google not refer to Python as "modern" but provide the caveat
> For Google's Python Class, it's best to use Python 2.7. Although Python 3.x is becoming more popular, this course is designed for Python 2.6 or later.
I suppose to some folks they should provide a disclaimer with road flares warning of Danger Ahead, but it's not as if they're intentionally misleading.
"Becoming more popular" should instead be "will be the only supported version of Python from 2020 onwards".
Unless the reader is aware of the state of Python 2 vs. 3, he/she wouldn't even bat an eye.
If I were looking at learning Python and read that line I'd stop and dig a little deeper.
I hate on Google as much as the next neo-Luddite, but they're putting out quality material on a topic that some folks will need. Y'all are pretty damn hateful.
COBOL doesn't even make it to the top 25 on TIOBE index, so your comparison doesn't matter. Who wants to learn COBOL these days if they weren't mandated by the job or for teaching?
[1]: https://stackoverflow.blog/2017/09/06/incredible-growth-pyth...
[2]: https://www.tiobe.com/tiobe-index/
1) Teaching beginners' Python 2 , the motives are suspicious -- especially considering Googles' use of Python 2 internally.
It's not entirely noble to train beginners' to familiarize themselves on languages that are on their way out just so that they can maintain your legacy code once they get some experience. It's profit maximizing, speaks to their thought-process behind the employees' career, and points towards a culture that's uninterested in internal improvement when things work to turn a profit.
2) Python 2 is not Python, it's Python 2. Programming tutorials for "Python" muddy the search-query waters and make it difficult for beginners to find specific information. This happened to the Lisps, and it's a big barrier to entry for beginners to the language(s).
3) Python 2 can be easily understood by Python 3 users. In fact, it's often more verbose and easier to wrap your head around than Python 3, and the syntactic differences are minor unless you're using advanced features.
I'm sure Google is just releasing internal stuff that's been around for years -- I just think its' disingenuous to refer to what they teach as 'Python'.
Yeah; it's Python if you're a googler; it's python 2 to the rest of the world -- and it's on the way out.
P.S. if my company sent me to a seminar on COBOL, i'd be well aware of the position they expected of me -- and i'd have one foot out the door.
Well what do you propose we call it? Cobra? It's still Python, just not the latest version.
> P.S. if my company sent me to a seminar on COBOL, i'd be well aware of the position they expected of me -- and i'd have one foot out the door.
To be frank, you sound like a prima donna. Part of software engineering is maintenance and migration. If my company sent me out to learn COBOL I'd be happy for an interesting challenge that I'd not normally be exposed to.
Yeah, very true. Finding latest programming courses and tutorials is a pain on Google Search. We are making Hackr.io as a better alternative for online programming tutorial search. For Python: https://hackr.io/tutorials/learn-python
Python 2 still comes pre-installed on most everything. So, why can't someone coming to Python with little or no experience just be welcomed to use what they have for now?
I kid you not, some of these Python3'ers would have a newb bike shed for a week getting a whole Python 3 workflow with virtual environments, etc going before they'd let the person write their first hello, world. They can learn that stuff later, when it matters.
So, why can't someone coming to Python with little or no experience just install the latest version?
Just shedding some light on both sides of the argument. I'd prefer people starting out use the latest version because it is not hard to install Python 3 and takes very little effort.
Going from knowing Python 2 to 3 is far easier than going from not knowing Python or programming at all to knowing Python 3.
Is it that it is more consistent in places?
No more long type
Division that works as expected
Annotations
No more xrange, iteritems etc, instead you get iterators everywhere
f-strings
Less duplicates (xrange vs range, itemview/iteritems/items(), map/itertols.map,).
Entering french in comments will not crash the program even if you didn't give "the unicode talk". Clear type for raw bytes with a proper name.
Way less verbose (no __future__, no u, no object, no codecs import, f-strings, simple super(), etc)
Debugging is easier (debug messages are better, exception chaining, division makes sense, repr is clearer)
You can't shoot yourself in the foot as much (ordering "1" and 1, assigning to True ...)
Less stuff to learn (e.g: pathlib instead of os/shutils/glob/codecs)
And that's just out of my head.
Instead I suggest Real Python[2], which is extensive but to the point, or Automate the Boring Stuff[3], that also has practical examples and free.
[1] https://www.theguardian.com/books/2018/feb/26/terry-goodkind...
[2] https://realpython.com/
[3] http://automatetheboringstuff.com/chapter0/
Specifically because even Zed Shaw - probably the most vocal and longest time objector to Python3 has moved on from recommending against Python 3. Thus now that he supports Python 3 then I think he should be supported - history is past.
Everyone with a significant industry presence has moved on from recommending against Python 3 - except Google.
Do you have any source confirming that Google is recommending Python 2 as of 2018? Because e.g. the current installation instructions for Tensorflow recommend Python 3.5 or 3.6: https://www.tensorflow.org/install/install_windows
https://io9.gizmodo.com/fantasy-writer-terry-goodkind-now-cl...
Edit: direct link https://www.facebook.com/terrygoodkind/videos/10155080253756...
Under the freedoms provided by Free Software licensing, users who have a need to continue to use Python 2 should be able pool their effort to continue to support Python 2.
There was an effort called Python 2.8 to do this, but the Python Software Foundation made it change its name and I don't recall what the new name is. It's not particularly nice that the thing that's compatible with what was called Python to begin with is the one that got renamed.
Not cool, and not true either.
Python dev team get to decide - have already decided - when they stop supporting Python 2.
Anyone can just it as long as they want, but, of course, without official support.
I'm quite happy that some other people were discouraged from misappropriating the name Python 2.8, as that way much confusion lies.
The PSF also owns the "Python" trademark and the whole purpose of trademarks is to prevent confusion about who made something, i.e. exactly the kind of confusion a Python 2.8 that isn't made by the same people who made Python 2.7 would have caused.
The new name, for what it's worth, is Tauthon: https://github.com/naftaliharris/tauthon
Entitled to the name perhaps, but _not_ entitled to indefinite support by the core devs.
> The core devs don't owe you indefinite support for your chosen version. Absolutely they get to decide when they want to stop supporting it (and they already gave it a ridiculously extended support lifetime!).
I agree! I said the users of Python 2 should be able to pool effort to continue to support Python 2.
Yet, there is a lot of sentiment in this thread that whether Python 2 should continue to be used should be tied to whether the Python core devs are still supporting it. Similarly, there is widespread sentiment that e.g. Linux distros should drop Python 2 and packaging Tauthon in its place doesn't even make it to the agenda.
> The PSF also owns the "Python" trademark and the whole purpose of trademarks is to prevent confusion about who made something, i.e. exactly the kind of confusion a Python 2.8 that isn't made by the same people who made Python 2.7 would have caused.
I'm well aware that the PSF is legally entitled to exclude Tauthon from being called Python 2.8. It's still not particularly nice towards the users of the language who bet on Python 2 and who'd benefit from easy discovery of Tauthon.
Imagine if Stroustrup had gone on to develop the language that's in reality called D but insisted that it be called C++ and the language everyone else knows as C++ be renamed if developed further in a backward-compatible way.
Once there is no longer a Python 2.x by the Python core devs to confuse Tauthon with, it's arguably more confusing for Python 2 and Python 3 to share a name but Python 2.x and Tauthon not to. (For clarity, the previous sentence is not a legal argument. I'm well aware that the public who could be confused about names doesn't have standing under trademark law.)
> The new name, for what it's worth, is Tauthon: https://github.com/naftaliharris/tauthon
Thanks.
> The notion that the Python core devs get to decide when Python 2 should stop being used is not cool.
They don't. They just won't support it anymore, nor provide updates for it.
> Under the freedoms provided by Free Software licensing, users who have a need to continue to use Python 2 should be able pool their effort to continue to support Python 2.
They can, just not under the name of Python, as this name is owned by the Python Software Foundation. Similarly Canonical would crack down on someone opening a project 'Ubuntu12', continuing to support Ubuntu 12.x versions.
> There was an effort called Python 2.8 to do this, but the Python Software Foundation made it change its name and I don't recall what the new name is.
And the people who decided to do this are well within their rights to do so - it is free software after all. Just - as explained in the last paragraph - not with the name Python.
This isn't only to prevent the brand 'Python' to be influenced by a project out of the reach of the foundation, but also to prevent confusion for newcomers.
You are absolutely able to go clone their git repo right now (https://github.com/python/cpython) and work on it as your own. You can create updates, backport fixes, etc. You can maintain that well after they cease supporting python 2.7.
You may not call it Python though, because of trademarks.
Many major libraries have already released their last version supporting Python 2 or announced plans to do so by the end of this year, several have already released the first major version that does not support Python 2.
Core decision that Python 2 wouldn't be supported past 2020 played a role in timing, but isn't the decisive factor in why Py 2 is being dropped: many of the projects specifically said Py 2 was holding them back.
> Under the freedoms provided by Free Software licensing, users who have a need to continue to use Python 2 should be able pool their effort to continue to support Python 2.
They are free to do so.
> There was an effort called Python 2.8 to do this, but the Python Software Foundation made it change its name and I don't recall what the new name is.
Tauthon, I think, is the project you are referring to.
> It's not particularly nice that the thing that's compatible with what was called Python to begin with is the one that got renamed.
Free Software principles don't make names public domain; you don't get to steal a project’s name because you object to major release.
This is incorrect. They get to decide when they stop supporting it. Of course that's within their rights, and a 2020 sunset date on a version released in 2010 is a very long LTS window.
> It's not particularly nice that the thing that's compatible with what was called Python to begin with is the one that got renamed.
This is how copyright works. Someone else is free to release a MyPython 2.8 if they'd like, but they're not free to call it Python.
Or the community -- including companies with huge resources and lots of Python 2 code -- will just fork 2.7 and fix it.
Anyone who's every ported a very large project from 2 to 3 might end up despising the PSF for this purpose and might tend to search for a new language (Nim? Go? JS? Scala? Ruby?!). So much for the B in BDFL..
Yeah, but a name like "Cobra, a fork of Python 2.7" will do just as well, and everyone that cares enough will know what it is and where to find it.
More importantly, the fact that major libraries are dropping Python 2 support is not meaningless. (Again, I suppose, it's possible that people could fork IPython, NumPy, Django, etc., from the last Py 2 supporting version and extend support, but that seems even less likely than the core language getting solid support by way of a community fork.)
Also, you should note that most systems that come with python pre-installed still come with 2.x, so the last update to this (March 2016) could have been accommodating that fact.
First Lecture. https://www.youtube.com/watch?v=tKTZoB2Vjuk
I took a couple C classes in college that were geared for people who already knew how to program and hated it. Never wanted to think about it again.
Those videos helped abstract a lot of the low level muck away and build real stuff. Once I was able to understand some of these concepts and why you would actually use them I could go back and learn all the things that were too deep in the weeds to understand.
Its a bit dated now but still some of the best training videos I've seen.
Sure it's mostly outdated, but it really clicked for me. Nick Parlante does a great job, and his codingbat.com was the perfect step 2.
> https://www.udacity.com/courses/all
It's an interesting mix of empowering the learner and getting the learner to use Google products (e.g. you finally make that Android app, you learn how to iterate development, gain traction with users, grow). I wonder to what extent learning from the resources can bring up to parity with a Google developer.
Some years ago in a googs search box i searched for some flag for 'python3 itertools' and googs immediately took me to a subdomain saying, 'does this sort of thing interest you? This is the kind of work we do here at the goog.' then something to the effect of enter your email and answer some obscure python question
Out of curiosity I answered the first few questions but after about four I was more bothered than intrigued and closed the tab and redid the search and this time googs gave me the results I was looking for
It was the only time it's ever happened to me..
Has anyone else ever seen this?
https://thehustle.co/the-secret-google-interview-that-landed...