Learn Programming Starting with Python cover

Learn Programming Starting with Python

Rating 4.2
Word count
162 words
Chapters
40
ISBN
9787121301995

Tags

Summary

Most Python primers take one of two paths: a syntax-listing "manual" or a project-packed "practical guide." Learn Programming Starting with Python takes a third: Python as an anatomy specimen for programming ideas themselves. Author Vamei was a well-known tech writer in the blogosphere, and the book grew out of his "Python Quick Tutorial." That origin—written for people first, compiled into a book later—gives it a natural conversational tone and metaphors: functions are lazy-cook machines, modules are "summoning that sword," regular expressions "look like that sort of thing." Many concepts therefore need no rote memorization; readers finish thinking "so that's how it works." More rare is its treatment of paradigms. Procedural, object-oriented, and functional thinking are usually split across different books and stages; this book places them side by side in one language, letting you see why the same thing can be written this way or that. Chapter 6's "everything is an object" and memory management, and Chapter 7's higher-order functions, are the most thought-provoking parts. A caveat: published in 2017, examples mainly target early Python 3, and some libraries and idioms (certain install steps, crawler examples) may need adjustment today; at about 160,000 characters it aims to "connect the ideas," not "exhaust the details." If your goal is to build a correct programming worldview first and fill in syntax later, it serves better than many thicker books.

Editor's review

市面上的 Python 入门书大多走两条路:要么是罗列语法的“手册”,要么是堆项目的“实战大全”。《从Python开始学编程》选的是第三条路:把 Python 当解剖样本,讲编程思想本身。 作者 Vamei 是当年在博客圈颇有名气的技术写作者,本书脱胎于他的《Python 快速教程》。这种“先写给人看、再整理成书”的来历,让它天然带着口语感和比喻:函数是懒人炒菜机,模块是“引入那把宝剑”,正则表达式“看起来像那样的东西”。很多概念因此不必死记硬背,读者读完会想“原来是这么回事”。 更难得的是它对编程范式的处理。面向过程、面向对象、函数式,这三套思路往往被拆散在不同书里、不同阶段讲,本书却把它们并置在同一个语言里,让你看清同一件事为什么可以这样写、也可以那样写。第 6 章“一切皆对象”与内存管理、第 7 章的高阶函数,是全书最有嚼头的部分。 需要提醒的是:本书 2017 年出版,示例以 Python 3 早期版本为主,个别库与写法(如某些安装步骤、爬虫相关示例)今天运行可能需要调整;篇幅也只有 16 万字左右,是“打通思路”而非“穷尽细节”。如果你的目标是先建立正确的编程世界观,再回头补语法细节,它比很多厚书更好用。

Who it's for

A good fit for

  • 零基础或只会一点代码、想系统理解“编程到底是什么”的初学者
  • 学过其他语言,想借 Python 理解面向对象与函数式编程的转行人
  • 喜欢通过比喻和背景故事理解概念、不喜欢枯燥手册的读者
  • 需要为自学班、社团或入门课挑一本“讲思路”教材的组织者

Not a good fit for

  • 已具备中高级 Python 经验、只想查框架与工程实践的开发者
  • 希望直接用 Flask、Django、数据分析等完整项目练手的读者
  • 需要严格对齐最新 Python 3.12+ 语法与库版本的读者

Reading tips

  1. 边读边在本地敲代码,每章的“代码规范”与“小练习”附录不要跳过,动手比看懂更重要。
  2. 把第 3、4、7 章当成一条主线连着读,比较同一功能用过程式、对象式、函数式写法的差别。
  3. 遇到示例报错先别怀疑自己,很多写法来自 Python 3 早期版本,可对照当前官方文档修正后继续。
  4. 第一遍通读建立框架,第二遍按章做笔记,把“为什么这样设计”的问题单独记下来,回过头逐个解决。

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. Chapter 1 Remaking the World with Programming
  2. 1.1 From Computers to Programming
  3. 1.2 What Programming Actually Does
  4. 1.3 Why Learn Python
  5. 1.4 The Simplest Hello World
  6. Appendix A Installing and Running Python
  7. Appendix B virtualenv
  8. Chapter 2 First, Be a Keyboard Warrior
  9. 2.1 Computers Can Do Arithmetic
  10. 2.2 Computers Have Good Memory
  11. 2.3 Computers Understand Choices
  12. 2.4 Computers Can Loop
  13. Appendix A Small Exercises
  14. Appendix B Code Style
  15. Chapter 3 Process Over Result
  16. 3.1 The Lazy Cook Machine
  17. 3.2 Parameter Passing
  18. 3.3 Recursion
  19. 3.4 Summoning That Sword
  20. 3.5 Exception Handling
  21. Appendix A Setting the Search Path
  22. Appendix B Installing Third-Party Modules
  23. Appendix C Code Style
  24. Chapter 4 Objects on Your Mind
  25. 4.1 Objects Made Easy
  26. 4.2 The Inheritors
  27. 4.3 Objects We Missed Back Then
  28. 4.4 Unexpected Objects
  29. Appendix A Code Style
  30. Chapter 5 Objects Take You Flying
  31. 5.1 Storage
  32. 5.2 An Inch of Time
  33. 5.3 Things That Look Like That
  34. 5.4 Python Is Addicted to the Internet
  35. 5.5 Writing a Crawler
  36. Chapter 6 Going Deeper with Objects
  37. 6.1 Everything Is an Object
  38. 6.2 Attribute Management
  39. 6.3 I Am the Wind, I Am the Sand
  40. 6.4 Memory Management

FAQ

这本书适合完全没有编程基础的人吗?
适合。第 1、2 章从计算机与编程的历史讲起,运算、变量、分支、循环都从零讲,作者的语言也比较口语化。但前提是你愿意动手敲代码,只读不练的话后半部分的对象与函数式内容会跟不上。
书里的 Python 代码现在还能跑吗?
大体思路与语法仍然通用,但本书成稿于 2016 年前后,示例基于 Python 3 早期版本。个别第三方库版本、安装步骤和爬虫示例可能需要按当前文档调整,建议对照 Python 官方文档和所用库的最新说明运行。
它和《Python编程:从入门到实践》有什么区别?
后者篇幅更厚、项目更多,偏“边做边学”;本书只有两百来页,更强调编程范式与设计思想,把面向过程、面向对象、函数式放在一起对比着讲。想快速建立编程世界观选本书,想大量练项目选后者。
作者 Vamei 是谁?
Vamei 是一位中文技术博客作者,本名李劼,其个人技术博客累计点击量超过六百万。本书即改编自他在博客上连载的《Python 快速教程》,因此行文保留了博客式的比喻与讲解节奏。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

Top rated in the same category