27 ms·
Thinking in Python
- enygmata 1mo agoWhere can I get a physical copy of this?
- alecsm 1mo agoThere's no physical copy. https://thinkinginpython.com/01_Introduction.html https://thinkinginpython.com/01_Introduction.html
- roelschroeven 1mo ago"The book targets Python 3.15 and later" That's a bit weird, Python 3.15 isn't even fully released yet.
- rented_mule 1mo agoYou're right that Python 3.15 is not fully released yet, but it's in prerelease which is defined as: """ After the first beta, no new features can go in, but feature fixes (including significant changes to new features), bug fixes, and security fixes are accepted for the upcoming feature release. """ So it's a fairly well known target. Bruce Eckel published the first edition of this book a quarter of a century ago - he has a pretty good handle on the progression of Python. Definitions and status for all releases is at https://devguide.python.org/versions/ https://devguide.python.org/versions/
- netniuq 1mo agoI think this is great, because it prepares you for the Python coding style for now to in two years, in contrast to from two years ago to now, so the information stays relevant longer.
- a2ff6eeb0 1mo agoSince this is autogenerated, is it possible that it's going to be auto updated as new versions of python come out? That'd be pretty cool. It'd be interesting to see this kind of thing unfold itself into a book. When I feed it into an LLM, do you think it's going to improve the output of the code, or will it need additional prompting?
- gchamonlive 1mo agoCare to provide some examples? Would certainly add to the discussion
- a2ff6eeb0 1mo ago[flagged]
- gchamonlive 1mo agoAnswering a question with another question is rude
- a2ff6eeb0 1mo agoI don't understand the question. Examples of how to use the book to improve LLMs? Examples of how to auto update the book? That's what I was asking for. Are you asking how I know it was autogenerated? It says it right there in the repo.
- dijksterhuis 1mo agoIs it?
- gchamonlive 1mo agoYou say it like this, I'm not sure anymore
- saidinesh5 1mo agoThis is actually an interesting idea... Especially if it gives us an insight into what prompts were given to generate something we approve of vs. something we disapprove.
- thewhitetulip 1mo agoStreamlit library has a skill that directly reads from the DOCSTRING comments inside the Python library!
- ra 1mo agoI originally learned Java in 2000 from Bruce Eckel's "Thinking in Java"
- jkaplowitz 1mo agoMe too, one year before you. A classic.
- sakesun 1mo agoI learn Thinking in C++ from his book for my Master thesis work in 2004
- shevy-java 1mo agoI think I started in late 1990 but I did not like it. Java has much improved though. Slow improvements, probably in part due to Kotlin, but it has gotten better since then. Even though I still think it is needlessly too verbose.
- newtwentysix 1mo agoI felt the same it was too verbose. genuinely curious: what book do you suggest today, to someone who wants to learn Java afresh ?
- Ozzie-D 1mo ago[flagged]
- bigcat12345678 1mo agoI indeed find the formatting quality of the site to be superior. As mentioned below by the author. """ I know some people don’t like AI. Without it, this book wouldn’t exist. The book is free, so if AI bothers you more than the resulting product might benefit you, please ignore this book. Using Claude made me realize how many compromises I’ve made on books in the past. I would get a good idea about something (for example, automatically interleaving commented output in the listings). I either couldn’t implement it, or it seemed too hard, so I didn’t do it. But with AI I can explore and often implement every whim, from things as seemingly straightforward as inserting a new chapter to ones as daunting as that commented-output system. The result is much better than anything I managed before. I keep going until I’ve tweaked everything that occurs to me. """
- xtiansimon 1mo ago> “But with AI I can explore and often implement every whim, from things as seemingly straightforward as…” I had a powerful misreading. I thought the author was saying they used AI to help write chapters they had struggled with before (uh? Yea, it seemed strange for the author of a Python book having trouble with Python…). How about writing custom chapters on request? Surely something that AI can do without trouble. At the right price point I would love a non-linear reading of the book and all that’s necessary for my to understand finally how hooks and callbacks work.
- noobplus 1mo ago[flagged]
- jdw64 1mo agoI think what people call 'AI slop' is probably just unedited content. I actually like this content quite a bit. Rather than whether it was made with AI, I think what matters is whether it accurately matches the specification
- saidinesh5 1mo agoNot just unedited but what feels like low information density... For eg. If you're generating a whole document with a single prompt, say "write a document on how to implement this" vs. "Find various approaches to implement this. These are the approaches we already have. These are the constraints we currently have." Then verify the generated text, remove useless hallucinations. Use the same AI to verify the generated output.
- jdw64 1mo agoActually, isn't GPT-generated(or Gen AI) text much more information-dense than human writing? The challenge with AI prompts is that they don't produce consistent results due to various factors—from AI memory to Agent.md and other influences. I think the difference between AI and human writing is density. When AI generates informational content, it tends to have much deeper density. But where that density is directed seems to depend on the prompt. For example, if you say 'write a blog post automatically,' it tends to produce low-density, verbose text. But if you say 'find counterexamples based on this paper and that paper,' it generates highly dense sentences.
- koiueo 1mo agoAfter I implement some feature, I often ask AI to write an ADR. The code is there, I just mention a few alternatives considered if not obvious from the conversation. Always I ask the LLM to drop the prose and reduce the content by 60%. And it does. Then I go, and edit manually, and often trim it almost twice on top of that. LLMs are professional bullshitters. Like real organic bullshitters they will mask the lack of real understanding with prose decorations.
- adellsworth 1mo agois there anything like this for clang?
- kitd 1mo agoEckel also did "Thinking in C++" https://amzn.eu/d/03uSE3im https://amzn.eu/d/03uSE3im
- pjacotg 1mo agoI posted this link and found out about it on episide 121 of a podcast called Happy Path Programming, which Bruce Eckel hosts. I was aware that he had started and subsequently abandoned writing the book, so was excited to hear he had used Claude to clean up all of his old material for the book.
- JLO64 1mo agoWhile the web version of this book looks fine, I only read books on my Kindle (with KOReader). Thankfully all I had to do was clone the source repo (https://github.com/BruceEckel/ThinkingInPython https://github.com/BruceEckel/ThinkingInPython) and run `make epub` to get a nicely formatted file! It is a bit on the larger side at 7.4MB, but beggars can't be choosers... (On second thought, I'm gonna submit a PR to shrink it as it's mostly from the cover image being 6MB!)
- srean 1mo agoCare to share the epub ? Should be legal.
- ptx 1mo agoThe author is apparently still in the early stages of revising what the AI wrote, according to the README, so readers might want to hold off a bit on downloading the epub. But both the license terms (CC BY-NC-ND 4.0) and the repo's LICENSE.md appear to agree that distributing the epub is OK.
- JLO64 1mo ago> ND (NoDerivatives). If you remix, transform, or build upon the material, you may not distribute the modified material. Unfortunately since I modified the cover image (I ended up resizing it) I don't think I'd be allowed to distribute my EPUB file.
- gcanyon 1mo agoI too would appreciate simple access to the epub.
- JLO64 1mo agoAs mentioned in another comment, I don't think I'm allowed to distribute my modified EPUB as per the repo's license (nor do I really know the best way to do so, I don't use cloud storage). That said, I have written an Issue suggesting making an Action to build EPUBs and place them in the repo's releases: https://github.com/BruceEckel/ThinkingInPython/issues/12 https://github.com/BruceEckel/ThinkingInPython/issues/12 If the people here comment on it, the author might be inclined to add this.
- epgui 1mo agoI would only wish that on my enemies... For god's sake, if you're going to think in a programming language, pick one with strict referential transparency.
- grandimam 1mo agoI had created something along the same lines - a platform for devs to understand Python deeply, and was trying to see if there was a market for such content. The thing that I realised is that even with AI, there has to be distribution available for things like this to gain traction.
- reader9274 1mo ago[dead]
- runningmike 1mo agoNice to see this! Personally, I prefer CC BY-SA to CC BY-NC-ND, but it is certainly much better than 100% protected. Over the years, I've built and maintain a list[1] of CC BY-SA Python books that have no access barriers, such as mandatory account creation or intrusive web trackers. [1] https://nocomplexity.com/documents/pythonbook/bookreferences.html#python-books-free https://nocomplexity.com/documents/pythonbook/bookreferences...
- janpeuker 1mo agoNice formatting - None of the book seems to be about "Thinking" though. It's basically an annotated syntax guide for readers from a C++ background?
- shevy-java 1mo agoSszSszsss... sssssss.... ssssssz! https://bash-org-archive.com/?400459 https://bash-org-archive.com/?400459
- conmod278 1mo agowhy are these low effort and devoid of any content posts being upvoted?
- deleted 1mo ago[deleted]
- codedump 1mo ago[dead]
- andai 1mo agoNot to be confused with Think Python, which is also excellent: https://allendowney.github.io/ThinkPython/ https://allendowney.github.io/ThinkPython/
- izdubar 1mo ago> Python exists to improve your productivity. The language aims to aid you as much as possible. It tries to hinder you as little as possible. It does not impose arbitrary rules or force a particular set of features. Except that everything needs to be reified into a top-level class with a unique name, even if it's just a piece data that you pass into/return from a single function. Also whitespace matters.
- hetman 1mo agoI'm not sure I follow your meaning here. You can return unnamed lists, dictionaries, numbers, among others, or combinations of any of these. With some very light syntax sugar magic you can even make returning tuples look like your returning multiple values. I'm not sure if I would call whitespace-as-syntax arbitrary, though it is opinionated. I admit though that for me it started feeling like a time saver once I got over my anti whitespace as syntax zealotry.
- codethief 1mo agoI've only skimmed the book and even though it was clearly written with the help of AI, there is some very good (and for the Python world novel) stuff in it. I particularly liked the chapter on effects.[0] I very much share the author's opinion that properly managing effects is the future: > The history of programming is a history of scaling barriers. Each time, the pattern is the same. Something the programmer tracks by hand works fine in small programs. Systems grow until hand-tracking fails. The solution moves that tracking into the language or the toolchain, and a generation later, nobody can imagine doing it by hand. […] Effects are the barrier we are inside right now, which is why it is hard to see. [0]: https://thinkinginpython.com/44_Effect_Management.html https://thinkinginpython.com/44_Effect_Management.html
- neves 1mo agoThink fine book is pre AI era
- wqlander 1mo agoFor the people thinking about learning Python: Since 2020 the entire Python ecosystem is a tightly organized, hierarchical structure that only serves the old boys country club to keep their overpaid positions in the industry. Many of these are mediocre, they just rule, let external people do real and hard work and then take the credit. Any dissent is squashed, the official authorities have no qualms about lying and controlling the infrastructure so that no dissent can he heard. It won't change since their inflated salaries depend on it, unless corporations catch on and fire them (like Google did). Supplementary reading: https://zedshaw.com/blog/2020-10-07-authoritarianism-of-code/ https://zedshaw.com/blog/2020-10-07-authoritarianism-of-code... https://www.fast.ai/posts/2020-10-28-code-of-conduct.html https://www.fast.ai/posts/2020-10-28-code-of-conduct.html https://chrismcdonough.substack.com/p/the-shameful-defenestration-of-tim https://chrismcdonough.substack.com/p/the-shameful-defenestr... Better invest in learning a language with multiple implementations like C++. Heck, even Java/Oracle are more democratic than Python.
- deleted 1mo ago[deleted]
- chirau 1mo agoI can see why you chose to use a burner account.
- throwaway330935 1mo agoI've used and been involved in my Python community since the late '90s, and I wish I could say you're totally off the mark here, but... It hits closer to the mark than I'd like. There is a subset of the Python community that I dearly love, but these days the bulk of the Python leadership makes me reluctant to be involved with it. I guess maybe it's a time marches on thing and the leadership serves a very different community than the one I remember. Which is fine if that's what's happening. But I'm not entirely convinced that that is the extent of the story.
- BigTTYGothGF 1mo ago> Better invest in learning a language with multiple implementations like C++ As someone who has spent a little too much of their life having to deal with one cross-implementation C++ incompatibility or another, all I have to say is "good luck with that." > Since 2020 the entire Python ecosystem is a tightly organized, hierarchical structure that only serves the old boys country club Python leadership isn't great, but again to compare it to c++ at least they're not defending and keeping around a convicted rapist and possessor of CSAM.
- ptx 1mo agoThe last pre-AI version seems to be this commit: https://github.com/BruceEckel/ThinkingInPython/tree/76a1310deaa51e02e9f83ab74520b8269aac6fff/Markdown https://github.com/BruceEckel/ThinkingInPython/tree/76a1310d... But that version seems to have some remnants left from Java version of the book, such as talking about visibility modifiers in the testing chapter.
- dzonga 1mo agothese r classic resources. yeah - you might say - you no longer code by hand. but you still need to know how to code properly and use the right idioms. otherwise you r building pies in the sky.
- a2ff6eeb0 1mo agoWhy do I need to do that? I pay Anthropic so that Claude will know it for me. There's not much skill needed to get things done these days -- or at least, we've distilled the skill. "What if it goes wrong?" -- LLMs are already better at debugging than they are at writing code in the first place. They're also already better than all the software engineers I know.
- nathan_compton 1mo agoHonestly, the best thing about LLMs is that they can write the fucking Python code for me. Dismal language, 0/10. You know we live in a fallen world because R4RS existed when JS was invented. Can you imagine a world where the browser was scripted in Scheme?
- YuechenLi 1mo agoFunny the performance section just progressively turned into "don't use Python if you need performance": Remove Python loops and vectorize with NumPy => use Numba JIT'd Python that is only partially compatible with CPython => just don't use Python and write Rust instead for hot loop. Instead of jumping through all this hoops with Python, it's probably easier to write Rust from the beginning instead, because then you won't have to deal with the FFI complexity between Rust and Python at all.
- abbaaminub 1mo agoThat's good