原文是英文,使用 Claude 翻译成中文后贴到此处。属于是意识流吐槽

总的来说是推荐大一新生看,大一之后觉得自己可以的其实感觉可以不看0-0,主要是很多 idea 有些显而易见,而且读的挺空虚的

原文链接:https://blog.ynchen.me/SICP-Review
或者看二楼获取原文及摘录


SICP被认为是编程领域最负盛名的教科书之一,经常被称为计算机科学的“圣经”。它不是教你语言,而是教你编程(作为一本入门教材)。我对它有非常高的期望,花了半个月的时间读完前3章。然而,我必须说它没有达到我的期望,我认为它的大部分内容都是“平凡的”。

那么这本书讲了什么呢?一言以蔽之,就是“抽象”和“封装”两个词。

对我来说,抽象意味着提取“相同之处”,将相似的东西放在一起,而封装部分意味着“打包”需要一起使用的东西。

[注] 思考:最基本的抽象
程序都是建立在多重抽象之上的,比如编程语言、操作系统、冯诺依曼机器,甚至是这个世界!我认为世界是一切的最基本抽象,所有其他抽象都是在那个基础上建立的。

SICP也有JavaScript和Python版本,我认为鉴于它有对比版本,JavaScript版本可能是一个不错的选择。许多人会说你应该只读Scheme版本,但我认为这本书重点不是语言,而是其背后的思想,所以我觉得语言其实无关紧要。

[注] Scheme体验
我必须说Scheme的开发者体验不是很好!我使用Racket,似乎书中提到的一些函数都不包含在Racket中。Racket语言服务器很强大,它提供了一些自动补全功能,可以格式化代码,但找到正确的位置关闭括号仍然很麻烦(就像JavaScript一样哈哈)。
在你适应了风格后,代码阅读体验还不错,但代码编写体验有时仍然很沮丧。
Scheme标准似乎是有损失的?所以有时你找不到完全相同的实现,这就像C和C++中的未定义行为一样。老实说有点烦人。

随机笔记
第1章介绍了“过程”,以及我们如何使用它们来建立抽象。这里涉及了许多数学,有点挑战。你需要真正掌握抽象思想和一些数学领悟才能通读它们。我发现一个说法,它是“可执行的数学”,这真的很适合这一章。

Scheme中的括号写起来很烦人,一开始读起来也很烦人。但在你习惯它之后,它变得很容易阅读,编写仍然很烦人。

Scheme中的函数传递真的很强大也令人叹为观止。尽管在函数式编程中可能很平凡,但我还没学过,所以......

这是阅读中最有趣的部分,可能是因为我对这个想法不太熟悉。

第2章介绍了称为“list”的数据,“list”基本上就是C中的链表(LISP代表“LISt Processing”)。许多抽象和封装可以从面向对象编程中学习,所以阅读这部分真的很无聊。

另外注意到Rust和JavaScript等其他语言也从LISP中学习(抄袭)了很多。甚至名字在Rust中也一样哈哈。

第3章基本上是用我们所学的来建立带状态的对象(让我想起react),并介绍了流。流真的很强大,就像JavaScript中的promise一样。我非常喜欢这个想法。

现在消息传递可以通过“channel”实现,我认为“channel”的设计要好得多。

为什么SICP没有达到我的期望
我发现许多概念很显而易见,许多抽象可以从面向对象编程中学到,特别是你对代码有美学追求。唯一的区别是scheme是一个非常灵活和动态的语言,这种感觉是无与伦比的。

如果你是经验丰富的程序员,那么我假设你已经掌握了书试图传达的许多想法的要点。但这本书本身就是一本教科书,我会说练习有时可能很难。尽管不需要先备知识就可以开始,但失败于解决问题可能会非常令人沮丧。有趣的是,在schemewiki上看到许多关于OP(原帖作者)是错误的,勘误也是错误的,勘误的勘误也是错误的的讨论。所以如果你是编程新手,特别是自学的话,这有点挑战性。

而且,并发的想法也可以从数据库理论中学到。

更重要的是,有时我在阅读这本书时会感到一种空虚感,也许是因为它教你抽象,这可能会让人沮丧。读这本书没什么乐趣。

英文原文以及摘录


SICP Review: Languages Die, Long Live Mindsets

Warning: free flowing writing below.

SICP is considered one of the most prestigious textbooks in the programming field and is often referred to as the bible of computer science. Instead of teaching you languages it teaches you programming (as an introductory textbook). I had very high expectations for it and spent half a month reading through the first 3 chapters. However, I have to say that it didn't meet my expectations, and considered much of its content 'trivial'.

So what is the book about? Well, it all comes down to two words: "Abstraction" and "Encapsulation".

For me, abstraction means extracting the "sameness" and putting similarity together, while the encapsulation part means to "package" what is needed to use together.

[!NOTE] Thought: The Fundamental Abstraction
Programes are built on top of multiple abstractions, such as the Programming Languages, the Operating System, the Von Neumann Machine or even The World! I would argue that the world is the fundamental abstraction of all kinds and all other abstractions were built on top of that.

There are also JavaScript and Python versions of SICP and I will say that the JavaScript version may be a good choice given that it has a comparative version. Many people will argue that you should only read the Scheme version, but I will say the book is not about the language but the ideas behind it, so I guess it doesn't really matter.

[!NOTE] The Scheme Experience
I have to say that the developer experience of Scheme is not great! I use Racket and it seems that some of the functions mentioned in the book are not contained in Racket. The Racket language server is great and it provides some auto-completions and can do code formatting, but it's still cumbersome to find the right position to close the parentheses (just like JavaScript lol).
The code reading experience is not bad once you have become accustomed to the style, but the code writing experience is still sometimes frustrating.
It seems that the Scheme standard is lossy? So sometimes you can't find the exact implementation and it is just like the undefined behavior in C and C++. Kind of annoying tbh.

Random Notes

Chapter 1 introduces the "procedures" and how we can use them to build up the abstraction. A lot of math is involved here and it's a bit challenging. You need to really grasp the abstract idea and some of the math insights to get through them. I found a term saying that it is executable math which really suits the chapter.

The parenthesis in scheme is annoying to write and at first annoying to read. But after you get used to it become really easy to read, still frustrating to write.

The function passing in scheme is really powerful and mind-blowing. Even though is may be trivial in functional programming, but I haven't learnt it yet so...

It's the most fun part of reading, maybe because I'm less experienced with this idea.


Chapter 2 introduces "data" called list and the list are basically linked list in C (LISP stands for LISt Processing). A lot of the abstraction and encapsulation can be learned from OOP, so it's really boring to read about this.

Also noticed that other languages such as Rust and JavaScript learned (copied) a lot from LISP. Even the name is the same in Rust 😃.


Chapter 3 basically uses what we have learned to build objects with state (remind me of react) and introduces steam. Stream is really powerful and I work like promise in JavaScript. Really like the idea.

The message passing now can be achieved by channel and I would say the design of channel is much, much better.

Why SICP Didn't Meet My Expectation

I found that a lot of the concepts were trivial and a lot of the abstraction can be learned from OOP, especially if you have a sense of code aesthetic. The only difference is that scheme is a very flexible and dynamic language, and the feeling is just unmatched.

If you are an experienced programmer, then I would assume that you already have the gist of many ideas the book is trying to convey. But the book is itself a textbook, and I would say the exercises can sometimes be hard. Even though no prior knowledge is needed to start, but it could certainly be devastating to fail to solve the problems. It is also fun to see that a lot of discussion on schemewiki is about how OP was wrong, and the errata were also wrong, the errata of the errata were also wrong. So it's a bit challenging if you are new to programming, especially if you are self learning.

Besides, the idea of concurrency can also be better learned from database theory.

What's more, sometimes I feel a sense of emptiness when reading the book, maybe because it teaches you abstraction, and it can be frustrating. Didn't have much fun reading this.

Excerpts

higher-order procedures permit us to manipulate these general methods to create further abstractions.
As programmers, we should be alert to opportunities to identify the underlying abstractions in our programs and to build upon them and generalize them to create more powerful abstractions. This is not to say that one should always write programs in the most abstract way possible; expert programmers know how to choose the level of abstraction appropriate to their task. But it is important to be able to think in terms of these abstractions, so that we can be ready to apply them in new contexts. The significance of higher-order procedures is that they enable us to represent these abstractions explicitly as elements in our programming language, so that they can be handled just like other computational elements.

Encapsulating, or “hiding,” parts of the state of a large system within local variables

Functional programming languages, which do not include any provision for assignment or mutable data.

It is intriguing that a similar connection between time and communication also arises in the theory of Relativity, where the speed of light (the fastest signal that can be used to synchronize events) is a fundamental constant relating time and space. The complexities we encounter in dealing with time and state in our computational models may in fact mirror a fundamental complexity of the physical universe.

Special Thanks for claude to correct my english mistakes.

也许SICP的抽象方法是显然的。然而,比之更显然的事实就是大多数IT从业者缺乏足够的抽象能力。就我教过的学生而言,大概是90%的同学没什么抽象能力。所以,可能我们关注的不是概念、方法是否显然,而更应该关注我们如何能达到应有的能力。

打个比方说,在算法的学习中分治法、贪心法看上去都是显然的,甚至我第一次看贪心法我简直想骂人,这种方法有什么值得教或者学的?但实际情况是,并没有很多人会利用好贪心法。不要小看哈夫曼编码,他用贪心法做出来的是最优编码,而在此之前,就连香农也没有解决这个问题。

与贴主相反,我看SICP时充满了乐趣。可能是因为我没有做完所有的Projects,没有失败的沮丧吧。能享受乐趣很重要啊!

© 2018-2025 0xFFFF