Rendered at 11:43:15 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
JLO64 7 hours ago [-]
While 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) 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 44 minutes ago [-]
Care to share the epub ? Should be legal.
bigcat12345678 10 hours ago [-]
I 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.
"""
ra 11 hours ago [-]
I originally learned Java in 2000 from Bruce Eckel's "Thinking in Java"
shevy-java 6 minutes ago [-]
I 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.
sakesun 5 hours ago [-]
I learn Thinking in C++ from his book for my Master thesis work in 2004
jkaplowitz 11 hours ago [-]
Me too, one year before you. A classic.
runningmike 4 hours ago [-]
Nice 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.
That's a bit weird, Python 3.15 isn't even fully released yet.
rented_mule 12 hours ago [-]
You'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.
I 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.
pjacotg 8 hours ago [-]
I 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.
a2ff6eeb0 12 hours ago [-]
Since 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?
skeledrew 4 hours ago [-]
> this is autogenerated
And then heavily edited by the author, over several iterations. There is no auto-update to create something similar.
saidinesh5 9 hours ago [-]
This 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.
gchamonlive 12 hours ago [-]
Care to provide some examples? Would certainly add to the discussion
a2ff6eeb0 12 hours ago [-]
[flagged]
gchamonlive 12 hours ago [-]
Answering a question with another question is rude
dijksterhuis 11 hours ago [-]
Is it?
gchamonlive 9 hours ago [-]
You say it like this, I'm not sure anymore
a2ff6eeb0 11 hours ago [-]
I 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.
thewhitetulip 4 hours ago [-]
Streamlit library has a skill that directly reads from the DOCSTRING comments inside the Python library!
The "Thinking in" series shaped how an entire generation learned to program. What made those books work wasn't the language coverage, it was that Eckel focused on mental models rather than syntax reference. You came away understanding how to think about the language, not just how to write it. Curious whether that approach translates well to Python, which arguably has a less opinionated object model than Java did.
I 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 9 hours ago [-]
Not 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 9 hours ago [-]
Actually, 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 8 hours ago [-]
After 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.
jdw64 4 hours ago [-]
Take you and me as an example.
When we work, we might start with A, suddenly think of C, briefly jump to D, then B, revise the premise of A, and finally reach a conclusion.
Humans think by constantly shifting between association, working memory, emotion, and social judgment. However, when we write, we organize these scattered results into a coherent structure. In other words, our writing is not a raw dump of human thought, but rather a normalized output of human thought arranged in a logical sequence. I believe that in this specific process, LLMs actually have an advantage over humans.
Because it operates by continuously appending tokens conditioned on the sequence generated so far:
What was just said -> The most natural logical next step -> The most natural logical next step after that.
In short, when it comes to unfolding an already structured logic in a sequential order, I think LLMs are superior to humans. Of course, due to this very nature, they tend to obsess over local context...
You might disagree with me. But if what you say is entirely true, then are the claims that current LLMs are eliminating practice problems for PhD-level mathematicians just a scam?
jdw64 5 hours ago [-]
Honestly, it's a workflow issue, so there is no single right answer.
I agree that an ADR should be concise, for example. However, if your user memory or custom instructions are already set to prefer conciseness, the information density will naturally be high. In my opinion, the fact that an AI adds rhetorical flourishes and unnecessary elaboration alongside essential information is fundamentally a configuration issue.
Furthermore, I suspect what you are referring to is its tendency to output overly accommodating explanations or mechanically neutral phrasing. However, I believe this changes completely if you provide sufficient source material. I think AI is capable of highly complex logical development. I felt this, for instance, when looking at Terence Tao's conversation logs with AI.
I consider using AI to be like pouring water into a tank. If you build the "tank" using academic paper data or strict constraints as your input, it fills that tank with water of much higher purity than most humans could. In fact, it produces drafts of higher purity than if I were to write them myself.
The reason I think this is simple. If standard AI outputs were inherently illogical, there would be no way to explain why it is showing such outstanding results in mathematics, the most logical of all disciplines.
Based on AI papers, my understanding is that the model maps to the word with the highest probability in the semantic space for the next token. Because it selects the semantic word with the highest probability, it completes the sentence based on the statistical likelihood in its dataset following that specific context. Naturally, if you use semantically deep words in your prompt, the output becomes equally deep. Humans are fundamentally inconsistent in maintaining this balance across different domains, but AI operates with perfect homogeneity.
An LLM's core mechanism is predicting the probability distribution of the next token conditioned on the current context, combined with techniques like sampling. However, when you use formal terminology commonly found in academic papers or words with deep semantic weight, the subsequent sentences and structural techniques actually unfold in a highly rigorous and logical manner.
In fact, if we define being "logical" as "faithfully adhering to a procedural development without logical leaps," then I believe LLMs are more logical than humans.
Humans can write at length about subjects they know well, but they falter in areas they do not. AI, on the other hand, can write about other fields with the exact same depth as my own area of expertise, to the point where it eventually generates code that even I cannot understand.
Conversely, if AI is truly nothing more than a "bullshitter," are its recent achievements in mathematics simply a scam? I don't believe that's the case at all.
Ultimately, it is true that our experience varies depending on our workflow and our own expertise. However, I have already seen too much proof to simply dismiss it as bullshit.
dragonwriter 3 hours ago [-]
It depends which people. For a very large contingent “slop” describes ALL GenAI output and is a more of a moral commentary on the use of the technology than an assessment of its qualitative features (it is, really, a statement that the use of AI makes it morally unacceptable to even consider its features.)
For others, sure, both “AI” and “slop" narrow rhe scope compared to the other one used alone.
codedump 2 hours ago [-]
[dead]
reader9274 4 hours ago [-]
[dead]
noobplus 9 hours ago [-]
[flagged]
conmod278 3 hours ago [-]
why are these low effort and devoid of any content posts being upvoted?
epgui 7 hours ago [-]
I 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.
""" 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. """
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.
[1] https://nocomplexity.com/documents/pythonbook/bookreferences...
That's a bit weird, Python 3.15 isn't even fully released yet.
""" 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://allendowney.github.io/ThinkPython/
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?
And then heavily edited by the author, over several iterations. There is no auto-update to create something similar.
Especially if it gives us an insight into what prompts were given to generate something we approve of vs. something we disapprove.
Are you asking how I know it was autogenerated? It says it right there in the repo.
https://bash-org-archive.com/?400459
https://thinkinginpython.com/01_Introduction.html
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.
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.
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.
Humans think by constantly shifting between association, working memory, emotion, and social judgment. However, when we write, we organize these scattered results into a coherent structure. In other words, our writing is not a raw dump of human thought, but rather a normalized output of human thought arranged in a logical sequence. I believe that in this specific process, LLMs actually have an advantage over humans.
Because it operates by continuously appending tokens conditioned on the sequence generated so far: What was just said -> The most natural logical next step -> The most natural logical next step after that.
In short, when it comes to unfolding an already structured logic in a sequential order, I think LLMs are superior to humans. Of course, due to this very nature, they tend to obsess over local context... You might disagree with me. But if what you say is entirely true, then are the claims that current LLMs are eliminating practice problems for PhD-level mathematicians just a scam?
I agree that an ADR should be concise, for example. However, if your user memory or custom instructions are already set to prefer conciseness, the information density will naturally be high. In my opinion, the fact that an AI adds rhetorical flourishes and unnecessary elaboration alongside essential information is fundamentally a configuration issue.
Furthermore, I suspect what you are referring to is its tendency to output overly accommodating explanations or mechanically neutral phrasing. However, I believe this changes completely if you provide sufficient source material. I think AI is capable of highly complex logical development. I felt this, for instance, when looking at Terence Tao's conversation logs with AI.
I consider using AI to be like pouring water into a tank. If you build the "tank" using academic paper data or strict constraints as your input, it fills that tank with water of much higher purity than most humans could. In fact, it produces drafts of higher purity than if I were to write them myself.
The reason I think this is simple. If standard AI outputs were inherently illogical, there would be no way to explain why it is showing such outstanding results in mathematics, the most logical of all disciplines.
Based on AI papers, my understanding is that the model maps to the word with the highest probability in the semantic space for the next token. Because it selects the semantic word with the highest probability, it completes the sentence based on the statistical likelihood in its dataset following that specific context. Naturally, if you use semantically deep words in your prompt, the output becomes equally deep. Humans are fundamentally inconsistent in maintaining this balance across different domains, but AI operates with perfect homogeneity.
An LLM's core mechanism is predicting the probability distribution of the next token conditioned on the current context, combined with techniques like sampling. However, when you use formal terminology commonly found in academic papers or words with deep semantic weight, the subsequent sentences and structural techniques actually unfold in a highly rigorous and logical manner.
In fact, if we define being "logical" as "faithfully adhering to a procedural development without logical leaps," then I believe LLMs are more logical than humans.
Humans can write at length about subjects they know well, but they falter in areas they do not. AI, on the other hand, can write about other fields with the exact same depth as my own area of expertise, to the point where it eventually generates code that even I cannot understand.
Conversely, if AI is truly nothing more than a "bullshitter," are its recent achievements in mathematics simply a scam? I don't believe that's the case at all.
Ultimately, it is true that our experience varies depending on our workflow and our own expertise. However, I have already seen too much proof to simply dismiss it as bullshit.
For others, sure, both “AI” and “slop" narrow rhe scope compared to the other one used alone.