像计算机科学家一样思考Python

(美)Allen B.Downey

出版时间

2013-08-01

ISBN

9787115320926

评分

★★★★★
书籍介绍
这本书最打动人的地方,是它把'编程'和'调试'当成同一件事来讲。作者主张:从一段能运行的代码起步,每改一两行就调试一次,始终让程序保持可用状态。这种'渐进式开发'的思路,对初学者既是方法论,也是心理安慰——它把庞大的编程任务拆解成可掌控的小步。读者反复提及的另一个关键词是'pythonic':与其硬塞代码,不如想清楚为什么这样写,让思维先于语法。书里'问题识别'(把新难题归约为已解问题)'函数帧'等概念,帮助读者在脑中搭建整体框架。不过也有读者指出,部分习题需要前置知识,并非人人友好。它适合把编程当第一门语言、愿意慢下来思考的人,而非追求快速上手项目者。
AI导读
核心看点
  • 侧重培养计算机科学家思维,而非单纯语法罗列
  • 每章专设调试章节,系统讲解错误排查技巧
  • 通过生动示例与练习,引导读者循序渐进掌握编程
读者共识
  • 公认的最佳编程入门书,适合第一门语言学习
  • 有助于养成Pythonic风格,避免不良编程习惯
  • 有编程基础者可能觉得内容过浅,建议跳过
精彩摘录
  • "For some people, programming and debugging are the same thing. That is, programming is the process of gradually debugging a program until it does what you want. The idea is that you should start with a program that does something and make small modifications, debugging them as you go, so that you al"
  • "The final version of the function doesn`t display anything when it runs;it only returns a value.The print statements we wrote are useful for debugging,but once you get the function working,you should remove them.Code like that is called scaffolding because it is helpful for building the program but "
  • "If you were really thinking like a computer scientist, you would have recognized that uses_all was an instance of a previously-solved problem,and you would have written:"
  • "This is an example of a program development method called problem recognition,which means that you recognize the problem you are working on as an instance of a previously-solved problem,and apply a previously-developed solution"
  • "Every time a funtion gets called, Python creates a new [function frame], which contains the function's [local variables and parameters]."
  • "It is important to distinguish between operations that [modify] lists and operations that [creat] new lists."
  • "A [hash] is a function that takes a value (of any kind) and return a integer. Dictionaries use these intergers, called [hash values] to store and look up key-value pairs."
  • "for [instances], the default behavior of the == operator ist the same as the is operator; it checks [object identity], not [object equivalence]."
用户评论
十分适合初学者看!会让人在脑海中搭建一个总的框架,既全面又不失简洁,里面一些题对于我还是挺有挑战性的。作为第一本编程入门学习书最好不过了。当然想要快速上手的话,应该还是直接从项目中学习来得快。
浅俗易懂,即有大量的实例和练习,又有最佳开发实践的介绍。即使是一个没有计算机基础的人看了这本书也可以养成严谨的编程习惯
所以计算机科学家是如何思考python的?
还行的Python入门书
我还没开始读,书就结束了... 尴尬....
非常适合入门,小练习很多,推荐
讲得通俗易懂,适合入门
这真是一本很好的书 简约而不失深度
其他版本已经读过
说真的,这书读得很吃力,感觉自己完全不能像计算机一样思考。如果入门还是推荐《Python编程快速上手 》《 Python编程 从入门到实践》《 Python编程快速上手 让繁琐工作自动化》
下载
收藏