30 comments

[ 11.9 ms ] story [ 1386 ms ] thread
I can't be the only person that read this as Python5.43(...) before realising that 2e is second edition.
Haha, I think for a second before clicking through that somebody was attempting to revive a fork of Python2.
Great completely free resource (pdf download) that can suffice to teach a sufficiently curious person to program.

Something to download, bookmark and throw at people when asked about how to get started.

Back in the day, single-digit years old me had to make-do with AmigaBASIC's manual, which shipped with the Amiga 500. A lucky kid who had a computer at home. It was sufficient to bootstrap my career.

These days, it is all so much more accessible, and yet.

Downey’s “Think” series is gold. As a student I worked through the Python, DSP, and Complexity books and learned a ton. Probably the most helpful thing as a novice programmer was finding a clean and minimal coding style to emulate.
Something extremely satisfying was feeling like Think Complexity was impenetrable then coming back a few years later and finding it approachable.
Agreed. His books are amazingly good resources for learning difficult subjects. I particularly liked Bayes.
If you want to learn python, don’t read anything, start by creating an interesting project then ask for help on the internet. Reading will tire you out and you will feel you don’t have enough understanding to start your own stuff but book exercises
completely agree

you don't read a book about hammers before you hit a nail

depends on whether your first name is Jeremy or James...
Huh?

Not that I oppose picking it up and trying it. But (a) try asking for help on the internet when you haven't rtfm yet and see how it goes (b) personally I love reading about programming languages I'll probably never use... I've never written a line of scheme in my life but SCIP still taught me a lot; and it's always interesting to see the different ways of doing things. (c) there's a reason the word pythonic exists. It's particularly interesting to see the python way of doing stuff, again, even if you don't code in it.

It won't all stick, obviously, until you do a real project, but reading is never a bad idea.

Now is really ask chatGPT, seriously I don’t even need to feel bad asking something over and over even the simpler things that I forgot or even newbie type questions
There's huge amounts of stuff "for complete beginners", which is great.

How about a "learn Python if you got your comsci degree with C 20 years ago but are now in hands off management role" though? :-) I don't need to learn what a variable is for 20th time, but can't jump into "advanced Python" books either, so I've found myself stuck a bit between two extremes.

This is what ChatGPT is made for. I also like to learn concepts by analogy with concepts I already know. Before, you had to search for books and posts made explicitly with this in mind. "Javascript for Python Developers" or the like. Now you can explicitly ask GPT to formulate explanations with your specific context in mind. Game changer.
And made, even, to help me write out a series of tutorials on ChinesePython[0], a topic which intrigued me for years but I always found daunting to learn (along with learning Chinese), what with the lack of materials that used English, so I made this for people completely new to Chinese.

0: https://chinesememe.substack.com/i/103754530/chinesepython

I'm very skeptical of this use case. It's great if it gives you correct information but I often find it ranging from slightly wrong to completely off base.
It sure does, but nevertheless: if you already understand the fundamentals of programming, I'd say this is a fine thing to do with GPT.
But has it ever been harmfully wrong? Like, you run the code and it does the wrong thing, so you work on it until it's right and maybe learn something unexpected along the way, right?

I think it's reasonably analogous to how learning worked without an AI buddy, but it's faster because unlike using search engines for help, you don't have to navigate a space that's weaponized against your attention to find the next useful bit.

That's funny, I'm actually starting to lean that way as well! It can go at the speed or in the direction I choose to. The power is blinding! :-)
I think that’s a problem for most languages with the possible exception of C++. Almost every book and tutorial just assumes that they’re teaching you your very first programming language.
Except for the vast number of books/tutorials of the type "X for Y programmers" with Y often being C. (Or Java or Python or C++.) And X being pretty much anything under the sun.
Official manuals are usually enough for that.
A variable in Python is quite a different beast from a variable in C though.
Agreed; so the 20 books that start with "A variable is like an imaginary box you can put stuff into!", and then lingers on the concept with 4 pages of illustrations and analogies from your childhood, is not useful to me; whereas a book that tells me quickly about global and local scopes in Python, whether it passes variables by values or references, if variables are pointers or not, etc; would be lovely :)
In C, a variable has traditionally been a box (memory location) that you put things into. Possibly a box that can only contain pointers to other boxes. That mental model breaks down slightly with references that modern C++ prefers, but still is useful.

In python a variable is just a name. Assigments change what object this name references. But nobody is ever going to change which object this name references, unless you do it yourself. They can mutate the object, but not the name, if that makes sense.

Python's official reference might be more appropriate for this. But sometimes, even if things seem similar (e.g. both languages have variables), the semantics might be different. C/C++ has passing by value or by reference. Python and Java has neither, you can mutate the object, but you cannot reassign it (so you can't change the value of an int, but you can change some field of an object.
I learnt Python with this book. Every chapter in this book has awesome exercises which I miss in (a few) other books. Whenever someone asks me how to learn Python, I share them this book (Python 3 version of course).